[vlc-devel] commit: flac: use VLC_TS_INVALID (refs #3135) ( Rafaël Carré )

git version control git at videolan.org
Mon Dec 7 08:50:42 CET 2009


vlc | branch: master | Rafaël Carré <rafael.carre at gmail.com> | Mon Dec  7 08:37:54 2009 +0100| [b6691ca9c8a29082ba3474515fb10bc08f655651] | committer: Rafaël Carré 

flac: use VLC_TS_INVALID (refs #3135)

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

 modules/codec/flac.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/codec/flac.c b/modules/codec/flac.c
index 1c3e0e3..9b8d1c0 100644
--- a/modules/codec/flac.c
+++ b/modules/codec/flac.c
@@ -224,6 +224,7 @@ static int OpenDecoder( vlc_object_t *p_this )
     p_sys->i_state = STATE_NOSYNC;
     p_sys->b_stream_info = false;
     p_sys->p_block=NULL;
+    p_sys->i_pts = VLC_TS_INVALID;
     p_sys->bytestream = block_BytestreamInit();
 
 #ifdef USE_LIBFLAC
@@ -402,7 +403,7 @@ static block_t *PacketizeBlock( decoder_t *p_dec, block_t **pp_block )
         return NULL;
     }
 
-    if( !date_Get( &p_sys->end_date ) && !(*pp_block)->i_pts )
+    if( !date_Get( &p_sys->end_date ) && (*pp_block)->i_pts <= VLC_TS_INVALID )
     {
         /* We've just started the stream, wait for the first PTS. */
         block_Release( *pp_block );
@@ -444,7 +445,7 @@ static block_t *PacketizeBlock( decoder_t *p_dec, block_t **pp_block )
         case STATE_SYNC:
             /* New frame, set the Presentation Time Stamp */
             p_sys->i_pts = p_sys->bytestream.p_block->i_pts;
-            if( p_sys->i_pts != 0 &&
+            if( p_sys->i_pts > VLC_TS_INVALID &&
                 p_sys->i_pts != date_Get( &p_sys->end_date ) )
             {
                 date_Set( &p_sys->end_date, p_sys->i_pts );
@@ -526,7 +527,7 @@ static block_t *PacketizeBlock( decoder_t *p_dec, block_t **pp_block )
 
             /* Make sure we don't reuse the same pts twice */
             if( p_sys->i_pts == p_sys->bytestream.p_block->i_pts )
-                p_sys->i_pts = p_sys->bytestream.p_block->i_pts = 0;
+                p_sys->i_pts = p_sys->bytestream.p_block->i_pts = VLC_TS_INVALID;
 
             /* So p_block doesn't get re-added several times */
             *pp_block = block_BytestreamPop( &p_sys->bytestream );




More information about the vlc-devel mailing list