summaryrefslogtreecommitdiffstats
path: root/libhb/encavcodecaudio.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2013-06-30 20:44:21 +0000
committerjstebbins <[email protected]>2013-06-30 20:44:21 +0000
commitba3674603258b9bd9662af2b8f2225f9e9395ca1 (patch)
tree69cf3e5d77d21f07a57554ae5d1dd2bfa78e7f8b /libhb/encavcodecaudio.c
parentd6fcba15d04322d3b6495cae70b813be5c3243b4 (diff)
libhb: add experimental avformat muxer for mkv and mp4
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5620 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/encavcodecaudio.c')
-rw-r--r--libhb/encavcodecaudio.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/libhb/encavcodecaudio.c b/libhb/encavcodecaudio.c
index e24eaca32..44c3be75d 100644
--- a/libhb/encavcodecaudio.c
+++ b/libhb/encavcodecaudio.c
@@ -243,6 +243,9 @@ static int encavcodecaInit(hb_work_object_t *w, hb_job_t *job)
w->config->extradata.length = context->extradata_size;
}
+ audio->config.out.delay = av_rescale_q(context->delay, context->time_base,
+ (AVRational){1, 90000});
+
return 0;
}
@@ -388,21 +391,14 @@ static hb_buffer_t* Encode(hb_work_object_t *w)
if (got_packet && pkt.size)
{
out->size = pkt.size;
-
// The output pts from libav is in context->time_base. Convert it back
// to our timebase.
- //
- // Also account for the "delay" factor that libav seems to arbitrarily
- // subtract from the packet. Not sure WTH they think they are doing by
- // offsetting the value in a negative direction.
- out->s.start = av_rescale_q(pv->context->delay + pkt.pts,
- pv->context->time_base,
- (AVRational){1, 90000});
-
- out->s.stop = out->s.start + (90000 * pv->samples_per_frame /
- audio->config.out.samplerate);
-
- out->s.type = AUDIO_BUF;
+ out->s.start = av_rescale_q(pkt.pts, pv->context->time_base,
+ (AVRational){1, 90000});
+ out->s.duration = (double)90000 * pv->samples_per_frame /
+ audio->config.out.samplerate;
+ out->s.stop = out->s.start + out->s.duration;
+ out->s.type = AUDIO_BUF;
out->s.frametype = HB_FRAME_AUDIO;
}
else