summaryrefslogtreecommitdiffstats
path: root/libhb/encfaac.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2010-11-06 21:14:14 +0000
committerjstebbins <[email protected]>2010-11-06 21:14:14 +0000
commit45c8e66a3d2c6a8c8e562b52eda70f93abcc6c11 (patch)
tree607dc963c47576e94747479601228290e58c4d84 /libhb/encfaac.c
parentd573f1a2e6e3a347e1bc9e6ff00d0d3f26605459 (diff)
fix audio sync when resampling 48khz to 44.1khz
Rounding errors in timestamp calculations caused a gradual slip in both sync.c and encfaac.c. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3653 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/encfaac.c')
-rw-r--r--libhb/encfaac.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libhb/encfaac.c b/libhb/encfaac.c
index c955199d0..cc7e3b912 100644
--- a/libhb/encfaac.c
+++ b/libhb/encfaac.c
@@ -18,8 +18,8 @@ struct hb_work_private_s
uint8_t * buf;
uint8_t * obuf;
hb_list_t * list;
- int64_t pts;
- int64_t framedur;
+ double pts;
+ double framedur;
int out_discrete_channels;
};
@@ -97,8 +97,9 @@ int encfaacInit( hb_work_object_t * w, hb_job_t * job )
&pv->input_samples, &pv->output_bytes );
pv->buf = malloc( pv->input_samples * sizeof( float ) );
pv->obuf = malloc( pv->output_bytes );
- pv->framedur = 90000LL * pv->input_samples /
+ pv->framedur = 90000.0 * pv->input_samples /
( audio->config.out.samplerate * pv->out_discrete_channels );
+printf("in %ld out %ld sr %d dur %g\n", pv->input_samples, pv->output_bytes, audio->config.out.samplerate, pv->framedur);
cfg = faacEncGetCurrentConfiguration( pv->faac );
cfg->mpegVersion = MPEG4;