]> code.delx.au - pulseaudio/commitdiff
Fix return value of pa_sndfile_format_from_string
authorVincent Becker <vincentx.becker@intel.com>
Tue, 14 Dec 2010 17:08:14 +0000 (18:08 +0100)
committerColin Guthrie <cguthrie@mandriva.org>
Sat, 18 Dec 2010 11:52:24 +0000 (11:52 +0000)
This prevented to use pacat --file-format option correctly

src/pulsecore/sndfile-util.c

index 4f7f8bdb8dd727b08292721b2728ea2df875234b..9d15a8680a7feb38bc9c588339bf87c3987a5e04 100644 (file)
@@ -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;