mirror of
https://github.com/videolan/vlc.git
synced 2024-12-04 23:35:52 +08:00
Removed useless stream_DemuxDelete.
Use stream_Delete instead.
This commit is contained in:
parent
2b3f7c579b
commit
02dc7efea8
@ -156,14 +156,26 @@ static inline char *stream_ContentType( stream_t *s )
|
||||
|
||||
/**
|
||||
* Create a special stream and a demuxer, this allows chaining demuxers
|
||||
* You must delete it using stream_Delete.
|
||||
*/
|
||||
#define stream_DemuxNew( a, b, c ) __stream_DemuxNew( VLC_OBJECT(a), b, c)
|
||||
VLC_EXPORT( stream_t *,__stream_DemuxNew, ( vlc_object_t *p_obj, const char *psz_demux, es_out_t *out ) );
|
||||
/**
|
||||
* Send data to a stream_t handle created by stream_DemuxNew.
|
||||
*/
|
||||
VLC_EXPORT( void, stream_DemuxSend, ( stream_t *s, block_t *p_block ) );
|
||||
VLC_EXPORT( void, stream_DemuxDelete,( stream_t *s ) );
|
||||
|
||||
/**
|
||||
* Create a stream_t reading from memory.
|
||||
* You must delete it using stream_Delete.
|
||||
*/
|
||||
#define stream_MemoryNew( a, b, c, d ) __stream_MemoryNew( VLC_OBJECT(a), b, c, d )
|
||||
VLC_EXPORT( stream_t *,__stream_MemoryNew, (vlc_object_t *p_obj, uint8_t *p_buffer, int64_t i_size, bool i_preserve_memory ) );
|
||||
VLC_EXPORT( stream_t *,__stream_MemoryNew, (vlc_object_t *p_obj, uint8_t *p_buffer, int64_t i_size, bool b_preserve_memory ) );
|
||||
|
||||
/**
|
||||
* Create a stream_t reading from an URL.
|
||||
* You must delete it using stream_Delete.
|
||||
*/
|
||||
#define stream_UrlNew( a, b ) __stream_UrlNew( VLC_OBJECT(a), b )
|
||||
VLC_EXPORT( stream_t *,__stream_UrlNew, (vlc_object_t *p_this, const char *psz_url ) );
|
||||
|
||||
|
@ -418,7 +418,7 @@ static void *stream_init (demux_t *demux, const char *name)
|
||||
static void stream_destroy (demux_t *demux, void *data)
|
||||
{
|
||||
if (data)
|
||||
stream_DemuxDelete ((stream_t *)data);
|
||||
stream_Delete ((stream_t *)data);
|
||||
(void)demux;
|
||||
}
|
||||
|
||||
|
@ -770,7 +770,7 @@ static void Close ( vlc_object_t * p_this )
|
||||
if( p_sys->track[i] )
|
||||
{
|
||||
if( p_sys->track[i]->p_out_muxed )
|
||||
stream_DemuxDelete( p_sys->track[i]->p_out_muxed );
|
||||
stream_Delete( p_sys->track[i]->p_out_muxed );
|
||||
free( p_sys->track[i]->p_index );
|
||||
free( p_sys->track[i]->p_extra );
|
||||
free( p_sys->track[i] );
|
||||
|
@ -232,7 +232,7 @@ static int Open (demux_t *demux, const char *path)
|
||||
VLC_THREAD_PRIORITY_INPUT) == 0)
|
||||
ret = VLC_SUCCESS;
|
||||
else
|
||||
stream_DemuxDelete (p_sys->out);
|
||||
stream_Delete (p_sys->out);
|
||||
}
|
||||
else
|
||||
msg_Err (demux, "Cannot create demux");
|
||||
@ -265,7 +265,7 @@ static void Close (vlc_object_t *obj)
|
||||
int status;
|
||||
|
||||
vlc_cancel (p_sys->thread);
|
||||
stream_DemuxDelete (p_sys->out);
|
||||
stream_Delete (p_sys->out);
|
||||
close (p_sys->read_fd);
|
||||
vlc_join (p_sys->thread, NULL);
|
||||
close (p_sys->write_fd);
|
||||
|
@ -398,14 +398,14 @@ error:
|
||||
{
|
||||
live_track_t *tk = p_sys->track[i];
|
||||
|
||||
if( tk->b_muxed ) stream_DemuxDelete( tk->p_out_muxed );
|
||||
if( tk->b_muxed ) stream_Delete( tk->p_out_muxed );
|
||||
es_format_Clean( &tk->fmt );
|
||||
free( tk->p_buffer );
|
||||
free( tk );
|
||||
}
|
||||
|
||||
if( p_sys->i_track ) free( p_sys->track );
|
||||
if( p_sys->p_out_asf ) stream_DemuxDelete( p_sys->p_out_asf );
|
||||
if( p_sys->p_out_asf ) stream_Delete( p_sys->p_out_asf );
|
||||
if( p_sys->rtsp && p_sys->ms ) p_sys->rtsp->teardownMediaSession( *p_sys->ms );
|
||||
if( p_sys->p_timeout )
|
||||
{
|
||||
@ -439,14 +439,14 @@ static void Close( vlc_object_t *p_this )
|
||||
{
|
||||
live_track_t *tk = p_sys->track[i];
|
||||
|
||||
if( tk->b_muxed ) stream_DemuxDelete( tk->p_out_muxed );
|
||||
if( tk->b_muxed ) stream_Delete( tk->p_out_muxed );
|
||||
es_format_Clean( &tk->fmt );
|
||||
free( tk->p_buffer );
|
||||
free( tk );
|
||||
}
|
||||
|
||||
if( p_sys->i_track ) free( p_sys->track );
|
||||
if( p_sys->p_out_asf ) stream_DemuxDelete( p_sys->p_out_asf );
|
||||
if( p_sys->p_out_asf ) stream_Delete( p_sys->p_out_asf );
|
||||
if( p_sys->rtsp && p_sys->ms ) p_sys->rtsp->teardownMediaSession( *p_sys->ms );
|
||||
if( p_sys->p_timeout )
|
||||
{
|
||||
@ -1457,14 +1457,14 @@ static int RollOverTcp( demux_t *p_demux )
|
||||
{
|
||||
live_track_t *tk = p_sys->track[i];
|
||||
|
||||
if( tk->b_muxed ) stream_DemuxDelete( tk->p_out_muxed );
|
||||
if( tk->b_muxed ) stream_Delete( tk->p_out_muxed );
|
||||
if( tk->p_es ) es_out_Del( p_demux->out, tk->p_es );
|
||||
es_format_Clean( &tk->fmt );
|
||||
free( tk->p_buffer );
|
||||
free( tk );
|
||||
}
|
||||
if( p_sys->i_track ) free( p_sys->track );
|
||||
if( p_sys->p_out_asf ) stream_DemuxDelete( p_sys->p_out_asf );
|
||||
if( p_sys->p_out_asf ) stream_Delete( p_sys->p_out_asf );
|
||||
|
||||
p_sys->rtsp->teardownMediaSession( *p_sys->ms );
|
||||
Medium::close( p_sys->ms );
|
||||
|
@ -312,9 +312,10 @@ typedef struct
|
||||
|
||||
} d_stream_sys_t;
|
||||
|
||||
static int DStreamRead ( stream_t *, void *p_read, unsigned int i_read );
|
||||
static int DStreamPeek ( stream_t *, const uint8_t **pp_peek, unsigned int i_peek );
|
||||
static int DStreamControl( stream_t *, int i_query, va_list );
|
||||
static int DStreamRead ( stream_t *, void *p_read, unsigned int i_read );
|
||||
static int DStreamPeek ( stream_t *, const uint8_t **pp_peek, unsigned int i_peek );
|
||||
static int DStreamControl( stream_t *, int i_query, va_list );
|
||||
static void DStreamDelete ( stream_t * );
|
||||
static void* DStreamThread ( vlc_object_t * );
|
||||
|
||||
|
||||
@ -331,6 +332,7 @@ stream_t *__stream_DemuxNew( vlc_object_t *p_obj, const char *psz_demux,
|
||||
s->pf_read = DStreamRead;
|
||||
s->pf_peek = DStreamPeek;
|
||||
s->pf_control= DStreamControl;
|
||||
s->pf_destroy= DStreamDelete;
|
||||
|
||||
s->p_sys = malloc( sizeof( d_stream_sys_t) );
|
||||
if( s->p_sys == NULL )
|
||||
@ -373,10 +375,7 @@ void stream_DemuxSend( stream_t *s, block_t *p_block )
|
||||
if( p_block ) block_FifoPut( p_sys->p_fifo, p_block );
|
||||
}
|
||||
|
||||
/* FIXME why is it needed ?
|
||||
* We may be able to use pf_destroy
|
||||
*/
|
||||
void stream_DemuxDelete( stream_t *s )
|
||||
static void DStreamDelete( stream_t *s )
|
||||
{
|
||||
d_stream_sys_t *p_sys = (d_stream_sys_t*)s->p_sys;
|
||||
block_t *p_empty;
|
||||
|
@ -365,7 +365,6 @@ __stats_Update
|
||||
stream_Block
|
||||
stream_Control
|
||||
stream_Delete
|
||||
stream_DemuxDelete
|
||||
__stream_DemuxNew
|
||||
stream_DemuxSend
|
||||
__stream_MemoryNew
|
||||
|
Loading…
Reference in New Issue
Block a user