mxfdemux: Always calculate BlockAlign of raw audio

Workaround for nBlockAlign and nBitsPerSample mismatch. Always
use the formula described in the specification for BlockAlign value

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2864>
This commit is contained in:
Seungha Yang 2022-08-08 23:37:11 +09:00 committed by GStreamer Marge Bot
parent 8e77c8155c
commit 3632e97df2

View file

@ -1270,12 +1270,13 @@ mxf_bwf_create_caps (MXFMetadataTimelineTrack * track,
GST_ERROR ("Invalid descriptor");
return NULL;
}
if (wa_descriptor && wa_descriptor->block_align != 0)
block_align = wa_descriptor->block_align;
else
block_align =
(GST_ROUND_UP_8 (descriptor->quantization_bits) *
descriptor->channel_count) / 8;
/* XXX: block align value can be carried via audio essential descriptor but
* there are some files with broken block align value.
* Calculates the value always */
block_align =
(GST_ROUND_UP_8 (descriptor->quantization_bits) *
descriptor->channel_count) / 8;
audio_format =
gst_audio_format_build_integer (block_align !=
@ -1302,12 +1303,12 @@ mxf_bwf_create_caps (MXFMetadataTimelineTrack * track,
return NULL;
}
if (wa_descriptor && wa_descriptor->block_align != 0)
block_align = wa_descriptor->block_align;
else
block_align =
(GST_ROUND_UP_8 (descriptor->quantization_bits) *
descriptor->channel_count) / 8;
/* XXX: block align value can be carried via audio essential descriptor but
* there are some files with broken block align value.
* Calculates the value always */
block_align =
(GST_ROUND_UP_8 (descriptor->quantization_bits) *
descriptor->channel_count) / 8;
audio_format =
gst_audio_format_build_integer (block_align !=