]> git.sesse.net Git - vlc/commitdiff
omxil: Pass pts as timestamp on the ducati decoder
authorMartin Storsjö <martin@martin.st>
Wed, 4 Apr 2012 12:18:00 +0000 (15:18 +0300)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 5 Apr 2012 09:45:58 +0000 (11:45 +0200)
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 <jb@videolan.org>
modules/codec/omxil/omxil.c
modules/codec/omxil/omxil.h

index 34509e1c100255f3e0a5e703ef03fe615a6e54d6..29d92edda2df02fc87b35a9b9e393f2a59054c54 100644 (file)
@@ -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 */
index 4fa1d60b4897a2c9146774f37502fa5fb3d8d9c0..649ba65a8d62b0c8c1e19fe20e25a3fb4cef690d 100644 (file)
@@ -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;
 };