From be8e3196a3e236c4f668d761138e3119dc68f0ce Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Tue, 20 Jan 2015 10:18:56 +0100 Subject: [PATCH] flvdemux: Don't repeatedly warn after no_more_pads (v2) This can get rather spammy for such a high log level. Only warn once per stream. https://bugzilla.gnome.org/show_bug.cgi?id=746274 --- gst/flv/gstflvdemux.c | 27 +++++++++++++++++++++------ gst/flv/gstflvdemux.h | 5 +++++ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/gst/flv/gstflvdemux.c b/gst/flv/gstflvdemux.c index 827cf4ec02..ec8f78bc81 100644 --- a/gst/flv/gstflvdemux.c +++ b/gst/flv/gstflvdemux.c @@ -927,9 +927,14 @@ gst_flv_demux_parse_tag_audio (GstFlvDemux * demux, GstBuffer * buffer) GST_LOG_OBJECT (demux, "parsing an audio tag"); - if (demux->no_more_pads && !demux->audio_pad) { - GST_WARNING_OBJECT (demux, - "Signaled no-more-pads already but had no audio pad -- ignoring"); + if G_UNLIKELY (!demux->audio_pad && demux->no_more_pads) { +#ifndef GST_DISABLE_DEBUG + if G_UNLIKELY (!demux->no_audio_warned) { + GST_WARNING_OBJECT (demux, + "Signaled no-more-pads already but had no audio pad -- ignoring"); + demux->no_audio_warned = TRUE; + } +#endif return GST_FLOW_OK; } @@ -1327,9 +1332,14 @@ gst_flv_demux_parse_tag_video (GstFlvDemux * demux, GstBuffer * buffer) GST_LOG_OBJECT (demux, "parsing a video tag"); - if (demux->no_more_pads && !demux->video_pad) { - GST_WARNING_OBJECT (demux, - "Signaled no-more-pads already but had no video pad -- ignoring"); + if G_UNLIKELY (!demux->video_pad && demux->no_more_pads) { +#ifndef GST_DISABLE_DEBUG + if G_UNLIKELY (!demux->no_video_warned) { + GST_WARNING_OBJECT (demux, + "Signaled no-more-pads already but had no video pad -- ignoring"); + demux->no_video_warned = TRUE; + } +#endif return GST_FLOW_OK; } @@ -1830,6 +1840,11 @@ gst_flv_demux_cleanup (GstFlvDemux * demux) demux->no_more_pads = FALSE; +#ifndef GST_DISABLE_DEBUG + demux->no_audio_warned = FALSE; + demux->no_video_warned = FALSE; +#endif + gst_segment_init (&demux->segment, GST_FORMAT_TIME); demux->w = demux->h = 0; diff --git a/gst/flv/gstflvdemux.h b/gst/flv/gstflvdemux.h index 5fb6c1110b..aa8d6ac9fc 100644 --- a/gst/flv/gstflvdemux.h +++ b/gst/flv/gstflvdemux.h @@ -132,6 +132,11 @@ struct _GstFlvDemux gboolean no_more_pads; +#ifndef GST_DISABLE_DEBUG + gboolean no_audio_warned; + gboolean no_video_warned; +#endif + gboolean seeking; gboolean building_index; gboolean indexed; /* TRUE if index is completely built */