Ticket #1041: videobuffers.diff

File videobuffers.diff, 1.0 KB (added by jwestfall@…, 18 years ago)

use av_malloc() in VideoBuffers::CreateBuffers?() instead of new

  • libs/libmythtv/videobuffers.cpp

     
    44#include <unistd.h>
    55#include "mythcontext.h"
    66#include "videobuffers.h"
     7#include "../libavcodec/avcodec.h"
    78
    89#ifdef USING_XVMC
    910#include "videoout_xv.h" // for xvmc stuff
     
    10721073    uint buf_size = (width * height * bpp + 4/* to round up */) / bpb;
    10731074    while (bufs.size() < allocSize())
    10741075    {
    1075         unsigned char *data = new unsigned char[buf_size + 64];
     1076        unsigned char *data = (unsigned char*)av_malloc(buf_size + 64);
    10761077
    10771078        // init buffers (y plane to 0, u/v planes to 127),
    10781079        // to prevent green screens..
     
    12021203    allocated_structs.clear();
    12031204
    12041205    for (uint i = 0; i < allocated_arrays.size(); i++)
    1205         delete [] allocated_arrays[i];
     1206        av_free(allocated_arrays[i]);
    12061207    allocated_arrays.clear();
    12071208#ifdef USING_XVMC
    12081209    xvmc_surf_to_frame.clear();