]> git.sesse.net Git - vlc/commitdiff
* modules/audio_filter/converter/dtstospdif.c: don't forget to take care of the sampl...
authorGildas Bazin <gbazin@videolan.org>
Wed, 4 Feb 2004 23:28:10 +0000 (23:28 +0000)
committerGildas Bazin <gbazin@videolan.org>
Wed, 4 Feb 2004 23:28:10 +0000 (23:28 +0000)
modules/audio_filter/converter/dtstospdif.c

index b76783191052e4dc17b04714fbb9cd3f082a9bb7..214d5b6f3b136356ff1dbf69409ec95df19ef96c 100644 (file)
@@ -2,7 +2,7 @@
  * dtstospdif.c : encapsulates DTS frames into S/PDIF packets
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: dtstospdif.c,v 1.3 2004/02/04 23:03:36 gbazin Exp $
+ * $Id: dtstospdif.c,v 1.4 2004/02/04 23:28:10 gbazin Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *
@@ -47,6 +47,8 @@ struct aout_filter_sys_t
 
     uint8_t *p_buf;
 
+    mtime_t start_date;
+
     int i_frames;
     unsigned int i_frame_size;
 };
@@ -135,6 +137,10 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
 
     if( p_filter->p_sys->i_frames < 3 )
     {
+        if( !p_filter->p_sys->i_frames )
+            /* We'll need the starting date */
+            p_filter->p_sys->start_date = p_in_buf->start_date;
+
         /* Not enough data */
         p_out_buf->i_nb_samples = 0;
         p_out_buf->i_nb_bytes = 0;
@@ -181,6 +187,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
                                     i_fz - i_length - 8 );
     }
 
+    p_out_buf->start_date = p_filter->p_sys->start_date;
     p_out_buf->i_nb_samples = p_in_buf->i_nb_samples * 3;
     p_out_buf->i_nb_bytes = p_out_buf->i_nb_samples * 4;
 }