tagdemux: resize and trim buffer in place to fix interaction with oggdemux
authorTim-Philipp Müller <tim@centricular.com>
Mon, 4 Jan 2021 13:40:20 +0000 (13:40 +0000)
committerTim-Philipp Müller <tim@centricular.com>
Mon, 4 Jan 2021 14:21:43 +0000 (14:21 +0000)
commit89bd37f24e2dbecfceb97c2000159828d526ad8b
tree99802ec3cd91a4741952b319c2fe252b2541a9db
parent06c158957d4ce4403cb6c784f268e853fa67a11c
tagdemux: resize and trim buffer in place to fix interaction with oggdemux

Elements operating in pull mode may optionally pass a buffer to
pull_range that should be filled with the data. The only element
that does that at the moment is oggdemux operating in pull mode.

tagdemux currently creates a sub-buffer whenever a buffer pulled
from upstream (filesrc, usually) needs to be trimmed. This creates
a new buffer, however, so disregards any passed-in buffer from a
downstream oggdemux.

This would cause assertion failures and playback problems for
ogg files that contain ID3 tags at the end.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/848

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/994>
gst-libs/gst/tag/gsttagdemux.c