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/nut.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/nut.c')
-rw-r--r-- | libavformat/nut.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libavformat/nut.c b/libavformat/nut.c index daa429c848..645ca5986c 100644 --- a/libavformat/nut.c +++ b/libavformat/nut.c @@ -1222,14 +1222,18 @@ av_log(s, AV_LOG_DEBUG, "fs:%lld fc:%d ft:%d kf:%d pts:%lld size:%d mul:%d lsb:% static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code, int frame_type, int64_t frame_start){ AVFormatContext *s= nut->avf; ByteIOContext *bc = &s->pb; - int size, stream_id, key_frame; - int64_t pts; + int size, stream_id, key_frame, discard; + int64_t pts, last_IP_pts; size= decode_frame_header(nut, &key_frame, &pts, &stream_id, frame_code, frame_type, frame_start); if(size < 0) return -1; - if(s->streams[ stream_id ]->discard){ + discard= s->streams[ stream_id ]->discard; + last_IP_pts= s->streams[ stream_id ]->last_IP_pts; + if( (discard >= AVDISCARD_NONKEY && !key_frame) + ||(discard >= AVDISCARD_BIDIR && last_IP_pts != AV_NOPTS_VALUE && last_IP_pts > pts) + || discard >= AVDISCARD_ALL){ url_fskip(bc, size); return 1; } |