summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
authordynaflash <[email protected]>2007-04-12 18:38:40 +0000
committerdynaflash <[email protected]>2007-04-12 18:38:40 +0000
commit5c07a00af3dc434e341ca706270cba271d524980 (patch)
tree2fec88cf6bfdc4c42b7b03c4b3db639d4a1f9d13 /libhb
parent9bb7db3d4b027879a27f80b8b726a84660d349a8 (diff)
MacGui: Presets now utilize Audio Mixdowns Thanks maurj!
- Added second audio track support in presets - Mixdowns regress gracefully depending on current dvd source - Source Track 2 sets to "None" if one is specified that doesn't exist in current dvd. Note: in initial testing, second track using 6 channel kills encode performance and yields a track with no sound. Needs to be tested and verified. Main track works flawlessly in initial testing. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@499 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r--libhb/common.c26
-rw-r--r--libhb/common.h2
2 files changed, 28 insertions, 0 deletions
diff --git a/libhb/common.c b/libhb/common.c
index e7bc6dbb8..d1c4cb34a 100644
--- a/libhb/common.c
+++ b/libhb/common.c
@@ -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
**********************************************************************
diff --git a/libhb/common.h b/libhb/common.h
index 3ed8f7791..20de051f4 100644
--- a/libhb/common.h
+++ b/libhb/common.h
@@ -92,6 +92,8 @@ extern int hb_audio_bitrates_count;
extern int hb_audio_bitrates_default;
extern hb_mixdown_t hb_audio_mixdowns[];
extern int hb_audio_mixdowns_count;
+int hb_mixdown_get_mixdown_from_short_name( const char * short_name );
+const char * hb_mixdown_get_short_name_from_mixdown( int amixdown );
/******************************************************************************
* hb_job_t: settings to be filled by the UI