-static int DStreamControl( stream_t *s, int i_query, va_list args )
-{
- d_stream_sys_t *p_sys = (d_stream_sys_t*)s->p_sys;
- int64_t *p_i64;
- bool *p_b;
- int *p_int;
-
- switch( i_query )
- {
- case STREAM_GET_SIZE:
- p_i64 = (int64_t*) va_arg( args, int64_t * );
- *p_i64 = 0;
- return VLC_SUCCESS;
-
- case STREAM_CAN_SEEK:
- p_b = (bool*) va_arg( args, bool * );
- *p_b = false;
- return VLC_SUCCESS;
-
- case STREAM_CAN_FASTSEEK:
- p_b = (bool*) va_arg( args, bool * );
- *p_b = false;
- return VLC_SUCCESS;
-
- case STREAM_GET_POSITION:
- p_i64 = (int64_t*) va_arg( args, int64_t * );
- *p_i64 = p_sys->i_pos;
- return VLC_SUCCESS;
-
- case STREAM_SET_POSITION:
- {
- int64_t i64 = (int64_t)va_arg( args, int64_t );
- int i_skip;
- if( i64 < p_sys->i_pos ) return VLC_EGENERIC;
- i_skip = i64 - p_sys->i_pos;
-
- while( i_skip > 0 )
- {
- int i_read = DStreamRead( s, NULL, i_skip );
- if( i_read <= 0 ) return VLC_EGENERIC;
- i_skip -= i_read;
- }
- return VLC_SUCCESS;
- }
-
- case STREAM_GET_MTU:
- p_int = (int*) va_arg( args, int * );
- *p_int = 0;
- return VLC_SUCCESS;
-
- case STREAM_CONTROL_ACCESS:
- case STREAM_GET_CONTENT_TYPE:
- return VLC_EGENERIC;
-
- default:
- msg_Err( s, "invalid DStreamControl query=0x%x", i_query );
- return VLC_EGENERIC;
- }
-}
-
-static void* DStreamThread( vlc_object_t* p_this )
-{
- stream_t *s = (stream_t *)p_this;
- d_stream_sys_t *p_sys = (d_stream_sys_t*)s->p_sys;
- demux_t *p_demux;
-
- /* Create the demuxer */
- if( !(p_demux = demux_New( s, "", p_sys->psz_name, "", s, p_sys->out,
- false )) )
- {
- return NULL;
- }
-
- p_sys->p_demux = p_demux;
-
- /* Main loop */
- while( !s->b_die && !p_demux->b_die )
- {
- if( p_demux->pf_demux( p_demux ) <= 0 ) break;
- }
-
- vlc_object_kill( p_demux );
- return NULL;
-}
-
-/****************************************************************************
- * Utility functions
- ****************************************************************************/