qtdemux: Fix stsc size check in qtdemux_merge_sample_table()

There are 3 32bit integers per entry and not one more for all but the last.

Fixes a regression introduced in 5a9e80c01b
when playing back files that have one sample table entry per audio sample.

Merging the sample tables would've always failed because of the too strict size
check and one audio sample per GStreamer buffer would've been output, which
doesn't perform very well.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8657>
This commit is contained in:
Sebastian Dröge 2025-03-20 11:01:25 +02:00 committed by GStreamer Marge Bot
parent 9a75d56cf8
commit f795796f89

View file

@ -10218,8 +10218,7 @@ qtdemux_merge_sample_table (GstQTDemux * qtdemux, QtDemuxStream * stream)
num_chunks);
if (gst_byte_reader_get_remaining (&stream->stsc) <
stream->n_samples_per_chunk * 3 * 4 +
(stream->n_samples_per_chunk - 1) * 4) {
stream->n_samples_per_chunk * 3 * 4) {
GST_DEBUG_OBJECT (qtdemux, "Too small stsc");
return;
}