From: François Laignel Date: Fri, 16 Jun 2023 08:02:16 +0000 (+0200) Subject: qtmux: fix byte order for opus extension X-Git-Tag: 1.22.7~194 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9e27d36edcbdb0d415443baabb9d99b17ffa4a6f;p=platform%2Fupstream%2Fgstreamer.git qtmux: fix byte order for opus extension 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. In `build_opus_extension`, `gst_byte_writer_put*_le ()` variants were used, causing audio streams conversion to Opus in mp4 to offset samples due to the PreSkip field incorrect value (29ms early in our test cases). [1] https://opus-codec.org/docs/opus_in_isobmff.html#4.3.2 Part-of: --- diff --git a/subprojects/gst-plugins-good/gst/isomp4/atoms.c b/subprojects/gst-plugins-good/gst/isomp4/atoms.c index cb9de63..4332f86 100644 --- a/subprojects/gst-plugins-good/gst/isomp4/atoms.c +++ b/subprojects/gst-plugins-good/gst/isomp4/atoms.c @@ -5706,9 +5706,9 @@ build_opus_extension (guint32 rate, guint8 channels, guint8 mapping_family, gst_byte_writer_init (&bw); hdl &= gst_byte_writer_put_uint8 (&bw, 0x00); /* version number */ hdl &= gst_byte_writer_put_uint8 (&bw, channels); - hdl &= gst_byte_writer_put_uint16_le (&bw, pre_skip); - hdl &= gst_byte_writer_put_uint32_le (&bw, rate); - hdl &= gst_byte_writer_put_uint16_le (&bw, output_gain); + hdl &= gst_byte_writer_put_uint16_be (&bw, pre_skip); + hdl &= gst_byte_writer_put_uint32_be (&bw, rate); + hdl &= gst_byte_writer_put_uint16_be (&bw, output_gain); hdl &= gst_byte_writer_put_uint8 (&bw, mapping_family); if (mapping_family > 0) { hdl &= gst_byte_writer_put_uint8 (&bw, stream_count);