/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <stdlib.h>
-#include <string.h>
-#include <vlc/vlc.h>
-#include <vlc/intf.h>
-#include <vlc/input.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+#include <vlc_interface.h>
+#include <vlc_access.h>
+#include <vlc_demux.h>
+#include <vlc_playlist.h>
+
+#include "dummy.h"
/*****************************************************************************
* Access functions.
*****************************************************************************/
static int AccessRead( access_t *p_access, uint8_t *p, int i_size )
{
+ VLC_UNUSED(p_access);
memset( p, 0, i_size );
return i_size;
}
static int AccessControl( access_t *p_access, int i_query, va_list args )
{
- vlc_bool_t *pb_bool;
+ bool *pb_bool;
int *pi_int;
int64_t *pi_64;
case ACCESS_CAN_FASTSEEK:
case ACCESS_CAN_PAUSE:
case ACCESS_CAN_CONTROL_PACE:
- pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t* );
- *pb_bool = VLC_FALSE;
+ pb_bool = (bool*)va_arg( args, bool* );
+ *pb_bool = false;
break;
/* */
return VLC_SUCCESS;
}
-int E_(OpenAccess)( vlc_object_t *p_this )
+int OpenAccess( vlc_object_t *p_this )
{
access_t *p_access = (access_t*)p_this;
p_access->info.i_update = 0;
p_access->info.i_size = 0;
p_access->info.i_pos = 0;
- p_access->info.b_eof = VLC_FALSE;
+ p_access->info.b_eof = false;
p_access->info.i_title = 0;
p_access->info.i_seekpoint = 0;
p_access->p_sys = NULL;
/* Force dummy demux plug-in */
+ free( p_access->psz_demux );
p_access->psz_demux = strdup( "vlc" );
return VLC_SUCCESS;
/* Used for the pause command */
mtime_t expiration;
-
+
/* The command to run */
char* psz_command;
};
/*****************************************************************************
* OpenDemux: initialize the target, ie. parse the command
*****************************************************************************/
-int E_(OpenDemux) ( vlc_object_t *p_this )
+int OpenDemux ( vlc_object_t *p_this )
{
demux_t *p_demux = (demux_t*)p_this;
char * psz_name = p_demux->psz_path;
p_sys->expiration = mdate() + (mtime_t)i_arg * (mtime_t)1000000;
return VLC_SUCCESS;
}
-
+
msg_Err( p_demux, "unknown command `%s'", psz_name );
free( p_sys );
/*****************************************************************************
* CloseDemux: initialize the target, ie. parse the command
*****************************************************************************/
-void E_(CloseDemux) ( vlc_object_t *p_this )
+void CloseDemux ( vlc_object_t *p_this )
{
demux_t *p_demux = (demux_t*)p_this;
{
demux_sys_t *p_sys = p_demux->p_sys;
playlist_t *p_playlist;
- vlc_bool_t b_eof = VLC_FALSE;
-
- p_playlist = vlc_object_find( p_demux, VLC_OBJECT_PLAYLIST, FIND_PARENT );
+ bool b_eof = false;
- if( p_playlist == NULL )
- {
- msg_Err( p_demux, "we are not attached to a playlist" );
- return -1;
- }
+ p_playlist = pl_Yield( p_demux );
switch( p_sys->i_command )
{
case COMMAND_QUIT:
- b_eof = p_demux->p_libvlc->b_die = VLC_TRUE;
+ b_eof = true;
+ vlc_object_kill( p_demux->p_libvlc );
break;
case COMMAND_PAUSE:
if( mdate() >= p_sys->expiration )
- b_eof = VLC_TRUE;
+ b_eof = true;
else
msleep( 10000 );
break;
-
+
case COMMAND_NOP:
default:
- b_eof = VLC_TRUE;
- break;
+ b_eof = true;
+ break;
}
vlc_object_release( p_playlist );
static int DemuxControl( demux_t *p_demux, int i_query, va_list args )
{
- return demux2_vaControlHelper( p_demux->s,
+ return demux_vaControlHelper( p_demux->s,
0, 0, 0, 1,
i_query, args );
}