support discarding uninterresting packets

Originally committed as revision 3860 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer
2005-01-22 13:36:02 +00:00
parent e19456e3ee
commit b9866ebcc7
8 changed files with 33 additions and 9 deletions

View File

@@ -811,7 +811,7 @@ static int rm_read_packet(AVFormatContext *s, AVPacket *pkt)
st = s->streams[0];
} else {
int seq=1;
resync:
len=sync(s, &timestamp, &flags, &i, &pos);
if(len<0)
return AVERROR_IO;
@@ -841,6 +841,11 @@ static int rm_read_packet(AVFormatContext *s, AVPacket *pkt)
len=len2;
rm->remaining_len-= len;
}
if(st->discard){
url_fskip(pb, len);
goto resync;
}
av_new_packet(pkt, len);
pkt->stream_index = i;