mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-06 07:28:53 +00:00
ext/ogg/gstoggmux.c: Quick hack to fix build. We need to handle
Original commit message from CVS: 2005-10-11 Julien MOUTTE <julien@moutte.net> * ext/ogg/gstoggmux.c: (gst_ogg_mux_queue_pads), (gst_ogg_mux_collected): Quick hack to fix build. We need to handle EOS correctly, that needs more work.
This commit is contained in:
parent
f13f1c0b3b
commit
a03a6eebb1
2 changed files with 34 additions and 18 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2005-10-11 Julien MOUTTE <julien@moutte.net>
|
||||||
|
|
||||||
|
* ext/ogg/gstoggmux.c: (gst_ogg_mux_queue_pads),
|
||||||
|
(gst_ogg_mux_collected): Quick hack to fix build. We need to handle
|
||||||
|
EOS correctly, that needs more work.
|
||||||
|
|
||||||
2005-10-11 Wim Taymans <wim@fluendo.com>
|
2005-10-11 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
* check/generic/states.c: (GST_START_TEST):
|
* check/generic/states.c: (GST_START_TEST):
|
||||||
|
|
|
@ -567,9 +567,6 @@ gst_ogg_mux_queue_pads (GstOggMux * ogg_mux)
|
||||||
|
|
||||||
walk = g_slist_next (walk);
|
walk = g_slist_next (walk);
|
||||||
|
|
||||||
if (data->eos)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
/* try to get a new buffer for this pad if needed and possible */
|
/* try to get a new buffer for this pad if needed and possible */
|
||||||
if (pad->buffer == NULL) {
|
if (pad->buffer == NULL) {
|
||||||
GstBuffer *buf;
|
GstBuffer *buf;
|
||||||
|
@ -577,6 +574,8 @@ gst_ogg_mux_queue_pads (GstOggMux * ogg_mux)
|
||||||
|
|
||||||
buf = gst_collectpads_pop (ogg_mux->collect, data);
|
buf = gst_collectpads_pop (ogg_mux->collect, data);
|
||||||
|
|
||||||
|
/* On EOS we get a NULL buffer */
|
||||||
|
if (buf != NULL) {
|
||||||
incaps = GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_IN_CAPS);
|
incaps = GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_IN_CAPS);
|
||||||
/* if we need headers */
|
/* if we need headers */
|
||||||
if (pad->state == GST_OGG_PAD_STATE_CONTROL) {
|
if (pad->state == GST_OGG_PAD_STATE_CONTROL) {
|
||||||
|
@ -586,13 +585,19 @@ gst_ogg_mux_queue_pads (GstOggMux * ogg_mux)
|
||||||
/* just ignore */
|
/* just ignore */
|
||||||
gst_buffer_unref (buf);
|
gst_buffer_unref (buf);
|
||||||
buf = NULL;
|
buf = NULL;
|
||||||
|
/* We discarded the data of this pad, so it's not EOS. If no bestpad
|
||||||
|
selected so far then use this one */
|
||||||
|
if (!bestpad) {
|
||||||
|
bestpad = pad;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
GST_DEBUG
|
GST_DEBUG ("muxer: got data buffer in control state, switching "
|
||||||
("muxer: got data buffer in control state, switching to data mode");
|
"to data mode");
|
||||||
/* this is a data buffer so switch to data state */
|
/* this is a data buffer so switch to data state */
|
||||||
pad->state = GST_OGG_PAD_STATE_DATA;
|
pad->state = GST_OGG_PAD_STATE_DATA;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
pad->buffer = buf;
|
pad->buffer = buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -897,11 +902,16 @@ gst_ogg_mux_collected (GstCollectPads * pads, GstOggMux * ogg_mux)
|
||||||
GST_DEBUG ("collected");
|
GST_DEBUG ("collected");
|
||||||
|
|
||||||
best = gst_ogg_mux_queue_pads (ogg_mux);
|
best = gst_ogg_mux_queue_pads (ogg_mux);
|
||||||
if (best == NULL)
|
if (best && !best->buffer)
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
|
|
||||||
GST_DEBUG ("best pad %p", best);
|
GST_DEBUG ("best pad %p", best);
|
||||||
|
|
||||||
|
if (!best) { /* EOS : FIXME !! We need to handle EOS correctly */
|
||||||
|
gst_pad_push_event (ogg_mux->srcpad, gst_event_new_eos ());
|
||||||
|
return GST_FLOW_WRONG_STATE;
|
||||||
|
}
|
||||||
|
|
||||||
/* we're pulling a pad and there is a better one, see if we need
|
/* we're pulling a pad and there is a better one, see if we need
|
||||||
* to flush the current page */
|
* to flush the current page */
|
||||||
if (ogg_mux->pulling && best &&
|
if (ogg_mux->pulling && best &&
|
||||||
|
|
Loading…
Reference in a new issue