1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Inject NULL packets into the video packet que at EOF to force all delayed

frames to be output.

Originally committed as revision 16484 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer 2009-01-07 20:45:39 +00:00
parent 9f06bd9e96
commit 600a331c27

View File

@ -2063,12 +2063,19 @@ static int decode_thread(void *arg)
/* if the queue are full, no need to read more */ /* if the queue are full, no need to read more */
if (is->audioq.size > MAX_AUDIOQ_SIZE || if (is->audioq.size > MAX_AUDIOQ_SIZE ||
is->videoq.size > MAX_VIDEOQ_SIZE || is->videoq.size > MAX_VIDEOQ_SIZE ||
is->subtitleq.size > MAX_SUBTITLEQ_SIZE || is->subtitleq.size > MAX_SUBTITLEQ_SIZE) {
url_feof(ic->pb)) {
/* wait 10 ms */ /* wait 10 ms */
SDL_Delay(10); SDL_Delay(10);
continue; continue;
} }
if(url_feof(ic->pb)) {
av_init_packet(pkt);
pkt->data=
pkt->size=0;
pkt->stream_index= is->video_stream;
packet_queue_put(&is->videoq, pkt);
continue;
}
ret = av_read_frame(ic, pkt); ret = av_read_frame(ic, pkt);
if (ret < 0) { if (ret < 0) {
if (url_ferror(ic->pb) == 0) { if (url_ferror(ic->pb) == 0) {