[vlc-devel] [PATCH] [codec/schroedinger] If pts is unavaliable, do not fall back to dts

David Flynn davidf+nntp at woaf.net
Sat Aug 23 23:08:09 CEST 2008


It is more reliable to interpolate pts at the output of the decoder
than to use dts.

This requires demuxers that only provide dts (such as avi) to provide
an initial value of pts so that the decoder may interpolate correctly.

Signed-off-by: David Flynn <davidf at woaf.net>
---
 modules/codec/schroedinger.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/modules/codec/schroedinger.c b/modules/codec/schroedinger.c
index 3fc1582..b89e7df 100644
--- a/modules/codec/schroedinger.c
+++ b/modules/codec/schroedinger.c
@@ -206,16 +206,14 @@ static void StorePicturePTS( decoder_t *p_dec, block_t *p_block, int i_pupos )
 {
     decoder_sys_t *p_sys = p_dec->p_sys;
     uint32_t u_pnum;
-    mtime_t i_pts;
 
     u_pnum = GetDWBE( p_block->p_buffer + i_pupos + 13 );
-    i_pts = p_block->i_pts > 0 ? p_block->i_pts : p_block->i_dts;
 
     for( int i=0; i<PTS_TLB_SIZE; i++ ) {
         if( p_sys->pts_tlb[i].i_empty ) {
 
             p_sys->pts_tlb[i].u_pnum = u_pnum;
-            p_sys->pts_tlb[i].i_pts = i_pts;
+            p_sys->pts_tlb[i].i_pts = p_block->i_pts;
             p_sys->pts_tlb[i].i_empty = 0;
 
             return;
@@ -223,7 +221,7 @@ static void StorePicturePTS( decoder_t *p_dec, block_t *p_block, int i_pupos )
     }
 
     msg_Err( p_dec, "Could not store PTS %"PRId64" for picture %u",
-             i_pts, u_pnum );
+             p_block->i_pts, u_pnum );
 }
 
 /*****************************************************************************
-- 
1.5.6





More information about the vlc-devel mailing list