Wim Taymans 4417183bae riff-media: fix MS and DVI ADPCM av_bps calculations
Align the calculations for the number of samples per block with the
calculations in adpcmdec.

For MS ADPCM we have in adpcmdec:

       samples = (blocksize - 7 * dec->channels) * 2 + 2 * dec->channels;
       outsize = 2 * samples;
       outbuf = gst_buffer_new_and_alloc (outsize);

This gives us the total output byte size in 16 bits samples. To get back
to the samples, dividing by the channels and 2, we get the right samples per
block as:

       int spb = ((strf->blockalign / strf->channels) - 7) * 2 + 2;

Which we can then use to calculate the bitrate in riff-media.

A similar calculation for DVI ADPCM is needed to get the right bitrate
in all cases.

Tested with the sample in https://bugzilla.gnome.org/show_bug.cgi?id=636245
and another (failing before this patch) sample.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9082>
2025-05-29 10:09:51 +02:00
..
2025-03-13 11:37:35 +00:00
2025-03-13 11:37:35 +00:00
2025-04-30 10:18:57 +00:00
2025-05-02 05:54:56 +00:00
2025-04-08 11:45:11 +00:00
2025-05-01 23:16:25 +09:00
2025-04-30 10:18:57 +00:00