qtdemux: Fix reverse playback for pcm audio stream

Some raw lpcm or adpcm may have larger sample sizes than the max
buffer size value set.
Trimming the buffer causes bogus size error on reverse playback.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5745>
This commit is contained in:
Hosang Lee 2023-12-01 15:05:41 +09:00 committed by Tim-Philipp Müller
parent cedd529178
commit f4ed87283b

View file

@ -15580,7 +15580,7 @@ qtdemux_audio_caps (GstQTDemux * qtdemux, QtDemuxStream * stream,
if (g_str_has_prefix (name, "audio/x-raw")) { if (g_str_has_prefix (name, "audio/x-raw")) {
stream->need_clip = TRUE; stream->need_clip = TRUE;
stream->min_buffer_size = 1024 * entry->bytes_per_frame; stream->min_buffer_size = 1024 * entry->bytes_per_frame;
stream->max_buffer_size = 4096 * entry->bytes_per_frame; stream->max_buffer_size = entry->rate * entry->bytes_per_frame;
GST_DEBUG ("setting min/max buffer sizes to %d/%d", stream->min_buffer_size, GST_DEBUG ("setting min/max buffer sizes to %d/%d", stream->min_buffer_size,
stream->max_buffer_size); stream->max_buffer_size);
} }