You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
mpegts: fix return value when enough ts packets have been parsed or when the first PMT has been seen.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
committed by
Michael Niedermayer
parent
e662b263d9
commit
49ec0c818d
@@ -1106,7 +1106,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
|
|||||||
|
|
||||||
// stop parsing after pmt, we found header
|
// stop parsing after pmt, we found header
|
||||||
if (!ts->stream->nb_streams)
|
if (!ts->stream->nb_streams)
|
||||||
ts->stop_parse = 1;
|
ts->stop_parse = 2;
|
||||||
|
|
||||||
for(;;) {
|
for(;;) {
|
||||||
st = 0;
|
st = 0;
|
||||||
@@ -1462,11 +1462,15 @@ static int handle_packets(MpegTSContext *ts, int nb_packets)
|
|||||||
ts->stop_parse = 0;
|
ts->stop_parse = 0;
|
||||||
packet_num = 0;
|
packet_num = 0;
|
||||||
for(;;) {
|
for(;;) {
|
||||||
if (ts->stop_parse>0)
|
|
||||||
break;
|
|
||||||
packet_num++;
|
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;
|
break;
|
||||||
|
}
|
||||||
|
if (ts->stop_parse > 0)
|
||||||
|
break;
|
||||||
|
|
||||||
ret = read_packet(s, packet, ts->raw_packet_size);
|
ret = read_packet(s, packet, ts->raw_packet_size);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user