From: Edward Hervey Date: Tue, 19 Jul 2011 07:36:10 +0000 (+0200) Subject: mpegtsbase: Avoid double removal of streams X-Git-Tag: 1.19.3~507^2~16045^2~48 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2b127601e917e24bee62bd0ff57a0c0c15fd8292;p=platform%2Fupstream%2Fgstreamer.git mpegtsbase: Avoid double removal of streams This can happen if the PCR pid is the same as a audio/video PID. --- diff --git a/gst/mpegtsdemux/mpegtsbase.c b/gst/mpegtsdemux/mpegtsbase.c index e4118b6..534b108 100644 --- a/gst/mpegtsdemux/mpegtsbase.c +++ b/gst/mpegtsdemux/mpegtsbase.c @@ -502,11 +502,18 @@ void mpegts_base_program_remove_stream (MpegTSBase * base, MpegTSBaseProgram * program, guint16 pid) { - MpegTSBaseClass *klass = GST_MPEGTS_BASE_GET_CLASS (base); + MpegTSBaseClass *klass; MpegTSBaseStream *stream = program->streams[pid]; GST_DEBUG ("pid:0x%04x", pid); + if (G_UNLIKELY (stream == NULL)) { + /* Can happen if the PCR PID is the same as a audio/video PID */ + GST_DEBUG ("Stream already removed"); + return; + } + + klass = GST_MPEGTS_BASE_GET_CLASS (base); /* If subclass needs it, inform it of the stream we are about to remove */ if (klass->stream_removed)