[pulseaudio-commits] [Git][pulseaudio/pulseaudio][master] sndfile: handle sndfiles with s24 format

PulseAudio Marge Bot (@pulseaudio-merge-bot) gitlab at gitlab.freedesktop.org
Thu Nov 10 16:42:26 UTC 2022



PulseAudio Marge Bot pushed to branch master at PulseAudio / pulseaudio


Commits:
3349e1c4 by Wim Taymans at 2022-11-10T17:13:58+01:00
sndfile: handle sndfiles with s24 format

Samples with s24 format should be read with the readf_int read
function instead of the raw function.

This fixes playback of flac/wav with s24 sample format.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/750>

- - - - -


1 changed file:

- src/pulsecore/sndfile-util.c


Changes:

=====================================
src/pulsecore/sndfile-util.c
=====================================
@@ -51,11 +51,11 @@ int pa_sndfile_read_sample_spec(SNDFILE *sf, pa_sample_spec *ss) {
             ss->format = PA_SAMPLE_S16NE;
             break;
 
-        case SF_FORMAT_PCM_24:
-            ss->format = PA_SAMPLE_S24NE;
-            break;
-
         case SF_FORMAT_PCM_32:
+        case SF_FORMAT_PCM_24:
+            /* note that libsndfile will convert 24 bits samples to 32 bits
+             * when using the sf_readf_int function, which will be selected
+             * by setting the format to s32. */
             ss->format = PA_SAMPLE_S32NE;
             break;
 



View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/3349e1c471f16f46251a51acfc1740cdf012a098

-- 
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/3349e1c471f16f46251a51acfc1740cdf012a098
You're receiving this email because of your account on gitlab.freedesktop.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20221110/661a5dec/attachment.htm>


More information about the pulseaudio-commits mailing list