mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 15:08:53 +00:00
tsdemux: do not error if buffer size is invalid due to DISCONT
Don't signal a pipeline error when processing incomplete j2pk PES packets that are too small. That can happen normally during a DISCONT and shouldn't shut down the whole pipeline
This commit is contained in:
parent
fef8c8f7b5
commit
a427b36f79
1 changed files with 15 additions and 2 deletions
|
@ -2848,10 +2848,23 @@ parse_jp2k_access_unit (TSDemuxStream * stream)
|
||||||
|
|
||||||
/* Check if we have enough data to create a valid buffer */
|
/* Check if we have enough data to create a valid buffer */
|
||||||
if ((stream->current_size - data_location) < (AUF[0] + AUF[1])) {
|
if ((stream->current_size - data_location) < (AUF[0] + AUF[1])) {
|
||||||
GST_ERROR ("Required size (%d) greater than remaining size in buffer (%d)",
|
GST_ERROR_OBJECT
|
||||||
|
(stream->pad,
|
||||||
|
"Required size (%d) greater than remaining size in buffer (%d)",
|
||||||
AUF[0] + AUF[1], (stream->current_size - data_location));
|
AUF[0] + AUF[1], (stream->current_size - data_location));
|
||||||
|
if (stream->expected_size && stream->current_size != stream->expected_size) {
|
||||||
|
/* warn if buffer is truncated due to draining */
|
||||||
|
GST_WARNING_OBJECT
|
||||||
|
(stream->pad,
|
||||||
|
"Truncated buffer: current size (%d) doesn't match expected size (%d)",
|
||||||
|
stream->current_size, stream->expected_size);
|
||||||
|
} else {
|
||||||
|
/* kill pipeline if either we don't know what expected size is, or
|
||||||
|
* we know the expected size, and thus are sure that the buffer is not
|
||||||
|
* truncated due to draining */
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
retbuf = gst_buffer_new_wrapped_full (0, stream->data, stream->current_size,
|
retbuf = gst_buffer_new_wrapped_full (0, stream->data, stream->current_size,
|
||||||
data_location, stream->current_size - data_location,
|
data_location, stream->current_size - data_location,
|
||||||
|
|
Loading…
Reference in a new issue