avformat/utils: do not wait for packets from discarded streams for genpts
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 12 Jul 2014 23:07:59 +0000 (01:07 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 8 Aug 2014 14:19:48 +0000 (16:19 +0200)
Fixes long loop
Fixes Ticket3208

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8202c49b43621c04e26d4a3aa83a10e1e5cc1836)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/utils.c

index 48882be..e42c1fc 100644 (file)
@@ -1532,7 +1532,8 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt)
             }
 
             /* read packet from packet buffer, if there is data */
-            if (!(next_pkt->pts == AV_NOPTS_VALUE &&
+            st = s->streams[next_pkt->stream_index];
+            if (!(next_pkt->pts == AV_NOPTS_VALUE && st->discard < AVDISCARD_ALL &&
                   next_pkt->dts != AV_NOPTS_VALUE && !eof)) {
                 ret = read_from_packet_buffer(&s->packet_buffer,
                                                &s->packet_buffer_end, pkt);