X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Faudio_output%2Ffile.c;h=3bee0ebd7136c6f529b67396f9c880d391111d05;hb=05c3c71df21fe5aca59f631b3841e70dbd2bd8db;hp=cb9bc0c8897ab001d86caf46a1f60439f4d86e13;hpb=c5c06b64c806052086e5772d64e540a8db7e4a9b;p=vlc diff --git a/modules/audio_output/file.c b/modules/audio_output/file.c index cb9bc0c889..3bee0ebd71 100644 --- a/modules/audio_output/file.c +++ b/modules/audio_output/file.c @@ -30,13 +30,11 @@ # include "config.h" #endif -#include - #include #include #include #include /* WAVEHEADER */ -#include +#include #define FRAME_SIZE 2048 #define A52_FRAME_NB 1536 @@ -122,7 +120,7 @@ vlc_module_begin () CHANNELS_TEXT, CHANNELS_LONGTEXT, true ) add_file( "audiofile-file", "audiofile.wav", NULL, FILE_TEXT, FILE_LONGTEXT, false ) - add_bool( "audiofile-wav", 1, NULL, WAV_TEXT, WAV_LONGTEXT, true ) + add_bool( "audiofile-wav", true, NULL, WAV_TEXT, WAV_LONGTEXT, true ) set_capability( "audio output", 0 ) add_shortcut( "file" ) @@ -156,7 +154,7 @@ static int Open( vlc_object_t * p_this ) if( !strcmp( psz_name, "-" ) ) p_aout->output.p_sys->p_file = stdout; else - p_aout->output.p_sys->p_file = utf8_fopen( psz_name, "wb" ); + p_aout->output.p_sys->p_file = vlc_fopen( psz_name, "wb" ); free( psz_name ); if ( p_aout->output.p_sys->p_file == NULL ) @@ -223,7 +221,7 @@ static int Open( vlc_object_t * p_this ) /* Write wave header */ WAVEHEADER *wh = &p_aout->output.p_sys->waveh; - memset( wh, 0, sizeof(wh) ); + memset( wh, 0, sizeof(*wh) ); switch( p_aout->output.output.i_format ) { @@ -323,7 +321,7 @@ static void Play( aout_instance_t * p_aout ) p_buffer = aout_FifoPop( p_aout, &p_aout->output.fifo ); - if( fwrite( p_buffer->p_buffer, p_buffer->i_nb_bytes, 1, + if( fwrite( p_buffer->p_buffer, p_buffer->i_buffer, 1, p_aout->output.p_sys->p_file ) != 1 ) { msg_Err( p_aout, "write error (%m)" ); @@ -332,7 +330,7 @@ static void Play( aout_instance_t * p_aout ) if( p_aout->output.p_sys->b_add_wav_header ) { /* Update Wave Header */ - p_aout->output.p_sys->waveh.DataLength += p_buffer->i_nb_bytes; + p_aout->output.p_sys->waveh.DataLength += p_buffer->i_buffer; } aout_BufferFree( p_buffer );