mpegtsdemux: fix memleaks and refcounts
authorWim Taymans <wim.taymans@collabora.co.uk>
Thu, 21 May 2009 14:00:46 +0000 (16:00 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Fri, 22 May 2009 09:02:07 +0000 (11:02 +0200)
Use correct constants for PID_type so that we clear the right filter.
provide_clock must return a ref to a clock.

gst/mpegdemux/gstmpegtsdemux.c

index cad385d08e21d7c156cc35bf1ea6c16b71ac64a2..6438e880d7ac41c68a33af5a7be50cbd5cdb126f 100644 (file)
@@ -382,8 +382,8 @@ gst_mpegts_demux_reset (GstMpegTSDemux * demux)
         case PID_TYPE_ELEMENTARY:
           gst_pes_filter_uninit (&stream->filter);
           break;
-        case PID_PROGRAM_ASSOCIATION_TABLE:
-        case PID_CONDITIONAL_ACCESS_TABLE:
+        case PID_TYPE_PROGRAM_ASSOCIATION:
+        case PID_TYPE_CONDITIONAL_ACCESS:
         case PID_TYPE_PROGRAM_MAP:
           gst_section_filter_uninit (&stream->section_filter);
           break;
@@ -2620,8 +2620,7 @@ gst_mpegts_demux_provide_clock (GstElement * element)
           "MpegTSClock", NULL);
       demux->clock_base = GST_CLOCK_TIME_NONE;
     }
-
-    return demux->clock;
+    return gst_object_ref (demux->clock);
   }
 
   return NULL;