mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
adder: rework the logic to check if eos has to be sent.
Checking the size available was incorrect, and the infos for per-pad EOS are available. Same logic as audiomixer. fixes: https://bugzilla.gnome.org/show_bug.cgi?id=727025
This commit is contained in:
parent
6ce7ade7c6
commit
6954d2167c
1 changed files with 10 additions and 3 deletions
|
@ -1176,6 +1176,7 @@ gst_adder_collected (GstCollectPads * pads, gpointer user_data)
|
||||||
gint64 next_timestamp;
|
gint64 next_timestamp;
|
||||||
gint rate, bps, bpf;
|
gint rate, bps, bpf;
|
||||||
gboolean had_mute = FALSE;
|
gboolean had_mute = FALSE;
|
||||||
|
gboolean is_eos = TRUE;
|
||||||
|
|
||||||
adder = GST_ADDER (user_data);
|
adder = GST_ADDER (user_data);
|
||||||
|
|
||||||
|
@ -1260,9 +1261,6 @@ gst_adder_collected (GstCollectPads * pads, gpointer user_data)
|
||||||
/* get available bytes for reading, this can be 0 which could mean empty
|
/* get available bytes for reading, this can be 0 which could mean empty
|
||||||
* buffers or EOS, which we will catch when we loop over the pads. */
|
* buffers or EOS, which we will catch when we loop over the pads. */
|
||||||
outsize = gst_collect_pads_available (pads);
|
outsize = gst_collect_pads_available (pads);
|
||||||
/* can only happen when no pads to collect or all EOS */
|
|
||||||
if (outsize == 0)
|
|
||||||
goto eos;
|
|
||||||
|
|
||||||
GST_LOG_OBJECT (adder,
|
GST_LOG_OBJECT (adder,
|
||||||
"starting to cycle through channels, %d bytes available (bps = %d, bpf = %d)",
|
"starting to cycle through channels, %d bytes available (bps = %d, bpf = %d)",
|
||||||
|
@ -1284,6 +1282,11 @@ gst_adder_collected (GstCollectPads * pads, gpointer user_data)
|
||||||
/* get a buffer of size bytes, if we get a buffer, it is at least outsize
|
/* get a buffer of size bytes, if we get a buffer, it is at least outsize
|
||||||
* bytes big. */
|
* bytes big. */
|
||||||
inbuf = gst_collect_pads_take_buffer (pads, collect_data, outsize);
|
inbuf = gst_collect_pads_take_buffer (pads, collect_data, outsize);
|
||||||
|
|
||||||
|
if (!GST_COLLECT_PADS_STATE_IS_SET (collect_data,
|
||||||
|
GST_COLLECT_PADS_STATE_EOS))
|
||||||
|
is_eos = FALSE;
|
||||||
|
|
||||||
/* NULL means EOS or an empty buffer so we still need to flush in
|
/* NULL means EOS or an empty buffer so we still need to flush in
|
||||||
* case of an empty buffer. */
|
* case of an empty buffer. */
|
||||||
if (inbuf == NULL) {
|
if (inbuf == NULL) {
|
||||||
|
@ -1477,9 +1480,13 @@ gst_adder_collected (GstCollectPads * pads, gpointer user_data)
|
||||||
}
|
}
|
||||||
GST_OBJECT_UNLOCK (pad);
|
GST_OBJECT_UNLOCK (pad);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (outbuf)
|
if (outbuf)
|
||||||
gst_buffer_unmap (outbuf, &outmap);
|
gst_buffer_unmap (outbuf, &outmap);
|
||||||
|
|
||||||
|
if (is_eos)
|
||||||
|
goto eos;
|
||||||
|
|
||||||
if (outbuf == NULL) {
|
if (outbuf == NULL) {
|
||||||
/* no output buffer, reuse one of the GAP buffers then if we have one */
|
/* no output buffer, reuse one of the GAP buffers then if we have one */
|
||||||
if (gapbuf) {
|
if (gapbuf) {
|
||||||
|
|
Loading…
Reference in a new issue