aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2009-07-29 02:17:08 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2009-07-29 02:17:08 +0000
commitd46c84ea31f3e8d4c5d2bc5a13386ddfafa68324 (patch)
tree2ebcb934d6b1d1270140cff105d2fe6a12efa194
parent1aae34890c71137768e59a858f65fb42509c613b (diff)
downloadffmpeg-d46c84ea31f3e8d4c5d2bc5a13386ddfafa68324.tar.gz
Stop parsing in read_header only after finding pmt, and
do not close pat filter so further pmt can be parsed. Fix issue #1294. Originally committed as revision 19530 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/mpegts.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 0d38e6f92a..f6dff78a58 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -640,6 +640,11 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
p += program_info_length;
if (p >= p_end)
return;
+
+ // stop parsing after pmt, we found header
+ if (!ts->stream->nb_streams)
+ ts->stop_parse = 1;
+
for(;;) {
st = 0;
stream_type = get8(&p, p_end);
@@ -725,7 +730,6 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
p = desc_list_end;
}
/* all parameters are there */
- ts->stop_parse++;
mpegts_close_filter(ts, filter);
}
@@ -762,17 +766,12 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
/* NIT info */
} else {
av_new_program(ts->stream, sid);
- ts->stop_parse--;
mpegts_open_section_filter(ts, pmt_pid, pmt_cb, ts, 1);
add_pat_entry(ts, sid);
add_pid_to_pmt(ts, sid, 0); //add pat pid to program
add_pid_to_pmt(ts, sid, pmt_pid);
}
}
- /* not found */
- ts->stop_parse++;
-
- mpegts_close_filter(ts, filter);
}
static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len)