From c2841b2243f467cd1b101b69cf348020bd26b177 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martin=20Storsj=C3=B6?= Date: Wed, 4 Apr 2012 15:18:00 +0300 Subject: [PATCH] omxil: Pass pts as timestamp on the ducati decoder This decoder reorders timestamps according to the frame reordering, and thus should be given pts instead of dts. Other decoders don't do this reordering and should be given dts. Still to be investigated how android/stagefright handles this, since it always seems pass pts, not dts, to decoders. Signed-off-by: Jean-Baptiste Kempf --- modules/codec/omxil/omxil.c | 8 +++++++- modules/codec/omxil/omxil.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/codec/omxil/omxil.c b/modules/codec/omxil/omxil.c index 34509e1c10..29d92edda2 100644 --- a/modules/codec/omxil/omxil.c +++ b/modules/codec/omxil/omxil.c @@ -910,6 +910,7 @@ loaded: p_sys->out.p_fmt = &p_dec->fmt_out; p_sys->ports = 2; p_sys->p_ports = &p_sys->in; + p_sys->b_use_pts = 0; msg_Dbg(p_dec, "fmt in:%4.4s, out: %4.4s", (char *)&p_dec->fmt_in.i_codec, (char *)&p_dec->fmt_out.i_codec); @@ -1051,6 +1052,8 @@ loaded: if(p_sys->b_error) goto error; p_dec->b_need_packetized = true; + if (!strcmp(p_sys->psz_component, "OMX.TI.DUCATI1.VIDEO.DECODER")) + p_sys->b_use_pts = 1; return VLC_SUCCESS; error: @@ -1270,7 +1273,10 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block ) p_header->nFilledLen = p_block->i_buffer; p_header->nOffset = 0; p_header->nFlags = OMX_BUFFERFLAG_ENDOFFRAME; - p_header->nTimeStamp = p_block->i_dts; + if (p_sys->b_use_pts) + p_header->nTimeStamp = p_block->i_pts; + else + p_header->nTimeStamp = p_block->i_dts; /* In direct mode we pass the input pointer as is. * Otherwise we memcopy the data */ diff --git a/modules/codec/omxil/omxil.h b/modules/codec/omxil/omxil.h index 4fa1d60b48..649ba65a8d 100644 --- a/modules/codec/omxil/omxil.h +++ b/modules/codec/omxil/omxil.h @@ -103,6 +103,7 @@ struct decoder_sys_t date_t end_date; int i_nal_size_length; /* Length of the NAL size field for H264 */ + int b_use_pts; OMX_BUFFERHEADERTYPE sentinel_buffer; }; -- 2.39.5