Index: pulseaudio-0.9.23/src/pulsecore/sndfile-util.c =================================================================== --- pulseaudio-0.9.23.orig/src/pulsecore/sndfile-util.c 2011-06-28 19:57:13.000000000 -0600 +++ pulseaudio-0.9.23/src/pulsecore/sndfile-util.c 2011-06-28 19:57:43.000000000 -0600 @@ -439,7 +439,7 @@ pa_assert_se(sf_command(NULL, SFC_GET_FORMAT_MAJOR, &fi, sizeof(fi)) == 0); - if (strncasecmp(name, fi.extension, strlen(name)) == 0) + if (strncasecmp(name, fi.name, strlen(name)) == 0) return fi.format; } Index: pulseaudio-0.9.23/src/utils/pacat.c =================================================================== --- pulseaudio-0.9.23.orig/src/utils/pacat.c 2011-06-28 19:57:28.000000000 -0600 +++ pulseaudio-0.9.23/src/utils/pacat.c 2011-06-28 19:57:43.000000000 -0600 @@ -915,8 +915,6 @@ break; case ARG_FILE_FORMAT: - raw = FALSE; - if (optarg) { if ((file_format = pa_sndfile_format_from_string(optarg)) < 0) { pa_log(_("Unknown file format %s."), optarg); @@ -975,13 +973,19 @@ goto quit; } - /* Transparently upgrade classic .wav to wavex for multichannel audio */ if (file_format <= 0) { - if ((sample_spec.channels == 2 && (!channel_map_set || (channel_map.map[0] == PA_CHANNEL_POSITION_LEFT && - channel_map.map[1] == PA_CHANNEL_POSITION_RIGHT))) || - (sample_spec.channels == 1 && (!channel_map_set || (channel_map.map[0] == PA_CHANNEL_POSITION_MONO)))) + char *extension; + if (filename && (extension = strrchr(filename, '.'))) + file_format = pa_sndfile_format_from_string(extension+1); + if (file_format <= 0) file_format = SF_FORMAT_WAV; - else + /* Transparently upgrade classic .wav to wavex for multichannel audio */ + if (file_format == SF_FORMAT_WAV && + (sample_spec.channels > 2 || + (channel_map_set && + !(sample_spec.channels == 1 && channel_map.map[0] == PA_CHANNEL_POSITION_MONO) && + !(sample_spec.channels == 2 && channel_map.map[0] == PA_CHANNEL_POSITION_LEFT + && channel_map.map[1] == PA_CHANNEL_POSITION_RIGHT)))) file_format = SF_FORMAT_WAVEX; }