summaryrefslogtreecommitdiff
path: root/libavformat/mpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2005-01-22 13:36:02 +0000
committerMichael Niedermayer <michaelni@gmx.at>2005-01-22 13:36:02 +0000
commitb9866ebcc7d9891fb6b07cab70319fe1742a100a (patch)
tree3e74ec233cd2ef881ee097956e7a8ca3e6b215cf /libavformat/mpeg.c
parente19456e3ee263ae1c46b623c8394394710721ff4 (diff)
support discarding uninterresting packets
Originally committed as revision 3860 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mpeg.c')
-rw-r--r--libavformat/mpeg.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index d7e94bb6db..e512752dc2 100644
--- a/libavformat/mpeg.c
+++ b/libavformat/mpeg.c
@@ -1533,6 +1533,8 @@ static int mpegps_read_packet(AVFormatContext *s,
if (codec_id != CODEC_ID_PCM_S16BE)
st->need_parsing = 1;
found:
+ if(st->discard)
+ goto skip;
if (startcode >= 0xa0 && startcode <= 0xbf) {
int b1, freq;
@@ -1555,8 +1557,8 @@ static int mpegps_read_packet(AVFormatContext *s,
pkt->dts = dts;
pkt->stream_index = st->index;
#if 0
- av_log(s, AV_LOG_DEBUG, "%d: pts=%0.3f dts=%0.3f\n",
- pkt->stream_index, pkt->pts / 90000.0, pkt->dts / 90000.0);
+ av_log(s, AV_LOG_DEBUG, "%d: pts=%0.3f dts=%0.3f size=%d\n",
+ pkt->stream_index, pkt->pts / 90000.0, pkt->dts / 90000.0, pkt->size);
#endif
return 0;