]> git.sesse.net Git - vlc/blobdiff - modules/audio_output/file.c
threads: Make sure we don't re-create a thread if the object has already one.
[vlc] / modules / audio_output / file.c
index f7dde4c07ec2b0f6d794cca485435b7ff4e75a09..07da0fe1384492ef5aeeea22a6e2eff31fb3b626 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <errno.h>
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <errno.h>
+
+#include <vlc_common.h>
+#include <vlc_plugin.h>
 #include <vlc_aout.h>
 #include <vlc_codecs.h> /* WAVEHEADER */
 #include <vlc_charset.h>
@@ -90,26 +92,26 @@ static void    Play        ( aout_instance_t * );
 #define WAV_LONGTEXT N_("Instead of writing a raw file, you can add a WAV " \
                         "header to the file.")
 
-static const char *format_list[] = { "u8", "s8", "u16", "s16", "u16_le",
+static const char *const format_list[] = { "u8", "s8", "u16", "s16", "u16_le",
                                      "s16_le", "u16_be", "s16_be", "fixed32",
                                      "float32", "spdif" };
-static int format_int[] = { VLC_FOURCC('u','8',' ',' '),
-                            VLC_FOURCC('s','8',' ',' '),
-                            AOUT_FMT_U16_NE, AOUT_FMT_S16_NE,
-                            VLC_FOURCC('u','1','6','l'),
-                            VLC_FOURCC('s','1','6','l'),
-                            VLC_FOURCC('u','1','6','b'),
-                            VLC_FOURCC('s','1','6','b'),
-                            VLC_FOURCC('f','i','3','2'),
-                            VLC_FOURCC('f','l','3','2'),
-                            VLC_FOURCC('s','p','i','f') };
+static const int format_int[] = { VLC_FOURCC('u','8',' ',' '),
+                                  VLC_FOURCC('s','8',' ',' '),
+                                  AOUT_FMT_U16_NE, AOUT_FMT_S16_NE,
+                                  VLC_FOURCC('u','1','6','l'),
+                                  VLC_FOURCC('s','1','6','l'),
+                                  VLC_FOURCC('u','1','6','b'),
+                                  VLC_FOURCC('s','1','6','b'),
+                                  VLC_FOURCC('f','i','3','2'),
+                                  VLC_FOURCC('f','l','3','2'),
+                                  VLC_FOURCC('s','p','i','f') };
 
 #define FILE_TEXT N_("Output file")
 #define FILE_LONGTEXT N_("File to which the audio samples will be written to. (\"-\" for stdout")
 
 vlc_module_begin();
-    set_description( _("File audio output") );
-    set_shortname( _("File") );
+    set_description( N_("File audio output") );
+    set_shortname( N_("File") );
     set_category( CAT_AUDIO );
     set_subcategory( SUBCAT_AUDIO_AOUT );
 
@@ -153,10 +155,7 @@ static int Open( vlc_object_t * p_this )
     /* Allocate structure */
     p_aout->output.p_sys = malloc( sizeof( aout_sys_t ) );
     if( p_aout->output.p_sys == NULL )
-    {
-        msg_Err( p_aout, "out of memory" );
-        return VLC_EGENERIC;
-    }
+        return VLC_ENOMEM;
 
     if( !strcmp( psz_name, "-" ) )
         p_aout->output.p_sys->p_file = stdout;