Browse Source

fixing stackoverflow

Originally committed as revision 618 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Michael Niedermayer 23 years ago
parent
commit
33a1f1a3c1
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      ffmpeg.c

+ 7
- 2
ffmpeg.c View File

@@ -417,10 +417,14 @@ static void do_video_out(AVFormatContext *s,
int n1, n2, nb, i, ret, frame_number, dec_frame_rate; int n1, n2, nb, i, ret, frame_number, dec_frame_rate;
AVPicture *picture, *picture2, *pict; AVPicture *picture, *picture2, *pict;
AVPicture picture_tmp1, picture_tmp2; AVPicture picture_tmp1, picture_tmp2;
UINT8 video_buffer[1024*1024];
UINT8 *video_buffer;
UINT8 *buf = NULL, *buf1 = NULL; UINT8 *buf = NULL, *buf1 = NULL;
AVCodecContext *enc, *dec; AVCodecContext *enc, *dec;


#define VIDEO_BUFFER_SIZE (1024*1024)
video_buffer= av_malloc(VIDEO_BUFFER_SIZE);
if(!video_buffer) return;

enc = &ost->st->codec; enc = &ost->st->codec;
dec = &ist->st->codec; dec = &ist->st->codec;


@@ -501,7 +505,7 @@ static void do_video_out(AVFormatContext *s,
} }
ret = avcodec_encode_video(enc, ret = avcodec_encode_video(enc,
video_buffer, sizeof(video_buffer),
video_buffer, VIDEO_BUFFER_SIZE,
picture); picture);
//enc->frame_number = enc->real_pict_num; //enc->frame_number = enc->real_pict_num;
s->oformat->write_packet(s, ost->index, video_buffer, ret, 0); s->oformat->write_packet(s, ost->index, video_buffer, ret, 0);
@@ -516,6 +520,7 @@ static void do_video_out(AVFormatContext *s,
the_end: the_end:
av_free(buf); av_free(buf);
av_free(buf1); av_free(buf1);
av_free(video_buffer);
} }


static void do_video_stats(AVOutputStream *ost, static void do_video_stats(AVOutputStream *ost,


Loading…
Cancel
Save