X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Finput%2Fdemux.c;h=712bfd2276ef87173b2c08acfd0da14ad32be87c;hb=528f0214d6cd1acfcf915f7f6f001a30622903b4;hp=8a3173411ed73fe95e4e4f2f737d5046ecd27db8;hpb=9b6b0df36a16b1ca7706e138f6c491e12e5eecfa;p=vlc diff --git a/src/input/demux.c b/src/input/demux.c index 8a3173411e..712bfd2276 100644 --- a/src/input/demux.c +++ b/src/input/demux.c @@ -21,7 +21,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ -#include #include #include "input_internal.h" @@ -51,7 +50,9 @@ demux_t *__demux2_New( vlc_object_t *p_obj, if( *p_demux->psz_demux == '\0' ) { free( p_demux->psz_demux ); - p_demux->psz_demux = var_GetString( p_obj, "demux" ); + p_demux->psz_demux = var_GetNonEmptyString( p_obj, "demux" ); + if( p_demux->psz_demux == NULL ) + p_demux->psz_demux = strdup( "" ); } if( !b_quick ) @@ -269,6 +270,7 @@ int demux2_vaControlHelper( stream_t *s, case DEMUX_SET_NEXT_DEMUX_TIME: case DEMUX_GET_TITLE_INFO: case DEMUX_SET_GROUP: + case DEMUX_GET_ATTACHMENTS: return VLC_EGENERIC; default: @@ -296,7 +298,7 @@ typedef struct } d_stream_sys_t; static int DStreamRead ( stream_t *, void *p_read, int i_read ); -static int DStreamPeek ( stream_t *, uint8_t **pp_peek, int i_peek ); +static int DStreamPeek ( stream_t *, const uint8_t **pp_peek, int i_peek ); static int DStreamControl( stream_t *, int i_query, va_list ); static int DStreamThread ( stream_t * ); @@ -311,7 +313,6 @@ stream_t *__stream_DemuxNew( vlc_object_t *p_obj, const char *psz_demux, if( psz_demux == NULL || *psz_demux == '\0' ) return NULL; s = vlc_stream_create( p_obj ); - s->pf_block = NULL; s->pf_read = DStreamRead; s->pf_peek = DStreamPeek; s->pf_control= DStreamControl; @@ -359,8 +360,9 @@ void stream_DemuxDelete( stream_t *s ) d_stream_sys_t *p_sys = (d_stream_sys_t*)s->p_sys; block_t *p_empty; - s->b_die = VLC_TRUE; - if( p_sys->p_demux ) p_sys->p_demux->b_die = VLC_TRUE; + vlc_object_kill( s ); + if( p_sys->p_demux ) + vlc_object_kill( p_sys->p_demux ); p_empty = block_New( s, 1 ); p_empty->i_buffer = 0; block_FifoPut( p_sys->p_fifo, p_empty ); vlc_thread_join( s ); @@ -417,7 +419,7 @@ static int DStreamRead( stream_t *s, void *p_read, int i_read ) return i_out; } -static int DStreamPeek( stream_t *s, uint8_t **pp_peek, int i_peek ) +static int DStreamPeek( stream_t *s, const uint8_t **pp_peek, int i_peek ) { d_stream_sys_t *p_sys = (d_stream_sys_t*)s->p_sys; block_t **pp_block = &p_sys->p_block; @@ -534,7 +536,7 @@ static int DStreamThread( stream_t *s ) if( p_demux->pf_demux( p_demux ) <= 0 ) break; } - p_demux->b_die = VLC_TRUE; + vlc_object_kill( p_demux ); return VLC_SUCCESS; } @@ -543,7 +545,7 @@ static int DStreamThread( stream_t *s ) ****************************************************************************/ static void SkipID3Tag( demux_t *p_demux ) { - uint8_t *p_peek; + const uint8_t *p_peek; uint8_t version, revision; int i_size; int b_footer;