Hi, This patch fixes an issue when using pacat with option --file-format. As the format number returned by pa_sndfile_format_from_string() was wrong, it failed to open later audio file especially with the record option (e.g. : pacat -r --file-format=flac file_to_record). With the fix, it creates the sound file header of the desired format in the uncompressed audio file. diff --git a/src/pulsecore/sndfile-util.c b/src/pulsecore/sndfile-util.c index 4f7f8bd..9d15a86 100644 --- a/src/pulsecore/sndfile-util.c +++ b/src/pulsecore/sndfile-util.c @@ -416,7 +416,7 @@ int pa_sndfile_format_from_string(const char *name) { pa_assert_se(sf_command(NULL, SFC_GET_FORMAT_MAJOR, &fi, sizeof(fi)) == 0); if (strcasecmp(name, fi.name) == 0) - return i; + return fi.format; } /* Then, try to match via the full extension */ @@ -428,7 +428,7 @@ int pa_sndfile_format_from_string(const char *name) { pa_assert_se(sf_command(NULL, SFC_GET_FORMAT_MAJOR, &fi, sizeof(fi)) == 0); if (strcasecmp(name, fi.extension) == 0) - return i; + return fi.format; } /* Then, try to match via the start of the type string */ @@ -440,7 +440,7 @@ int pa_sndfile_format_from_string(const char *name) { pa_assert_se(sf_command(NULL, SFC_GET_FORMAT_MAJOR, &fi, sizeof(fi)) == 0); if (strncasecmp(name, fi.extension, strlen(name)) == 0) - return i; + return fi.format; } return -1; -- 1.7.2.3 Thanks, Vincent Vincent BECKER Intel - Wireless System Integration Engineer --------------------------------------------------------------------- Intel Corporation SAS (French simplified joint stock company) Registered headquarters: "Les Montalets"- 2, rue de Paris, 92196 Meudon Cedex, France Registration Number: 302 456 199 R.C.S. NANTERRE Capital: 4,572,000 Euros This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Fix-return-value-of-pa_sndfile_format_from_string-wh.patch Type: application/octet-stream Size: 1594 bytes Desc: 0001-Fix-return-value-of-pa_sndfile_format_from_string-wh.patch URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20101215/5ec9922a/attachment.obj>