# include "config.h"
#endif
-#include <errno.h>
-
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_demux.h>
-#include <vlc_charset.h>
+#include <vlc_fs.h>
/*****************************************************************************
* Module descriptor
demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys;
const char *psz_mode;
- vlc_value_t val;
bool b_append;
/* Accept only if forced */
if( !p_sys )
return VLC_ENOMEM;
- var_Create( p_demux, "demuxdump-append", VLC_VAR_BOOL|VLC_VAR_DOINHERIT );
- var_Get( p_demux, "demuxdump-append", &val );
- b_append = val.b_bool;
+ b_append = var_CreateGetBool( p_demux, "demuxdump-append" );
if ( b_append )
psz_mode = "ab";
else
msg_Info( p_demux, "dumping raw stream to standard output" );
p_sys->p_file = stdout;
}
- else if( ( p_sys->p_file = utf8_fopen( p_sys->psz_file, psz_mode ) ) == NULL )
+ else if( ( p_sys->p_file = vlc_fopen( p_sys->psz_file, psz_mode ) ) == NULL )
{
msg_Err( p_demux, "cannot create `%s' for writing", p_sys->psz_file );
free( p_sys->psz_file );
demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys = p_demux->p_sys;
- msg_Info( p_demux ,"closing %s (%"PRId64" Kbytes dumped)", p_sys->psz_file,
+ msg_Info( p_demux ,"closing %s (%"PRId64" KiB dumped)", p_sys->psz_file,
p_sys->i_write / 1024 );
if( p_sys->p_file != stdout )
int i_data;
- /* I'm pretty sure that stream_Peek,stream_Read( , NULL ) would be faster*/
i_data = stream_Read( p_demux->s, p_sys->buffer, DUMP_BLOCKSIZE );
if ( i_data <= 0 )
return i_data;