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.")
+#define FILE_LONGTEXT N_("File to which the audio samples will be written to. (\"-\" for stdout")
vlc_module_begin();
set_description( _("File audio output") );
return VLC_EGENERIC;
}
- p_aout->output.p_sys->p_file = utf8_fopen( psz_name, "wb" );
+ 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" );
+
free( psz_name );
if ( p_aout->output.p_sys->p_file == NULL )
{
{
msg_Err( p_aout, "cannot understand the format string (%s)",
psz_format );
- fclose( p_aout->output.p_sys->p_file );
+ if( p_aout->output.p_sys->p_file != stdout )
+ fclose( p_aout->output.p_sys->p_file );
free( p_aout->output.p_sys );
return VLC_EGENERIC;
}
}
}
- fclose( p_aout->output.p_sys->p_file );
+ if( p_aout->output.p_sys->p_file != stdout )
+ fclose( p_aout->output.p_sys->p_file );
free( p_aout->output.p_sys );
}