diff --git a/parecord-fix-Failed-to-open-audio-file-for-FLAC-and-.patch b/parecord-fix-Failed-to-open-audio-file-for-FLAC-and-.patch new file mode 100644 index 0000000..61eb768 --- /dev/null +++ b/parecord-fix-Failed-to-open-audio-file-for-FLAC-and-.patch @@ -0,0 +1,44 @@ +From b230da0d948573f4e17f12285373235369099dd8 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Mon, 15 Mar 2021 13:01:28 +0100 +Subject: [PATCH] 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 +Signed-off-by: Martin Wilck +--- + src/utils/pacat.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/src/utils/pacat.c b/src/utils/pacat.c +index 4d2ecf717..31da073bc 100644 +--- a/src/utils/pacat.c ++++ b/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, +-- +2.26.2 + diff --git a/pulseaudio.changes b/pulseaudio.changes index e2f173c..10626f4 100644 --- a/pulseaudio.changes +++ b/pulseaudio.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Mar 15 12:31:20 UTC 2021 - Martin Wilck + +- Fix "Failed to open audio file" for FLAC and OGG (bsc#1183546) + parecord-fix-Failed-to-open-audio-file-for-FLAC-and-.patch + ------------------------------------------------------------------- Mon Mar 1 16:22:36 CET 2021 - tiwai@suse.de diff --git a/pulseaudio.spec b/pulseaudio.spec index 5b15607..ac4c022 100644 --- a/pulseaudio.spec +++ b/pulseaudio.spec @@ -52,6 +52,7 @@ Patch1: suppress-socket-error-msg.diff Patch5: qpaeq-shebang.patch # PATCH-FIX-OPENSUSE Workaround for old systemd on Leap 15.x Patch6: pulseaudio-old-systemd-workaround.patch +Patch7: parecord-fix-Failed-to-open-audio-file-for-FLAC-and-.patch # HFP support patches (bsc#1167940) Patch101: 0001-bluetooth-use-consistent-profile-names.patch Patch102: 0002-bluetooth-separate-HSP-and-HFP.patch @@ -361,6 +362,7 @@ Optional dependency offering zsh completion for various PulseAudio utilities %if 0%{?suse_version} < 1550 %patch6 -p1 %endif +%patch7 -p1 %patch101 -p1 %patch102 -p1 %patch103 -p1