diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2009-04-19 20:24:44 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2009-04-19 20:24:44 +0000 |
commit | 75bb7b0addbe11b1a2a656107a074b7d5dc492e5 (patch) | |
tree | 33a9fd8c325dea78d735da0b20d4899455fe9b5d /ffplay.c | |
parent | 120b4557f3deb855d3438a336a1e610d03c1d8ce (diff) | |
download | ffmpeg-75bb7b0addbe11b1a2a656107a074b7d5dc492e5.tar.gz |
Make sure that video frames are flushed at EOF.
This should fix a regression.
Originally committed as revision 18624 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffplay.c')
-rw-r--r-- | ffplay.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -1919,6 +1919,7 @@ static int decode_thread(void *arg) int err, i, ret, video_index, audio_index, subtitle_index; AVPacket pkt1, *pkt = &pkt1; AVFormatParameters params, *ap = ¶ms; + int eof=0; video_index = -1; audio_index = -1; @@ -2072,7 +2073,7 @@ static int decode_thread(void *arg) SDL_Delay(10); continue; } - if(url_feof(ic->pb)) { + if(url_feof(ic->pb) || eof) { av_init_packet(pkt); pkt->data=NULL; pkt->size=0; @@ -2082,11 +2083,12 @@ static int decode_thread(void *arg) } ret = av_read_frame(ic, pkt); if (ret < 0) { - if (ret != AVERROR_EOF && url_ferror(ic->pb) == 0) { - SDL_Delay(100); /* wait for user event */ - continue; - } else + if (ret == AVERROR_EOF) + eof=1; + if (url_ferror(ic->pb)) break; + SDL_Delay(100); /* wait for user event */ + continue; } if (pkt->stream_index == is->audio_stream) { packet_queue_put(&is->audioq, pkt); |