diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2005-03-17 01:25:01 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2005-03-17 01:25:01 +0000 |
commit | f3356e9c9eb8dc62925aaecf2ceec84106e06c6e (patch) | |
tree | bdadaff376c4d694349c32c1b347d5e30d83fb3d /libavformat/flvdec.c | |
parent | cc973ecbe77ee6c273e2372ad24bb3aff0be5440 (diff) | |
download | ffmpeg-f3356e9c9eb8dc62925aaecf2ceec84106e06c6e.tar.gz |
more fine grained discarding of packets
Originally committed as revision 4051 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/flvdec.c')
-rw-r--r-- | libavformat/flvdec.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index ba024aec38..379e9099ad 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -105,7 +105,11 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) st->codec.frame_rate_base= 1; st->codec.frame_rate= 1000; } - if(st->discard){ +// av_log(NULL, AV_LOG_DEBUG, "%d %X %d \n", is_audio, flags, st->discard); + if( (st->discard >= AVDISCARD_NONKEY && !((flags >> 4)==1 || is_audio)) + ||(st->discard >= AVDISCARD_BIDIR && ((flags >> 4)==3 && !is_audio)) + || st->discard >= AVDISCARD_ALL + ){ url_fskip(&s->pb, size); continue; } @@ -158,7 +162,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) pkt->pts = pts; pkt->stream_index = st->index; - if (!is_audio && ((flags >> 4)==1)) + if (is_audio || ((flags >> 4)==1)) pkt->flags |= PKT_FLAG_KEY; return ret; |