mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 03:01:03 +00:00
oggmux: fix uninitialised variable usage and element leak
gcc on OSX complains about ret being used uninitialized in this function, and it is right. Don't leak element ref when returning early because newsegment event is not in TIME format.
This commit is contained in:
parent
a90adccacd
commit
8f1d77bc3c
1 changed files with 6 additions and 6 deletions
|
@ -318,10 +318,9 @@ gst_ogg_mux_sink_event (GstPad * pad, GstEvent * event)
|
||||||
{
|
{
|
||||||
GstOggMux *ogg_mux = GST_OGG_MUX (gst_pad_get_parent (pad));
|
GstOggMux *ogg_mux = GST_OGG_MUX (gst_pad_get_parent (pad));
|
||||||
GstOggPadData *ogg_pad = (GstOggPadData *) gst_pad_get_element_private (pad);
|
GstOggPadData *ogg_pad = (GstOggPadData *) gst_pad_get_element_private (pad);
|
||||||
gboolean ret;
|
gboolean ret = FALSE;
|
||||||
|
|
||||||
GST_DEBUG ("Got %s event on pad %s:%s", GST_EVENT_TYPE_NAME (event),
|
GST_DEBUG_OBJECT (pad, "Got %s event", GST_EVENT_TYPE_NAME (event));
|
||||||
GST_DEBUG_PAD_NAME (pad));
|
|
||||||
|
|
||||||
switch (GST_EVENT_TYPE (event)) {
|
switch (GST_EVENT_TYPE (event)) {
|
||||||
case GST_EVENT_NEWSEGMENT:{
|
case GST_EVENT_NEWSEGMENT:{
|
||||||
|
@ -337,8 +336,10 @@ gst_ogg_mux_sink_event (GstPad * pad, GstEvent * event)
|
||||||
/* We don't support non time NEWSEGMENT events */
|
/* We don't support non time NEWSEGMENT events */
|
||||||
if (format != GST_FORMAT_TIME) {
|
if (format != GST_FORMAT_TIME) {
|
||||||
gst_event_unref (event);
|
gst_event_unref (event);
|
||||||
return FALSE;
|
event = NULL;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_segment_set_newsegment_full (&ogg_pad->segment, update, rate,
|
gst_segment_set_newsegment_full (&ogg_pad->segment, update, rate,
|
||||||
applied_rate, format, start, stop, position);
|
applied_rate, format, start, stop, position);
|
||||||
|
|
||||||
|
@ -349,12 +350,11 @@ gst_ogg_mux_sink_event (GstPad * pad, GstEvent * event)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
ret = TRUE;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* now GstCollectPads can take care of the rest, e.g. EOS */
|
/* now GstCollectPads can take care of the rest, e.g. EOS */
|
||||||
if (ret)
|
if (event != NULL)
|
||||||
ret = ogg_pad->collect_event (pad, event);
|
ret = ogg_pad->collect_event (pad, event);
|
||||||
|
|
||||||
gst_object_unref (ogg_mux);
|
gst_object_unref (ogg_mux);
|
||||||
|
|
Loading…
Reference in a new issue