summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2014-08-26 16:00:57 +0000
committerjstebbins <[email protected]>2014-08-26 16:00:57 +0000
commitc32350780e40355c7d27be1b1b7511aa7a12ab8f (patch)
treea5539e46074ecd408157c302ecc24c4102adc79a
parent883c3833182879f12318519d8bce73c479e73f50 (diff)
libhb: fix accumulating rounding error in CoreAudio timestamps
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6363 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--libhb/platform/macosx/encca_aac.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libhb/platform/macosx/encca_aac.c b/libhb/platform/macosx/encca_aac.c
index 3e51f2609..dbb747f24 100644
--- a/libhb/platform/macosx/encca_aac.c
+++ b/libhb/platform/macosx/encca_aac.c
@@ -46,7 +46,7 @@ struct hb_work_private_s
AudioConverterRef converter;
unsigned long isamples, isamplesiz, omaxpacket, nchannels;
- uint64_t pts, ibytes;
+ uint64_t samples, ibytes;
Float64 osamplerate;
hb_audio_remap_t *remap;
@@ -441,9 +441,10 @@ static hb_buffer_t* Encode(hb_work_object_t *w)
}
obuf->size = odesc.mDataByteSize;
- obuf->s.start = pv->pts;
- pv->pts += 90000LL * pv->isamples / pv->osamplerate;
- obuf->s.stop = pv->pts;
+ obuf->s.start = 90000LL * pv->samples / pv->osamplerate;
+ pv->samples += pv->isamples;
+ obuf->s.stop = 90000LL * pv->samples / pv->osamplerate;
+ obuf->s.duration = (double)90000 * pv->isamples / pv->osamplerate;
obuf->s.type = AUDIO_BUF;
obuf->s.frametype = HB_FRAME_AUDIO;