mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
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
This commit is contained in:
parent
120b4557f3
commit
75bb7b0add
10
ffplay.c
10
ffplay.c
@ -1919,6 +1919,7 @@ static int decode_thread(void *arg)
|
|||||||
int err, i, ret, video_index, audio_index, subtitle_index;
|
int err, i, ret, video_index, audio_index, subtitle_index;
|
||||||
AVPacket pkt1, *pkt = &pkt1;
|
AVPacket pkt1, *pkt = &pkt1;
|
||||||
AVFormatParameters params, *ap = ¶ms;
|
AVFormatParameters params, *ap = ¶ms;
|
||||||
|
int eof=0;
|
||||||
|
|
||||||
video_index = -1;
|
video_index = -1;
|
||||||
audio_index = -1;
|
audio_index = -1;
|
||||||
@ -2072,7 +2073,7 @@ static int decode_thread(void *arg)
|
|||||||
SDL_Delay(10);
|
SDL_Delay(10);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(url_feof(ic->pb)) {
|
if(url_feof(ic->pb) || eof) {
|
||||||
av_init_packet(pkt);
|
av_init_packet(pkt);
|
||||||
pkt->data=NULL;
|
pkt->data=NULL;
|
||||||
pkt->size=0;
|
pkt->size=0;
|
||||||
@ -2082,11 +2083,12 @@ static int decode_thread(void *arg)
|
|||||||
}
|
}
|
||||||
ret = av_read_frame(ic, pkt);
|
ret = av_read_frame(ic, pkt);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
if (ret != AVERROR_EOF && url_ferror(ic->pb) == 0) {
|
if (ret == AVERROR_EOF)
|
||||||
|
eof=1;
|
||||||
|
if (url_ferror(ic->pb))
|
||||||
|
break;
|
||||||
SDL_Delay(100); /* wait for user event */
|
SDL_Delay(100); /* wait for user event */
|
||||||
continue;
|
continue;
|
||||||
} else
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
if (pkt->stream_index == is->audio_stream) {
|
if (pkt->stream_index == is->audio_stream) {
|
||||||
packet_queue_put(&is->audioq, pkt);
|
packet_queue_put(&is->audioq, pkt);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user