diff options
author | jstebbins <jstebbins.hb@gmail.com> | 2010-04-24 21:39:44 +0000 |
---|---|---|
committer | jstebbins <jstebbins.hb@gmail.com> | 2010-04-24 21:39:44 +0000 |
commit | 125bbb807ec04115061bdb4ed94c58c7510ab341 (patch) | |
tree | d8a3de45ee2864e6b17ca14beed07be6c6128833 /libhb/decavcodec.c | |
parent | 0c46572c6e372e8b41dcdc70867ff9bacb2cef08 (diff) |
fix decoding of qtrle codec and possibly others
we rely on ffmpeg calling context->get_buffer, which we override to
point to our get_frame_buf(), to stuff our pts values into frames it
is decoding. but some decoders call context->reget_buffer
instead. So I added an override for this callback as well.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3262 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/decavcodec.c')
-rw-r--r-- | libhb/decavcodec.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libhb/decavcodec.c b/libhb/decavcodec.c index 0f367da90..91949fb40 100644 --- a/libhb/decavcodec.c +++ b/libhb/decavcodec.c @@ -525,6 +525,14 @@ static int get_frame_buf( AVCodecContext *context, AVFrame *frame ) return avcodec_default_get_buffer( context, frame ); } +static int reget_frame_buf( AVCodecContext *context, AVFrame *frame ) +{ + hb_work_private_t *pv = context->opaque; + frame->pts = pv->pts; + pv->pts = -1; + return avcodec_default_reget_buffer( context, frame ); +} + static void log_chapter( hb_work_private_t *pv, int chap_num, int64_t pts ) { hb_chapter_t *c = hb_list_item( pv->job->title->list_chapter, chap_num - 1 ); @@ -754,6 +762,7 @@ static int decavcodecvInit( hb_work_object_t * w, hb_job_t * job ) /* we have to wrap ffmpeg's get_buffer to be able to set the pts (?!) */ pv->context->opaque = pv; pv->context->get_buffer = get_frame_buf; + pv->context->reget_buffer = reget_frame_buf; return 0; } @@ -1041,6 +1050,7 @@ static void init_ffmpeg_context( hb_work_object_t *w ) // we have to wrap ffmpeg's get_buffer to be able to set the pts (?!) pv->context->opaque = pv; pv->context->get_buffer = get_frame_buf; + pv->context->reget_buffer = reget_frame_buf; // avi, mkv and possibly mp4 containers can contain the M$ VFW packed // b-frames abortion that messes up frame ordering and timestamps. |