]> git.sesse.net Git - vlc/commitdiff
* Added a third argument to aout_OutputNextBuffer. In case the buffer
authorChristophe Massiot <massiot@videolan.org>
Wed, 14 Aug 2002 00:43:52 +0000 (00:43 +0000)
committerChristophe Massiot <massiot@videolan.org>
Wed, 14 Aug 2002 00:43:52 +0000 (00:43 +0000)
  received does not start exactly at the given date, it indicates if the
  output plug-in is able to compensate for the drift (for instance on
  startup, or with S/PDIF packets), or if we need the aout core to
  resample the coming buffers. It is currently unimplemented.

12 files changed:
include/aout_internal.h
include/audio_output.h
include/vlc_symbols.h
modules/audio_output/arts.c
modules/audio_output/esd.c
modules/audio_output/oss.c
modules/audio_output/sdl.c
modules/audio_output/waveout.c
modules/gui/macosx/aout.m
modules/video_output/directx/aout.c
src/audio_output/output.c
src/misc/modules_plugin.h

index 3355ff3d2889ae8f0e446d605c0a844b1dd58d53..f12595006a204ebd3d44b2286497a48390f8b9c2 100644 (file)
@@ -2,7 +2,7 @@
  * aout_internal.h : internal defines for audio output
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: aout_internal.h,v 1.4 2002/08/14 00:23:59 massiot Exp $
+ * $Id: aout_internal.h,v 1.5 2002/08/14 00:43:51 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -267,4 +267,5 @@ int aout_OutputNew( aout_instance_t * p_aout,
                     audio_sample_format_t * p_format );
 void aout_OutputPlay( aout_instance_t * p_aout, aout_buffer_t * p_buffer );
 void aout_OutputDelete( aout_instance_t * p_aout );
+VLC_EXPORT( aout_buffer_t *, aout_OutputNextBuffer, ( aout_instance_t *, mtime_t, vlc_bool_t ) );
 
index addf857056a2b3d04d5b81a4e61562ecb695b3d9..19a8878c42678680070cf844589eb628cb82a531 100644 (file)
@@ -2,7 +2,7 @@
  * audio_output.h : audio output interface
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: audio_output.h,v 1.58 2002/08/14 00:23:59 massiot Exp $
+ * $Id: audio_output.h,v 1.59 2002/08/14 00:43:51 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -132,6 +132,3 @@ VLC_EXPORT( int, aout_FormatToByterate, ( audio_sample_format_t * p_format ) );
 VLC_EXPORT( aout_input_t *, __aout_InputNew, ( vlc_object_t *, aout_instance_t **, audio_sample_format_t * ) );
 VLC_EXPORT( void, aout_InputDelete, ( aout_instance_t *, aout_input_t * ) );
 
-/* From output.c : */
-VLC_EXPORT( aout_buffer_t *, aout_OutputNextBuffer, ( aout_instance_t *, mtime_t ) );
-
index 4074523c8c59303dc79b977070d3a6b2dd14d923..c2fa2fdbf706e8568263713d699f13550d2d4604 100644 (file)
@@ -3,7 +3,7 @@
 struct module_symbols_t
 {
     aout_buffer_t * (* aout_BufferNew_inner) ( aout_instance_t *, aout_input_t *, size_t ) ;
-    aout_buffer_t * (* aout_OutputNextBuffer_inner) ( aout_instance_t *, mtime_t ) ;
+    aout_buffer_t * (* aout_OutputNextBuffer_inner) ( aout_instance_t *, mtime_t, vlc_bool_t ) ;
     aout_input_t * (* __aout_InputNew_inner) ( vlc_object_t *, aout_instance_t **, audio_sample_format_t * ) ;
     aout_instance_t * (* __aout_NewInstance_inner) ( vlc_object_t * ) ;
     char * (* __config_GetPsz_inner) (vlc_object_t *, const char *) ;
index c00d85f40fb22699ae2ea2bac18bfe11390eb99f..80c176900b36e96f06891cf4e2f9cd7f4d2f7769 100644 (file)
@@ -205,7 +205,7 @@ static int aRtsThread( aout_instance_t * p_aout )
 
         /* Get the presentation date of the next write() operation. It
          * is equal to the current date + latency */
-        p_buffer = aout_OutputNextBuffer( p_aout, mdate() + p_sys->latency );
+        p_buffer = aout_OutputNextBuffer( p_aout, mdate() + p_sys->latency, 0 );
 
         if ( p_buffer != NULL )
         {
index 4db499ecd7407a7e343e309bea42ed2838f773dc..24d5364943882816a5869ae7b5bef7daea4834be 100644 (file)
@@ -2,7 +2,7 @@
  * esd.c : EsounD module
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: esd.c,v 1.4 2002/08/14 00:23:59 massiot Exp $
+ * $Id: esd.c,v 1.5 2002/08/14 00:43:52 massiot Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -201,7 +201,7 @@ static int ESDThread( aout_instance_t * p_aout )
 
         /* Get the presentation date of the next write() operation. It
          * is equal to the current date + buffered samples + esd latency */
-        p_buffer = aout_OutputNextBuffer( p_aout, mdate() + p_sys->latency );
+        p_buffer = aout_OutputNextBuffer( p_aout, mdate() + p_sys->latency, 0 );
 
         if ( p_buffer != NULL )
         {
index 7e1f67d2054c0fd4d968e2b2f489da2750e18109..5c66b0e33a5476b19696ddb13a506e89f458bd98 100644 (file)
@@ -2,7 +2,7 @@
  * oss.c : OSS /dev/dsp module for vlc
  *****************************************************************************
  * Copyright (C) 2000-2002 VideoLAN
- * $Id: oss.c,v 1.9 2002/08/14 00:23:59 massiot Exp $
+ * $Id: oss.c,v 1.10 2002/08/14 00:43:52 massiot Exp $
  *
  * Authors: Michel Kaempf <maxx@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -293,7 +293,6 @@ static int OSSThread( aout_instance_t * p_aout )
     while ( !p_aout->b_die )
     {
         aout_buffer_t * p_buffer;
-        mtime_t next_date = 0;
         int i_tmp, i_size;
         byte_t * p_bytes;
 
@@ -305,6 +304,7 @@ static int OSSThread( aout_instance_t * p_aout )
 
         if ( p_aout->output.output.i_format != AOUT_FMT_SPDIF )
         {
+            mtime_t next_date = 0;
             /* Get the presentation date of the next write() operation. It
              * is equal to the current date + duration of buffered samples.
              * Order is important here, since GetBufInfo is believed to take
@@ -312,9 +312,13 @@ static int OSSThread( aout_instance_t * p_aout )
             next_date = (mtime_t)GetBufInfo( p_aout ) * 1000000
                       / aout_FormatToByterate( &p_aout->output.output );
             next_date += mdate();
-        }
 
-        p_buffer = aout_OutputNextBuffer( p_aout, next_date );
+            p_buffer = aout_OutputNextBuffer( p_aout, next_date, 0 );
+        }
+        else
+        {
+            p_buffer = aout_OutputNextBuffer( p_aout, 0, 1 );
+        }
 
         if ( p_buffer != NULL )
         {
index a3702829159d74d0c10f66bc41166015cb292da0..6224bf3f5cd8eec7602d401849def28009113e6c 100644 (file)
@@ -2,7 +2,7 @@
  * sdl.c : SDL audio output plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2002 VideoLAN
- * $Id: sdl.c,v 1.1 2002/08/13 11:59:36 sam Exp $
+ * $Id: sdl.c,v 1.2 2002/08/14 00:43:52 massiot Exp $
  *
  * Authors: Michel Kaempf <maxx@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -155,7 +155,7 @@ static void SDLCallback( void * _p_aout, byte_t * p_stream, int i_len )
 {
     aout_instance_t * p_aout = (aout_instance_t *)_p_aout;
     /* FIXME : take into account SDL latency instead of mdate() */
-    aout_buffer_t * p_buffer = aout_OutputNextBuffer( p_aout, mdate() );
+    aout_buffer_t * p_buffer = aout_OutputNextBuffer( p_aout, mdate(), 0 );
 
     if ( i_len != FRAME_SIZE * sizeof(s16)
                     * p_aout->output.output.i_channels )
index 552f1b2e85bc6b2237156ca1f9235af8de79de7e..10468294cdd9696894ce77d8eefc6a05a45751a5 100644 (file)
@@ -2,7 +2,7 @@
  * waveout.c : Windows waveOut plugin for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: waveout.c,v 1.2 2002/08/10 18:17:06 gbazin Exp $
+ * $Id: waveout.c,v 1.3 2002/08/14 00:43:52 massiot Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *      
@@ -311,7 +311,7 @@ static void CALLBACK WaveOutCallback( HWAVEOUT h_waveout, UINT uMsg,
         aout_BufferFree( (aout_buffer_t *)p_waveheader->dwUser );
 
     /* FIXME : take into account WaveOut latency instead of mdate() */
-    p_buffer = aout_OutputNextBuffer( p_aout, mdate() );
+    p_buffer = aout_OutputNextBuffer( p_aout, mdate(), 0 );
 
     PlayWaveOut( p_aout, h_waveout, p_waveheader, p_buffer );
 }
index bb586781ba7fba836cae4cd857f25219dab8f265..c56b5a5dc02371aae7c2cad079731f9efd7deef8 100644 (file)
@@ -2,7 +2,7 @@
  * aout.m: CoreAudio output plugin
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: aout.m,v 1.3 2002/08/12 22:48:18 massiot Exp $
+ * $Id: aout.m,v 1.4 2002/08/14 00:43:52 massiot Exp $
  *
  * Authors: Colin Delacroix <colin@zoy.org>
  *          Jon Lech Johansen <jon-vl@nanocrew.net>
@@ -241,7 +241,7 @@ static OSStatus IOCallback( AudioDeviceID inDevice,
     current_date = p_sys->clock_diff
                  + AudioConvertHostTimeToNanos(host_time.mHostTime) / 1000;
 
-    p_buffer = aout_OutputNextBuffer( p_aout, current_date );
+    p_buffer = aout_OutputNextBuffer( p_aout, current_date, 0 );
 
     /* move data into output data buffer */
     if ( p_buffer != NULL )
index 1198e0216193b6c7fb425e0126dce8ac2142abf4..e654a6fa731c605f551d480755a094367e526b93 100644 (file)
@@ -2,7 +2,7 @@
  * aout.c: Windows DirectX audio output method
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: aout.c,v 1.3 2002/08/12 09:34:15 sam Exp $
+ * $Id: aout.c,v 1.4 2002/08/14 00:43:52 massiot Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -560,7 +560,7 @@ static void DirectSoundThread( notification_thread_t *p_notif )
         }
 
         /* FIXME : take into account DirectSound latency instead of mdate() */
-        p_buffer = aout_OutputNextBuffer( p_aout, mdate() );
+        p_buffer = aout_OutputNextBuffer( p_aout, mdate(), 0 );
 
         /* Now do the actual memcpy into the circular buffer */
         if ( l_bytes1 != p_notif->i_buffer_size )
index bde793c5b257d64a0c48830b28bedfcf5cb07446..94604d3ae5f778ff181e7537aafb4ccfcf75c9b6 100644 (file)
@@ -2,7 +2,7 @@
  * output.c : internal management of output streams for the audio output
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: output.c,v 1.5 2002/08/14 00:23:59 massiot Exp $
+ * $Id: output.c,v 1.6 2002/08/14 00:43:52 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -168,8 +168,8 @@ void aout_OutputPlay( aout_instance_t * p_aout, aout_buffer_t * p_buffer )
  * do it by itself. S/PDIF outputs should always set b_can_sleek = 1.
  *****************************************************************************/
 aout_buffer_t * aout_OutputNextBuffer( aout_instance_t * p_aout,
-                                       mtime_t start_date /*,
-                                       vlc_bool_t b_can_sleek */ )
+                                       mtime_t start_date ,
+                                       vlc_bool_t b_can_sleek )
 {
     aout_buffer_t * p_buffer;
 
index 6d7368d47c1d46fc56c16967b7f6b4d45c1d288a..d00c6cac4ae311018f39be630e6e51f8c23371ae 100644 (file)
@@ -179,6 +179,7 @@ static const char * module_error( char *psz_buffer )
  * STORE_SYMBOLS: store known symbols into p_symbols for plugin access.
  *****************************************************************************/
 #define STORE_SYMBOLS( p_symbols ) \
+    (p_symbols)->aout_OutputNextBuffer_inner = aout_OutputNextBuffer; \
     (p_symbols)->__aout_NewInstance_inner = __aout_NewInstance; \
     (p_symbols)->aout_DeleteInstance_inner = aout_DeleteInstance; \
     (p_symbols)->aout_BufferNew_inner = aout_BufferNew; \
@@ -187,7 +188,6 @@ static const char * module_error( char *psz_buffer )
     (p_symbols)->aout_FormatToByterate_inner = aout_FormatToByterate; \
     (p_symbols)->__aout_InputNew_inner = __aout_InputNew; \
     (p_symbols)->aout_InputDelete_inner = aout_InputDelete; \
-    (p_symbols)->aout_OutputNextBuffer_inner = aout_OutputNextBuffer; \
     (p_symbols)->__config_GetInt_inner = __config_GetInt; \
     (p_symbols)->__config_PutInt_inner = __config_PutInt; \
     (p_symbols)->__config_GetFloat_inner = __config_GetFloat; \