Mercurial > libavformat.hg
changeset 650:c129846f7f02 libavformat
support discarding of uninterresting packets
author | michael |
---|---|
date | Sat, 22 Jan 2005 01:48:11 +0000 |
parents | 25825079f833 |
children | 6a5ba24b2c6b |
files | avformat.h avidec.c |
diffstat | 2 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/avformat.h Fri Jan 21 23:38:09 2005 +0000 +++ b/avformat.h Sat Jan 22 01:48:11 2005 +0000 @@ -227,6 +227,8 @@ int pts_wrap_bits; /* number of bits in pts (used for wrapping control) */ /* ffmpeg.c private use */ int stream_copy; /* if TRUE, just copy stream */ + int discard; ///< if 1, packets can be discarded at will and dont need to be demuxed + //FIXME move stuff to a flags field? /* quality, as it has been removed from AVCodecContext and put in AVVideoFrame * MN:dunno if thats the right place, for it */ float quality;
--- a/avidec.c Fri Jan 21 23:38:09 2005 +0000 +++ b/avidec.c Sat Jan 22 01:48:11 2005 +0000 @@ -449,6 +449,11 @@ AVIStream *ast; st = s->streams[n]; ast = st->priv_data; + + if(st->discard){ + url_fskip(pb, size); + goto resync; + } if( ((ast->prefix_count<5 || sync+9 > i) && d[2]<128 && d[3]<128) || d[2]*256+d[3] == ast->prefix /*||