]> git.sesse.net Git - vlc/blobdiff - modules/audio_output/file.c
auhal: fix minor memory leak when handling SPDIF devices
[vlc] / modules / audio_output / file.c
index ef9989a9591a5c2e181ecb98d56f0fb50eff9bde..5773acc371f8f30a367b2647cd1a2ca59d86e6c0 100644 (file)
@@ -87,17 +87,20 @@ static void    Flush       ( audio_output_t *, bool );
 #define WAV_LONGTEXT N_("Instead of writing a raw file, you can add a WAV " \
                         "header to the file.")
 
-static const char *const format_list[] = { "u8", "u16", "s16", "u16_le",
-                                     "s16_le", "u16_be", "s16_be",
-                                     "float32", "spdif" };
-static const int format_int[] = { VLC_CODEC_U8,
-                                  VLC_CODEC_U16N, VLC_CODEC_S16N,
-                                  VLC_CODEC_U16L,
-                                  VLC_CODEC_S16L,
-                                  VLC_CODEC_U16B,
-                                  VLC_CODEC_S16B,
-                                  VLC_CODEC_F32L,
-                                  VLC_CODEC_SPDIFL };
+static const char *const format_list[] = {
+    "u8", "s16",
+#ifndef WORDS_BIGENDIAN
+    "float32",
+#endif
+    "spdif",
+};
+static const int format_int[] = {
+    VLC_CODEC_U8, VLC_CODEC_S16N,
+#ifndef WORDS_BIGENDIAN
+    VLC_CODEC_FL32,
+#endif
+    VLC_CODEC_SPDIFL,
+};
 
 #define FILE_TEXT N_("Output file")
 #define FILE_LONGTEXT N_("File to which the audio samples will be written to. (\"-\" for stdout")
@@ -209,15 +212,16 @@ static int Start( audio_output_t *p_aout, audio_sample_format_t *restrict fmt )
 
         switch( fmt->i_format )
         {
-        case VLC_CODEC_F32L:
+#ifndef WORDS_BIGENDIAN
+        case VLC_CODEC_FL32:
             wh->Format     = WAVE_FORMAT_IEEE_FLOAT;
             wh->BitsPerSample = sizeof(float) * 8;
             break;
+#endif
         case VLC_CODEC_U8:
             wh->Format     = WAVE_FORMAT_PCM;
             wh->BitsPerSample = 8;
             break;
-        case VLC_CODEC_S16L:
         default:
             wh->Format     = WAVE_FORMAT_PCM;
             wh->BitsPerSample = 16;