PulseAudio Marge Bot pushed to branch master at PulseAudio / pulseaudio


Commits:
432a91ed by Martin Wilck at 2021-04-19T13:35:48+00:00
parecord: fix "Failed to open audio file" for FLAC and OGG

This patch fixes the following error:

$ pacat --file-format=ogg -r test.ogg
Failed to open audio file.
$ parecord sep.flac
Failed to open audio file.

libsndfile errors out if a WAV or OGG file is set to have anything but
SF_ENDIAN_FILE:

https://github.com/libsndfile/libsndfile/commit/f4d1646e5cd96444a75c6327a9d49739f81d251e

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

- - - - -


1 changed file:

- src/utils/pacat.c


Changes:

=====================================
src/utils/pacat.c
=====================================
@@ -1062,6 +1062,15 @@ int main(int argc, char *argv[]) {
             }
 
             sfi.format |= file_format;
+
+           /*
+            * Endianness has been set in pa_sndfile_write_sample_spec(), but
+            * libsndfile errors out if endianness is set to anything other than
+            * SF_ENDIAN_FILE for OGG or FLAC. Clear it.
+            */
+           if (file_format == SF_FORMAT_OGG || file_format == SF_FORMAT_FLAC)
+                   sfi.format = (sfi.format & ~SF_FORMAT_ENDMASK) | 
SF_ENDIAN_FILE;
+
         }
 
         if (!(sndfile = sf_open_fd(mode == RECORD ? STDOUT_FILENO : 
STDIN_FILENO,



View it on GitLab: 
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/432a91ed439e3d5d6771e8c097df5ff8943b1ad2

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


_______________________________________________
pulseaudio-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-commits

Reply via email to