gst/mpegstream/: Don't leak element and pad names in error messages, use

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.
This commit is contained in:
Tim-Philipp Müller 2006-03-28 19:44:51 +00:00
parent f8c4950863
commit bd5026cbea
3 changed files with 24 additions and 19 deletions

View file

@ -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> 2006-03-28 Tim-Philipp Müller <tim at centricular dot net>
* ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_init), * ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_init),

View file

@ -329,8 +329,8 @@ gst_dvd_demux_process_event (GstMPEGParse * mpeg_parse, GstEvent * event)
break; break;
case GST_EVENT_CUSTOM_DOWNSTREAM: case GST_EVENT_CUSTOM_DOWNSTREAM:
case GST_EVENT_CUSTOM_DOWNSTREAM_OOB: case GST_EVENT_CUSTOM_DOWNSTREAM_OOB:
if (gst_structure_has_name (gst_event_get_structure (event), if (event->structure != NULL &&
"application/x-gst-dvd")) { gst_structure_has_name (event->structure, "application/x-gst-dvd")) {
ret = gst_dvd_demux_handle_dvd_event (dvd_demux, event); ret = gst_dvd_demux_handle_dvd_event (dvd_demux, event);
} else { } else {
ret = GST_MPEG_PARSE_CLASS (parent_class)->process_event (mpeg_parse, 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); g_return_val_if_fail (event != NULL, FALSE);
#ifndef GST_DISABLE_GST_DEBUG GST_LOG_OBJECT (dvd_demux, "dvd event %" GST_PTR_FORMAT, structure);
{
gchar *text = gst_structure_to_string (structure);
GST_LOG_OBJECT (dvd_demux, "processing event \"%s\"", text);
g_free (text);
}
#endif
if (strcmp (event_type, "dvd-audio-stream-change") == 0) { if (strcmp (event_type, "dvd-audio-stream-change") == 0) {
gint stream_nr; 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)) { if (!gst_pad_set_caps (str->pad, str->caps)) {
GST_ELEMENT_ERROR (GST_ELEMENT (mpeg_demux), GST_ELEMENT_ERROR (GST_ELEMENT (mpeg_demux),
CORE, NEGOTIATION, (NULL), ("failed to set caps on pad %s:%s", CORE, NEGOTIATION, (NULL),
gst_element_get_name (dvd_demux), gst_pad_get_name (str->pad))); ("failed to set caps on pad %s:%s", GST_DEBUG_PAD_NAME (str->pad)));
gst_caps_unref (str->caps); gst_caps_unref (str->caps);
str->caps = NULL; str->caps = NULL;
return str; 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)) { if (!gst_pad_set_caps (dvd_demux->cur_audio, str->caps)) {
GST_ELEMENT_ERROR (GST_ELEMENT (mpeg_demux), GST_ELEMENT_ERROR (GST_ELEMENT (mpeg_demux),
CORE, NEGOTIATION, (NULL), ("failed to set caps on pad %s:%s", CORE, NEGOTIATION, (NULL), ("failed to set caps on pad %s:%s",
gst_element_get_name (dvd_demux), GST_DEBUG_PAD_NAME (dvd_demux->cur_audio)));
gst_pad_get_name (dvd_demux->cur_audio)));
} }
} }
@ -659,6 +651,9 @@ gst_dvd_demux_get_audio_stream (GstMPEGDemux * mpeg_demux,
g_free (t); 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); gst_element_add_pad (GST_ELEMENT (mpeg_demux), str->pad);
if (codec || lang_code) { 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)) { if (!gst_pad_set_caps (str->pad, str->caps)) {
GST_ELEMENT_ERROR (GST_ELEMENT (mpeg_demux), GST_ELEMENT_ERROR (GST_ELEMENT (mpeg_demux),
CORE, NEGOTIATION, (NULL), ("failed to set caps on pad %s:%s", CORE, NEGOTIATION, (NULL),
gst_element_get_name (dvd_demux), gst_pad_get_name (str->pad))); ("failed to set caps on pad %s:%s", GST_DEBUG_PAD_NAME (str->pad)));
gst_caps_unref (str->caps); gst_caps_unref (str->caps);
str->caps = NULL; str->caps = NULL;
return str; 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. */ /* This is the current subpicture stream. Use the same caps. */
if (!gst_pad_set_caps (dvd_demux->cur_subpicture, str->caps)) { if (!gst_pad_set_caps (dvd_demux->cur_subpicture, str->caps)) {
GST_ELEMENT_ERROR (GST_ELEMENT (mpeg_demux), GST_ELEMENT_ERROR (GST_ELEMENT (mpeg_demux),
CORE, NEGOTIATION, (NULL), ("failed to set caps on pad %s:%s", CORE, NEGOTIATION, (NULL),
gst_element_get_name (dvd_demux), gst_pad_get_name (str->pad))); ("failed to set caps on pad %s:%s", GST_DEBUG_PAD_NAME (str->pad)));
} }
} }

View file

@ -1027,7 +1027,7 @@ gst_mpeg_demux_sync_stream_to_time (GstMPEGDemux * mpeg_demux,
if (filler) { if (filler) {
GST_LOG ("Advancing %s from %llu by %lld to %llu (diff %lld)", 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_event_filler_get_duration (filler), last_ts,
GST_CLOCK_DIFF (last_ts, stream->cur_ts)); GST_CLOCK_DIFF (last_ts, stream->cur_ts));