]> git.sesse.net Git - vlc/blobdiff - modules/audio_output/file.c
aout3 API change :
[vlc] / modules / audio_output / file.c
index 1e33f001e2f49a1ed1425d813a8bf66f913a2e12..36d2dcc272d0e454034dd751f09d2ff61700594a 100644 (file)
@@ -2,7 +2,7 @@
  * file.c : audio output which writes the samples to a file
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: file.c,v 1.9 2002/08/30 22:22:24 massiot Exp $
+ * $Id: file.c,v 1.10 2002/08/30 23:27:06 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -41,7 +41,6 @@
  *****************************************************************************/
 static int     Open        ( vlc_object_t * );
 static void    Close       ( vlc_object_t * );
-static int     SetFormat   ( aout_instance_t * );
 static void    Play        ( aout_instance_t * );
 
 /*****************************************************************************
@@ -82,37 +81,18 @@ static int Open( vlc_object_t * p_this )
     aout_instance_t * p_aout = (aout_instance_t *)p_this;
     FILE * p_file;
     char * psz_name = config_GetPsz( p_this, "path" );
+    char * psz_format = config_GetPsz( p_aout, "format" );
+    char ** ppsz_compare = format_list;
+    int i = 0;
+
 
     p_file = fopen( psz_name, "wb" );
     p_aout->output.p_sys = (void *)p_file;
     free( psz_name );
     if ( p_file == NULL ) return -1;
 
-    p_aout->output.pf_setformat = SetFormat;
     p_aout->output.pf_play = Play;
 
-    return VLC_SUCCESS;
-}
-
-/*****************************************************************************
- * Close: close our file
- *****************************************************************************/
-static void Close( vlc_object_t * p_this )
-{
-    aout_instance_t * p_aout = (aout_instance_t *)p_this;
-
-    fclose( (FILE *)p_aout->output.p_sys );
-}
-
-/*****************************************************************************
- * SetFormat: pretend to set the dsp output format
- *****************************************************************************/
-static int SetFormat( aout_instance_t * p_aout )
-{
-    char * psz_format = config_GetPsz( p_aout, "format" );
-    char ** ppsz_compare = format_list;
-    int i = 0;
-
     while ( *ppsz_compare != NULL )
     {
         if ( !strncmp( *ppsz_compare, psz_format, strlen(*ppsz_compare) ) )
@@ -143,6 +123,16 @@ static int SetFormat( aout_instance_t * p_aout )
     return 0;
 }
 
+/*****************************************************************************
+ * Close: close our file
+ *****************************************************************************/
+static void Close( vlc_object_t * p_this )
+{
+    aout_instance_t * p_aout = (aout_instance_t *)p_this;
+
+    fclose( (FILE *)p_aout->output.p_sys );
+}
+
 /*****************************************************************************
  * Play: pretend to play a sound
  *****************************************************************************/