qtdemux: fix byte order for opus extension and version field type
authorFrançois Laignel <francois@centricular.com>
Fri, 16 Jun 2023 08:29:28 +0000 (10:29 +0200)
committerTim-Philipp Müller <tim@centricular.com>
Mon, 19 Jun 2023 15:09:48 +0000 (16:09 +0100)
The "Encapsulation of Opus in ISO Base Media File Format" [1] specifications,
§ 4.3.2 Opus Specific Box, indicates that data must be stored as big-endian.

[1] https://opus-codec.org/docs/opus_in_isobmff.html#4.3.2

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4891>

subprojects/gst-plugins-good/gst/isomp4/qtdemux.c

index 6224857..c7e43eb 100644 (file)
@@ -12899,7 +12899,7 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
             dops_data = stsd_entry_data + 35;
 
           channels = GST_READ_UINT8 (dops_data + 10);
-          rate = GST_READ_UINT32_LE (dops_data + 13);
+          rate = GST_READ_UINT32_BE (dops_data + 13);
           channel_mapping_family = GST_READ_UINT8 (dops_data + 19);
           stream_count = GST_READ_UINT8 (dops_data + 20);
           coupled_count = GST_READ_UINT8 (dops_data + 21);