]> git.sesse.net Git - vlc/commitdiff
* modules/codec/vorbis.c: wait for the first dated packet before starting decoding...
authorGildas Bazin <gbazin@videolan.org>
Wed, 24 Sep 2003 23:45:06 +0000 (23:45 +0000)
committerGildas Bazin <gbazin@videolan.org>
Wed, 24 Sep 2003 23:45:06 +0000 (23:45 +0000)
modules/codec/vorbis.c

index 05ee7eceb485e39d5cf680be2e46884af6a8eb4b..fbd55319b896a033bc08119adf945b1f16d93b9d 100644 (file)
@@ -2,7 +2,7 @@
  * vorbis.c: vorbis decoder module making use of libvorbis.
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: vorbis.c,v 1.17 2003/09/02 20:19:25 gbazin Exp $
+ * $Id: vorbis.c,v 1.18 2003/09/24 23:45:06 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -222,7 +222,7 @@ static int RunDecoder( decoder_t *p_dec, block_t *p_block )
     /* Block to Ogg packet */
     oggpacket.packet = p_block->p_buffer;
     oggpacket.bytes = p_block->i_buffer;
-    oggpacket.granulepos = p_block->i_dts;
+    oggpacket.granulepos = -1;
     oggpacket.b_o_s = 0;
     oggpacket.e_o_s = 0;
     oggpacket.packetno = 0;
@@ -382,6 +382,12 @@ static int ProcessPacket( decoder_t *p_dec, ogg_packet *p_oggpacket,
         aout_DateSet( &p_sys->end_date, i_pts );
     }
 
+    if( !aout_DateGet( &p_sys->end_date ) )
+    {
+        /* We've just started the stream, wait for the first PTS. */
+        return VLC_SUCCESS;
+    }
+
     if( p_sys->b_packetizer )
     {
         return SendPacket( p_dec, p_oggpacket );