diff options
author | maurj <[email protected]> | 2007-04-11 15:23:57 +0000 |
---|---|---|
committer | maurj <[email protected]> | 2007-04-11 15:23:57 +0000 |
commit | ddc7ac09960746920ae8e48ac6f38a61c9f56d47 (patch) | |
tree | 0ad40c6da4ff1ef22f33f6b6543171f346643029 /libhb/sync.c | |
parent | 1ce785c8d342834c33ee09e63315c5997782f919 (diff) |
Added libhb and CLI support for Dolby Pro Logic II 5.0 matrix encoding. *NOT YET ADDED TO THE GUI*. Handbrake now uses a more general "audio mixdown" concept. For each audio track to be converted you specify a mixdown. These are defined in common.h.
This checkin only allows you to specify one mixdown for all tracks in the CLI, although everything is in place internally to specify a different mixdown per track. In the CLI, the "-6 --surround" option has been repurposed as a "-6 --mixdown" option, with a string parameter of mono/stereo/dpl1/dpl2/6ch.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@494 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/sync.c')
-rw-r--r-- | libhb/sync.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libhb/sync.c b/libhb/sync.c index b8f49fd01..79423b70c 100644 --- a/libhb/sync.c +++ b/libhb/sync.c @@ -196,7 +196,7 @@ static void InitAudio( hb_work_object_t * w, int i ) c->bit_rate = sync->audio->bitrate; c->sample_rate = sync->audio->rate; - c->channels = sync->audio->channels; + c->channels = 2; if( avcodec_open( c, codec ) < 0 ) { @@ -224,7 +224,7 @@ static void InitAudio( hb_work_object_t * w, int i ) { /* Initialize libsamplerate */ int error; - sync->state = src_new( SRC_LINEAR, sync->audio->channelsused, &error ); + sync->state = src_new( SRC_LINEAR, HB_AMIXDOWN_GET_DISCRETE_CHANNEL_COUNT(sync->audio->amixdown), &error ); sync->data.end_of_input = 0; } } @@ -502,7 +502,7 @@ static void SyncAudio( hb_work_object_t * w, int i ) int count_in, count_out; - count_in = buf_raw->size / audio->channelsused / sizeof( float ); + count_in = buf_raw->size / HB_AMIXDOWN_GET_DISCRETE_CHANNEL_COUNT(audio->amixdown) / sizeof( float ); count_out = ( buf_raw->stop - buf_raw->start ) * job->arate / 90000; if( buf->start < pts_expected - 1500 ) count_out--; @@ -516,7 +516,7 @@ static void SyncAudio( hb_work_object_t * w, int i ) sync->data.src_ratio = (double) sync->data.output_frames / (double) sync->data.input_frames; - buf = hb_buffer_init( sync->data.output_frames * audio->channelsused * + buf = hb_buffer_init( sync->data.output_frames * HB_AMIXDOWN_GET_DISCRETE_CHANNEL_COUNT(audio->amixdown) * sizeof( float ) ); sync->data.data_out = (float *) buf->data; if( src_process( sync->state, &sync->data ) ) @@ -526,7 +526,7 @@ static void SyncAudio( hb_work_object_t * w, int i ) } hb_buffer_close( &buf_raw ); - buf->size = sync->data.output_frames_gen * audio->channelsused * sizeof( float ); + buf->size = sync->data.output_frames_gen * HB_AMIXDOWN_GET_DISCRETE_CHANNEL_COUNT(audio->amixdown) * sizeof( float ); /* Set dates for resampled data */ buf->start = start; @@ -609,7 +609,7 @@ static void InsertSilence( hb_work_object_t * w, int i ) } else { - buf = hb_buffer_init( sync->audio->channelsused * job->arate / 20 * + buf = hb_buffer_init( HB_AMIXDOWN_GET_DISCRETE_CHANNEL_COUNT(sync->audio->amixdown) * job->arate / 20 * sizeof( float ) ); buf->start = sync->count_frames * 90000 / job->arate; buf->stop = buf->start + 90000 / 20; |