diff --git a/gst/qtmux/atoms.c b/gst/qtmux/atoms.c index 79117cca09..66b0a1a26d 100644 --- a/gst/qtmux/atoms.c +++ b/gst/qtmux/atoms.c @@ -3359,6 +3359,8 @@ build_ima_adpcm_atom (gint channels, gint rate, gint blocksize) /* This atom's content is a WAVE header, including 2 bytes of extra data. Note that all of this is little-endian, unlike most stuff in qt. */ + /* 4 bytes header per channel (including 1 sample). Then 2 samples per byte + for the rest. Simplifies to this. */ samplesperblock = 2 * blocksize / channels - 7; bytespersec = rate * blocksize / samplesperblock; GST_WRITE_UINT16_LE (data, 0x11); diff --git a/gst/qtmux/gstqtmux.c b/gst/qtmux/gstqtmux.c index 5899d2aa18..5162a9eef2 100644 --- a/gst/qtmux/gstqtmux.c +++ b/gst/qtmux/gstqtmux.c @@ -1723,9 +1723,12 @@ gst_qt_mux_audio_sink_set_caps (GstPad * pad, GstCaps * caps) GST_DEBUG_OBJECT (qtmux, "broken caps, block_align missing"); goto refuse_caps; } - // Currently only supports WAV-style IMA ADPCM, for which the codec id is - // 0x11 + /* Currently only supports WAV-style IMA ADPCM, for which the codec id is + 0x11 */ entry.fourcc = MS_WAVE_FOURCC (0x11); + /* 4 byte header per channel (including one sample). 2 samples per byte + remaining. Simplifying gives the following (samples per block per + channel) */ entry.samples_per_packet = 2 * blocksize / channels - 7; entry.bytes_per_sample = 2;