summaryrefslogtreecommitdiffstats
path: root/gtk/src/hb-backend.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2010-06-24 21:04:40 +0000
committerjstebbins <[email protected]>2010-06-24 21:04:40 +0000
commitc0fa278e9bb3ba2cc9ae61d604babc15e63fe655 (patch)
tree68747ac6cf62e749f77f173764c10ca9be416abc /gtk/src/hb-backend.c
parent7589ed32b71d9058f8a6e81eb17dbdbc77033f64 (diff)
LinGui: fix audio preset initialization
sometimes audio settings were to being initialized correctly to the values in the preset. some code that sets reasonable values when the encoder changes from passthru to non-passthru was getting invoked and overwriting the preset values. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3403 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/hb-backend.c')
-rw-r--r--gtk/src/hb-backend.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c
index 63ce0c063..71b6850e7 100644
--- a/gtk/src/hb-backend.c
+++ b/gtk/src/hb-backend.c
@@ -1121,6 +1121,24 @@ ghb_find_closest_audio_bitrate(gint codec, gint rate)
return result;
}
+gint
+ghb_find_closest_audio_rate(gint rate)
+{
+ gint ii;
+ gint result;
+
+ result = 0;
+ for (ii = 0; ii < hb_audio_rates_count; ii++)
+ {
+ if (rate <= hb_audio_rates[ii].rate)
+ {
+ result = hb_audio_rates[ii].rate;
+ break;
+ }
+ }
+ return result;
+}
+
static gint
lookup_audio_bitrate_int(const GValue *rate)
{