mpegts: do not return from ff_mpegts_parse_packet() after having seen the first PMT

It prevents leaving the AVPacket uninitialized.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/2/head
Laurent Aimar 13 years ago committed by Michael Niedermayer
parent 49ec0c818d
commit bc38e83793
  1. 6
      libavformat/mpegts.c

@ -1894,10 +1894,8 @@ int ff_mpegts_parse_packet(MpegTSContext *ts, AVPacket *pkt,
len1 = len; len1 = len;
ts->pkt = pkt; ts->pkt = pkt;
ts->stop_parse = 0;
for(;;) { for(;;) {
if (ts->stop_parse>0) ts->stop_parse = 0;
break;
if (len < TS_PACKET_SIZE) if (len < TS_PACKET_SIZE)
return -1; return -1;
if (buf[0] != 0x47) { if (buf[0] != 0x47) {
@ -1907,6 +1905,8 @@ int ff_mpegts_parse_packet(MpegTSContext *ts, AVPacket *pkt,
handle_packet(ts, buf); handle_packet(ts, buf);
buf += TS_PACKET_SIZE; buf += TS_PACKET_SIZE;
len -= TS_PACKET_SIZE; len -= TS_PACKET_SIZE;
if (ts->stop_parse == 1)
break;
} }
} }
return len1 - len; return len1 - len;

Loading…
Cancel
Save