mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04: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:
f4d1646e5c
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/526>
This commit is contained in:
parent
fec9eb178d
commit
432a91ed43
1 changed files with 9 additions and 0 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue