oggmux: push eos event when empty pad data

If gst_ogg_mux_queue_pads returns NULL it means we are at EOS, because we get a
NULL buffer and this function never sets bestpad.

https://bugzilla.gnome.org/show_bug.cgi?id=729315
This commit is contained in:
Luis de Bethencourt 2014-05-06 13:01:32 -04:00
parent 2d0ecd7ff8
commit 43ae5a17ce

View file

@ -2028,20 +2028,27 @@ gst_ogg_mux_collected (GstCollectPads * pads, GstOggMux * ogg_mux)
if (popped) if (popped)
return GST_FLOW_OK; return GST_FLOW_OK;
if (best == NULL || best->buffer == NULL) { if (best == NULL) {
/* This is not supposed to happen */ /* No data, assume EOS */
return GST_FLOW_ERROR; goto eos;
} }
/* This is not supposed to happen */
g_return_val_if_fail (best->buffer != NULL, GST_FLOW_ERROR);
ret = gst_ogg_mux_process_best_pad (ogg_mux, best); ret = gst_ogg_mux_process_best_pad (ogg_mux, best);
if (best->eos && all_pads_eos (pads)) { if (best->eos && all_pads_eos (pads))
GST_LOG_OBJECT (ogg_mux->srcpad, "sending EOS"); goto eos;
return ret;
eos:
{
GST_DEBUG_OBJECT (ogg_mux, "no data available, must be EOS");
gst_pad_push_event (ogg_mux->srcpad, gst_event_new_eos ()); gst_pad_push_event (ogg_mux->srcpad, gst_event_new_eos ());
return GST_FLOW_EOS; return GST_FLOW_EOS;
} }
return ret;
} }
static void static void