summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorJeff Downs <heydowns@borg.com>2007-11-17 03:14:43 +0000
committerJeff Downs <heydowns@borg.com>2007-11-17 03:14:43 +0000
commit28af284cfb44cb198c1b1c01e61c90b10fd9e395 (patch)
treed8ce5d0a670bc3bbcbd48f7c1d7a8eb192f040c0 /libavformat
parente240f898ffd2169d9147ccb0b557620e11f66597 (diff)
When new streams are detected, look for old filters and close them out.
This avoids crashes seen when legitimate streams are found on PID 0x11 instead of DVB SDT. Fixes regression detailed in Roundup issue 138. Originally committed as revision 11050 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mpegts.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 9554c5acfd..9c60081301 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -588,11 +588,11 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
case STREAM_TYPE_AUDIO_AC3:
case STREAM_TYPE_AUDIO_DTS:
case STREAM_TYPE_SUBTITLE_DVB:
- if(ts->pids[pid]){
- assert(ts->pids[pid]->type == MPEGTS_PES);
+ if(ts->pids[pid] && ts->pids[pid]->type == MPEGTS_PES){
pes= ts->pids[pid]->u.pes_filter.opaque;
st= pes->st;
}else{
+ if (ts->pids[pid]) mpegts_close_filter(ts, ts->pids[pid]); //wrongly added sdt filter probably
pes = add_pes_stream(ts, pid, pcr_pid, stream_type);
if (pes)
st = new_pes_av_stream(pes, 0);