[vlc-commits] demux: asf: check only active tracks within video/audio

Francois Cartegnie git at videolan.org
Thu May 15 20:39:33 CEST 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu May 15 20:02:24 2014 +0200| [d9befadbff9eff79efc8ac2758ab894b00cebaa7] | committer: Francois Cartegnie

demux: asf: check only active tracks within video/audio

or pcr update could never happen

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d9befadbff9eff79efc8ac2758ab894b00cebaa7
---

 modules/demux/asf/asf.c |   20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/modules/demux/asf/asf.c b/modules/demux/asf/asf.c
index 7c435ce..9fef73c 100644
--- a/modules/demux/asf/asf.c
+++ b/modules/demux/asf/asf.c
@@ -85,7 +85,7 @@ typedef struct
     asf_object_stream_properties_t *p_sp;
     asf_object_extended_stream_properties_t *p_esp;
 
-    mtime_t i_time;
+    mtime_t          i_time; /* track time*/
 
     block_t         *p_frame; /* use to gather complete frame */
 } asf_track_t;
@@ -514,10 +514,22 @@ static mtime_t GetMoviePTS( demux_sys_t *p_sys )
     {
         const asf_track_t *tk = p_sys->track[i];
 
-        if( tk && tk->p_es && tk->i_time > 0 && tk->b_selected )
+        if( tk && tk->p_es && tk->b_selected )
         {
-            if( i_time < 0 ) i_time = tk->i_time;
-            else i_time = __MIN( i_time, tk->i_time );
+            /* Skip discrete tracks */
+            if ( tk->i_cat != VIDEO_ES && tk->i_cat != AUDIO_ES )
+                continue;
+
+            /* We need to have all ES seen once, as they might have lower DTS */
+            if ( tk->i_time + (int64_t)p_sys->p_fp->i_preroll * 1000 < 0 )
+            {
+                /* early fail */
+                return -1;
+            }
+            else if ( i_time == -1 || i_time > tk->i_time )
+            {
+                i_time = tk->i_time;
+            }
         }
     }
 



More information about the vlc-commits mailing list