]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/gst-plugins-ugly0-10.git/commitdiff
gst/mpegstream/: Don't leak element and pad names in error messages, use
authorTim-Philipp Müller <tim@centricular.net>
Tue, 28 Mar 2006 19:44:51 +0000 (19:44 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Tue, 28 Mar 2006 19:44:51 +0000 (19:44 +0000)
Original commit message from CVS:
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_event),
(gst_dvd_demux_handle_dvd_event), (gst_dvd_demux_get_audio_stream),
(gst_dvd_demux_get_subpicture_stream):
* gst/mpegstream/gstmpegdemux.c:
(gst_mpeg_demux_sync_stream_to_time):
Don't leak element and pad names in error messages, use
GST_DEBUG_PAD_NAME instead. Add some more debug code.

ChangeLog
gst/mpegstream/gstdvddemux.c
gst/mpegstream/gstmpegdemux.c

index b4911035583a45e69ad4defde3f69c074782bd20..ef5cbcb42de8f9f0817c9ae0c4f332c148bda610 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2006-03-28  Tim-Philipp Müller  <tim at centricular dot net>
+
+       * gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_event),
+       (gst_dvd_demux_handle_dvd_event), (gst_dvd_demux_get_audio_stream),
+       (gst_dvd_demux_get_subpicture_stream):
+       * gst/mpegstream/gstmpegdemux.c:
+       (gst_mpeg_demux_sync_stream_to_time):
+         Don't leak element and pad names in error messages, use
+         GST_DEBUG_PAD_NAME instead. Add some more debug code.
+
 2006-03-28  Tim-Philipp Müller  <tim at centricular dot net>
 
        * ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_init),
index faf1fe99fa8de9cc680b4706d90e4ca489c0b579..d3d803a85313c7f6c197ae3492b8ce4ce3271f17 100644 (file)
@@ -329,8 +329,8 @@ gst_dvd_demux_process_event (GstMPEGParse * mpeg_parse, GstEvent * event)
       break;
     case GST_EVENT_CUSTOM_DOWNSTREAM:
     case GST_EVENT_CUSTOM_DOWNSTREAM_OOB:
-      if (gst_structure_has_name (gst_event_get_structure (event),
-              "application/x-gst-dvd")) {
+      if (event->structure != NULL &&
+          gst_structure_has_name (event->structure, "application/x-gst-dvd")) {
         ret = gst_dvd_demux_handle_dvd_event (dvd_demux, event);
       } else {
         ret = GST_MPEG_PARSE_CLASS (parent_class)->process_event (mpeg_parse,
@@ -356,14 +356,7 @@ gst_dvd_demux_handle_dvd_event (GstDVDDemux * dvd_demux, GstEvent * event)
 
   g_return_val_if_fail (event != NULL, FALSE);
 
-#ifndef GST_DISABLE_GST_DEBUG
-  {
-    gchar *text = gst_structure_to_string (structure);
-
-    GST_LOG_OBJECT (dvd_demux, "processing event \"%s\"", text);
-    g_free (text);
-  }
-#endif
+  GST_LOG_OBJECT (dvd_demux, "dvd event %" GST_PTR_FORMAT, structure);
 
   if (strcmp (event_type, "dvd-audio-stream-change") == 0) {
     gint stream_nr;
@@ -631,8 +624,8 @@ gst_dvd_demux_get_audio_stream (GstMPEGDemux * mpeg_demux,
 
     if (!gst_pad_set_caps (str->pad, str->caps)) {
       GST_ELEMENT_ERROR (GST_ELEMENT (mpeg_demux),
-          CORE, NEGOTIATION, (NULL), ("failed to set caps on pad %s:%s",
-              gst_element_get_name (dvd_demux), gst_pad_get_name (str->pad)));
+          CORE, NEGOTIATION, (NULL),
+          ("failed to set caps on pad %s:%s", GST_DEBUG_PAD_NAME (str->pad)));
       gst_caps_unref (str->caps);
       str->caps = NULL;
       return str;
@@ -643,8 +636,7 @@ gst_dvd_demux_get_audio_stream (GstMPEGDemux * mpeg_demux,
       if (!gst_pad_set_caps (dvd_demux->cur_audio, str->caps)) {
         GST_ELEMENT_ERROR (GST_ELEMENT (mpeg_demux),
             CORE, NEGOTIATION, (NULL), ("failed to set caps on pad %s:%s",
-                gst_element_get_name (dvd_demux),
-                gst_pad_get_name (dvd_demux->cur_audio)));
+                GST_DEBUG_PAD_NAME (dvd_demux->cur_audio)));
       }
     }
 
@@ -659,6 +651,9 @@ gst_dvd_demux_get_audio_stream (GstMPEGDemux * mpeg_demux,
         g_free (t);
       }
 
+      GST_DEBUG_OBJECT (mpeg_demux, "adding pad %s with language = %s",
+          GST_PAD_NAME (str->pad), (lang_code) ? lang_code : "(unknown)");
+
       gst_element_add_pad (GST_ELEMENT (mpeg_demux), str->pad);
 
       if (codec || lang_code) {
@@ -723,8 +718,8 @@ gst_dvd_demux_get_subpicture_stream (GstMPEGDemux * mpeg_demux,
 
     if (!gst_pad_set_caps (str->pad, str->caps)) {
       GST_ELEMENT_ERROR (GST_ELEMENT (mpeg_demux),
-          CORE, NEGOTIATION, (NULL), ("failed to set caps on pad %s:%s",
-              gst_element_get_name (dvd_demux), gst_pad_get_name (str->pad)));
+          CORE, NEGOTIATION, (NULL),
+          ("failed to set caps on pad %s:%s", GST_DEBUG_PAD_NAME (str->pad)));
       gst_caps_unref (str->caps);
       str->caps = NULL;
       return str;
@@ -734,8 +729,8 @@ gst_dvd_demux_get_subpicture_stream (GstMPEGDemux * mpeg_demux,
       /* This is the current subpicture stream.  Use the same caps. */
       if (!gst_pad_set_caps (dvd_demux->cur_subpicture, str->caps)) {
         GST_ELEMENT_ERROR (GST_ELEMENT (mpeg_demux),
-            CORE, NEGOTIATION, (NULL), ("failed to set caps on pad %s:%s",
-                gst_element_get_name (dvd_demux), gst_pad_get_name (str->pad)));
+            CORE, NEGOTIATION, (NULL),
+            ("failed to set caps on pad %s:%s", GST_DEBUG_PAD_NAME (str->pad)));
       }
     }
 
index d10ff55223de46f6be159e367852424718c7f95c..0fe20d261deeb15f0f52ed3118fa4e470fd50b05 100644 (file)
@@ -1027,7 +1027,7 @@ gst_mpeg_demux_sync_stream_to_time (GstMPEGDemux * mpeg_demux,
 
   if (filler) {
     GST_LOG ("Advancing %s from %llu by %lld to %llu (diff %lld)",
-        gst_pad_get_name (stream->pad), stream->cur_ts,
+        GST_PAD_NAME (stream->pad), stream->cur_ts,
         gst_event_filler_get_duration (filler), last_ts,
         GST_CLOCK_DIFF (last_ts, stream->cur_ts));