]> granicus.if.org Git - handbrake/commitdiff
Fix hb_mixdown_get_discrete_channel_count for HB_AMIXDOWN_NONE (passthrough).
authorRodeo <tdskywalker@gmail.com>
Wed, 27 Jun 2012 13:30:26 +0000 (13:30 +0000)
committerRodeo <tdskywalker@gmail.com>
Wed, 27 Jun 2012 13:30:26 +0000 (13:30 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4783 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/common.c
libhb/common.h

index 6ec4ee308744bd6168f701a9bca9277a0463b0c8..7bc3e4088f54c5004df3e5d1818d08e171a80fce 100644 (file)
@@ -99,9 +99,9 @@ int hb_get_video_encoders_count() { return hb_video_encoders_count; }
 hb_encoder_t* hb_get_audio_encoders() { return hb_audio_encoders; }
 int hb_get_audio_encoders_count() { return hb_audio_encoders_count; }
 
-int hb_mixdown_get_discrete_channel_count( int amixdown )
+int hb_mixdown_get_discrete_channel_count(int amixdown)
 {
-    switch( amixdown )
+    switch (amixdown)
     {
         case HB_AMIXDOWN_6CH:
             return 6;
@@ -109,17 +109,20 @@ int hb_mixdown_get_discrete_channel_count( int amixdown )
         case HB_AMIXDOWN_MONO:
             return 1;
 
+        case HB_AMIXDOWN_NONE:
+            return 0;
+
         default:
             return 2;
     }
 }
 
-int hb_mixdown_get_mixdown_from_short_name( const char * short_name )
+int hb_mixdown_get_mixdown_from_short_name(const char *short_name)
 {
     int i;
     for (i = 0; i < hb_audio_mixdowns_count; i++)
     {
-        if (strcmp(hb_audio_mixdowns[i].short_name, short_name) == 0)
+        if (!strcmp(hb_audio_mixdowns[i].short_name, short_name))
         {
             return hb_audio_mixdowns[i].amixdown;
         }
@@ -127,7 +130,7 @@ int hb_mixdown_get_mixdown_from_short_name( const char * short_name )
     return 0;
 }
 
-const char * hb_mixdown_get_short_name_from_mixdown( int amixdown )
+const char* hb_mixdown_get_short_name_from_mixdown(int amixdown)
 {
     int i;
     for (i = 0; i < hb_audio_mixdowns_count; i++)
index c55f49ad727f13096dba0f4f04891c6007af38f3..16c7acff87a10ce4dc302f1ea87b167b9d5e64e7 100644 (file)
@@ -197,9 +197,9 @@ int           hb_get_video_encoders_count();
 hb_encoder_t* hb_get_audio_encoders();
 int           hb_get_audio_encoders_count();
 
-int hb_mixdown_get_discrete_channel_count( int amixdown );
-int hb_mixdown_get_mixdown_from_short_name( const char * short_name );
-const char * hb_mixdown_get_short_name_from_mixdown( int amixdown );
+int hb_mixdown_get_discrete_channel_count(int amixdown);
+int hb_mixdown_get_mixdown_from_short_name(const char *short_name);
+const char* hb_mixdown_get_short_name_from_mixdown(int amixdown);
 
 void hb_autopassthru_apply_settings( hb_job_t * job, hb_title_t * title );
 void hb_autopassthru_print_settings( hb_job_t * job );