diff options
author | Roman Shaposhnik <roman@shaposhnik.org> | 2003-10-04 03:31:27 +0000 |
---|---|---|
committer | Roman Shaposhnik <roman@shaposhnik.org> | 2003-10-04 03:31:27 +0000 |
commit | 39518b493f4780f1cd5d8e45aed728049a74d556 (patch) | |
tree | 0d888a87e32c982202a8874cc596015440ed43f5 /ffmpeg.c | |
parent | 5a00941b0690968b7309854d188eb63f3a9c6fa2 (diff) | |
download | ffmpeg-39518b493f4780f1cd5d8e45aed728049a74d556.tar.gz |
* 10000l (cut'n'paste is evil!)
* Fix from Charles Yates for 0 sized packets
Originally committed as revision 2341 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffmpeg.c')
-rw-r--r-- | ffmpeg.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -540,12 +540,12 @@ static void do_video_out(AVFormatContext *s, int size; /* create temporary picture */ - size = avpicture_get_size(enc->pix_fmt, dec->width, dec->height); + size = avpicture_get_size(target_pixfmt, dec->width, dec->height); buf = av_malloc(size); if (!buf) return; formatted_picture = &picture_format_temp; - avpicture_fill(formatted_picture, buf, enc->pix_fmt, dec->width, dec->height); + avpicture_fill(formatted_picture, buf, target_pixfmt, dec->width, dec->height); if (img_convert(formatted_picture, target_pixfmt, in_picture, dec->pix_fmt, @@ -1256,7 +1256,7 @@ static int av_encode(AVFormatContext **output_files, len = pkt.size; ptr = pkt.data; - while (len > 0) { + do { /* decode the packet if needed */ data_buf = NULL; /* fail safe */ data_size = 0; @@ -1314,7 +1314,7 @@ static int av_encode(AVFormatContext **output_files, av_free_packet(&pkt); goto redo; } - if (!got_picture) { + if (len != 0 && !got_picture) { /* no picture yet */ ptr += ret; len -= ret; @@ -1431,7 +1431,7 @@ static int av_encode(AVFormatContext **output_files, } } av_free(buffer_to_free); - } + } while (len > 0); discard_packet: av_free_packet(&pkt); |