mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 20:59:44 +00:00
flactag: fix adapter assertion when used directly after flacenc
Unlike filesrc, flacenc outputs the flac blocks neatly aligned one in each buffer. This means that when we switch from metadata mode to audio data passthrough mode, there's no data left in the adapter to push out at this point, so check if there's data in the adapter before requesting buffers from it (also needed in case we get input buffers of 0 size). Fixes #615793.
This commit is contained in:
parent
1349d5d765
commit
1351af141d
1 changed files with 8 additions and 5 deletions
|
@ -430,11 +430,14 @@ gst_flac_tag_chain (GstPad * pad, GstBuffer * buffer)
|
|||
/* The metadata blocks have been read, now we are reading audio data */
|
||||
if (tag->state == GST_FLAC_TAG_STATE_AUDIO_DATA) {
|
||||
GstBuffer *buffer;
|
||||
buffer =
|
||||
gst_adapter_take_buffer (tag->adapter,
|
||||
gst_adapter_available (tag->adapter));
|
||||
gst_buffer_set_caps (buffer, GST_PAD_CAPS (tag->srcpad));
|
||||
ret = gst_pad_push (tag->srcpad, buffer);
|
||||
guint avail;
|
||||
|
||||
avail = gst_adapter_available (tag->adapter);
|
||||
if (avail > 0) {
|
||||
buffer = gst_adapter_take_buffer (tag->adapter, avail);
|
||||
gst_buffer_set_caps (buffer, GST_PAD_CAPS (tag->srcpad));
|
||||
ret = gst_pad_push (tag->srcpad, buffer);
|
||||
}
|
||||
}
|
||||
|
||||
cleanup:
|
||||
|
|
Loading…
Reference in a new issue