Commit feef77ec authored by Laurent Aimar's avatar Laurent Aimar Committed by Michael Niedermayer
Browse files

mpegts: fix return value when enough ts packets have been parsed or when the...

mpegts: fix return value when enough ts packets have been parsed or when the first PMT has been seen.
Signed-off-by: default avatarMichael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 49ec0c81

)
Signed-off-by: default avatarMichael Niedermayer <michaelni@gmx.at>
parent f5311936
Showing with 8 additions and 4 deletions
+8 -4
......@@ -1083,7 +1083,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
// stop parsing after pmt, we found header
if (!ts->stream->nb_streams)
ts->stop_parse = 1;
ts->stop_parse = 2;
for(;;) {
st = 0;
......@@ -1403,11 +1403,15 @@ static int handle_packets(MpegTSContext *ts, int nb_packets)
ts->stop_parse = 0;
packet_num = 0;
for(;;) {
if (ts->stop_parse>0)
break;
packet_num++;
if (nb_packets != 0 && packet_num >= nb_packets)
if (nb_packets != 0 && packet_num >= nb_packets ||
ts->stop_parse > 1) {
ret = AVERROR(EAGAIN);
break;
}
if (ts->stop_parse > 0)
break;
ret = read_packet(s, packet, ts->raw_packet_size);
if (ret != 0)
return ret;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment