[vlc-devel] commit: Improved a bit PCR in asf. (Laurent Aimar )

git version control git at videolan.org
Thu Oct 9 00:14:27 CEST 2008


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Wed Oct  8 22:57:25 2008 +0200| [25a8f939f77e511397e5829241691ea8d1eefe8b] | committer: Laurent Aimar 

Improved a bit PCR in asf.

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

 modules/demux/asf/asf.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/modules/demux/asf/asf.c b/modules/demux/asf/asf.c
index 3d90b84..0919397 100644
--- a/modules/demux/asf/asf.c
+++ b/modules/demux/asf/asf.c
@@ -179,6 +179,7 @@ static int Demux( demux_t *p_demux )
                                     _("VLC failed to load the ASF header.") );
                     return 0;
                 }
+                es_out_Control( p_demux->out, ES_OUT_RESET_PCR );
                 continue;
             }
         }
@@ -203,7 +204,7 @@ static int Demux( demux_t *p_demux )
     p_sys->i_time = GetMoviePTS( p_sys );
     if( p_sys->i_time >= 0 )
     {
-        es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_sys->i_time );
+        es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_sys->i_time+1 );
     }
 
     return 1;
@@ -346,6 +347,7 @@ static mtime_t GetMoviePTS( demux_sys_t *p_sys )
         {
             if( i_time < 0 ) i_time = tk->i_time;
             else i_time = __MIN( i_time, tk->i_time );
+            break;
         }
     }
 
@@ -580,6 +582,9 @@ static int DemuxPacket( demux_t *p_demux )
                 /* send complete packet to decoder */
                 block_t *p_gather = block_ChainGather( tk->p_frame );
 
+                if( p_sys->i_time < 0 )
+                    es_out_Control( p_demux->out, ES_OUT_SET_PCR, tk->i_time );
+
                 es_out_Send( p_demux->out, tk->p_es, p_gather );
 
                 tk->p_frame = NULL;
@@ -1013,8 +1018,6 @@ static int DemuxInit( demux_t *p_demux )
         }
     }
 #endif
-
-    es_out_Control( p_demux->out, ES_OUT_RESET_PCR );
     return VLC_SUCCESS;
 
 error:




More information about the vlc-devel mailing list