summaryrefslogtreecommitdiff
path: root/libavformat/rmdec.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2009-03-09 12:42:53 +0000
committerRonald S. Bultje <rsbultje@gmail.com>2009-03-09 12:42:53 +0000
commitdc3685e12999f106dd8e576e5b7d5543d4f70fa1 (patch)
treec1e2ac318a10516a85a34b3560fe4e348474708b /libavformat/rmdec.c
parentd71d64dcc1fec5fcc015366a0a668db63f138ff1 (diff)
Move frame discarding out of the ff_rm_parse_packet() loop, and respect
rm->audio_pkt_cnt in case multiple packets should be read before the next syncpoint in the file, so that ffplay -an on a file containing AAC audio works. See "[PATCH] Make RM demuxer behave better with -an option" thread on mailinglist. Originally committed as revision 17908 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rmdec.c')
-rw-r--r--libavformat/rmdec.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index 5e3b3c760c..3bd0f0dd9a 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -643,12 +643,6 @@ ff_rm_parse_packet (AVFormatContext *s, ByteIOContext *pb,
} else
av_get_packet(pb, pkt, len);
- if( (st->discard >= AVDISCARD_NONKEY && !(*flags&2))
- || st->discard >= AVDISCARD_ALL){
- av_free_packet(pkt);
- return -1;
- }
-
pkt->stream_index = st->index;
#if 0
@@ -749,6 +743,16 @@ resync:
&seq, &flags, &timestamp) < 0)
goto resync;
+ if( (st->discard >= AVDISCARD_NONKEY && !(flags&2))
+ || st->discard >= AVDISCARD_ALL){
+ av_free_packet(pkt);
+ while (rm->audio_pkt_cnt > 0) {
+ ff_rm_retrieve_cache(s, s->pb, st, st->priv_data, pkt);
+ av_free_packet(pkt);
+ }
+ goto resync;
+ }
+
if((flags&2) && (seq&0x7F) == 1)
av_add_index_entry(st, pos, timestamp, 0, 0, AVINDEX_KEYFRAME);
}