mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-25 01:54:17 +00:00
wavparse: handle truncated input data at EOS in pull mode
Fixes #617733.
This commit is contained in:
parent
1669364c20
commit
3462eed7e0
1 changed files with 12 additions and 0 deletions
|
@ -1844,6 +1844,18 @@ iterate_adapter:
|
||||||
if ((res = gst_pad_pull_range (wav->sinkpad, wav->offset,
|
if ((res = gst_pad_pull_range (wav->sinkpad, wav->offset,
|
||||||
desired, &buf)) != GST_FLOW_OK)
|
desired, &buf)) != GST_FLOW_OK)
|
||||||
goto pull_error;
|
goto pull_error;
|
||||||
|
|
||||||
|
/* we may get a short buffer at the end of the file */
|
||||||
|
if (GST_BUFFER_SIZE (buf) < desired) {
|
||||||
|
GST_LOG_OBJECT (wav, "Got only %u bytes of data", GST_BUFFER_SIZE (buf));
|
||||||
|
if (GST_BUFFER_SIZE (buf) >= wav->blockalign) {
|
||||||
|
buf = gst_buffer_make_metadata_writable (buf);
|
||||||
|
GST_BUFFER_SIZE (buf) -= (GST_BUFFER_SIZE (buf) % wav->blockalign);
|
||||||
|
} else {
|
||||||
|
gst_buffer_unref (buf);
|
||||||
|
goto found_eos;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* first chunk of data? create the source pad. We do this only here so
|
/* first chunk of data? create the source pad. We do this only here so
|
||||||
|
|
Loading…
Reference in a new issue