OSDN Git Service

Updates NEWS file with changes since the last release.
[handbrake-jp/handbrake-jp-git.git] / libhb / common.c
index e7bc6db..d0b0155 100644 (file)
@@ -31,7 +31,7 @@ hb_rate_t hb_audio_bitrates[] =
 { {  "32",  32 }, {  "40",  40 }, {  "48",  48 }, {  "56",  56 },
   {  "64",  64 }, {  "80",  80 }, {  "96",  96 }, { "112", 112 },
   { "128", 128 }, { "160", 160 }, { "192", 192 }, { "224", 224 },
-  { "256", 256 }, { "320", 320 } };
+  { "256", 256 }, { "320", 320 }, { "384", 384 } };
 int hb_audio_bitrates_count = sizeof( hb_audio_bitrates ) /
                               sizeof( hb_rate_t );
 int hb_audio_bitrates_default = 8; /* 128 kbps */
@@ -45,6 +45,32 @@ hb_mixdown_t hb_audio_mixdowns[] =
 int hb_audio_mixdowns_count = sizeof( hb_audio_mixdowns ) /
                               sizeof( hb_mixdown_t );
 
+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)
+        {
+            return hb_audio_mixdowns[i].amixdown;
+        }
+    }
+    return 0;
+}
+
+const char * hb_mixdown_get_short_name_from_mixdown( int amixdown )
+{
+    int i;
+    for (i = 0; i < hb_audio_mixdowns_count; i++)
+    {
+        if (hb_audio_mixdowns[i].amixdown == amixdown)
+        {
+            return hb_audio_mixdowns[i].short_name;
+        }
+    }
+    return "";
+}
+
 /**********************************************************************
  * hb_reduce
  **********************************************************************
@@ -467,7 +493,7 @@ void hb_list_close( hb_list_t ** _l )
  *********************************************************************/
 void hb_log( char * log, ... )
 {
-    char        string[82]; /* 80 chars + \n + \0 */
+    char        string[182]; /* 180 chars + \n + \0 */
     time_t      _now;
     struct tm * now;
     va_list     args;
@@ -486,7 +512,7 @@ void hb_log( char * log, ... )
 
     /* Convert the message to a string */
     va_start( args, log );
-    vsnprintf( string + 11, 69, log, args );
+    vsnprintf( string + 11, 169, log, args );
     va_end( args );
 
     /* Add the end of line */