Changeset 5d0cd08833ac4ab692b2091f7e2b67c362f0268f
- Timestamp:
- 03/10/04 13:02:58
(4 years ago)
- Author:
- Laurent Aimar <fenrir@videolan.org>
- git-committer:
- Laurent Aimar <fenrir@videolan.org> 1078920178 +0000
- git-parent:
[4c29602d3802b5d72143b5093036a4e347b8c96a]
- git-author:
- Laurent Aimar <fenrir@videolan.org> 1078920178 +0000
- Message:
- include/input_ext-plugins.h: exported input_RunDecoder/input_EndDecoder.
- modules/stream_out/display.c: use input_RunDecoder/input_EndDecoder
(fixed dead lock and no more duplicated stream in audio/video menu).
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rf3f4117 |
r5d0cd08 |
|
| 4 | 4 | ***************************************************************************** |
|---|
| 5 | 5 | * Copyright (C) 1999-2002 VideoLAN |
|---|
| 6 | | * $Id: input_ext-plugins.h,v 1.47 2004/01/26 20:48:09 fenrir Exp $ |
|---|
| | 6 | * $Id$ |
|---|
| 7 | 7 | * |
|---|
| 8 | 8 | * Authors: Christophe Massiot <massiot@via.ecp.fr> |
|---|
| … | … | |
| 56 | 56 | * Prototypes from input_dec.c |
|---|
| 57 | 57 | *****************************************************************************/ |
|---|
| 58 | | decoder_t * input_RunDecoder( input_thread_t *, es_descriptor_t * ); |
|---|
| 59 | | void input_EndDecoder( input_thread_t *, es_descriptor_t * ); |
|---|
| | 58 | VLC_EXPORT( decoder_t *, input_RunDecoder, ( input_thread_t *, es_descriptor_t * ) ); |
|---|
| | 59 | VLC_EXPORT( void, input_EndDecoder, ( input_thread_t *, es_descriptor_t * ) ); |
|---|
| 60 | 60 | |
|---|
| 61 | 61 | VLC_EXPORT( void, input_DecodePES, ( decoder_t *, pes_packet_t * ) ); |
|---|
| r70b1f9b |
r5d0cd08 |
|
| 143 | 143 | id = malloc( sizeof( sout_stream_id_t ) ); |
|---|
| 144 | 144 | |
|---|
| 145 | | vlc_mutex_lock( &p_sys->p_input->stream.stream_lock ); |
|---|
| 146 | | id->p_es = input_AddES( p_sys->p_input, |
|---|
| 147 | | NULL, /* no program */ |
|---|
| 148 | | 12, /* es_id */ |
|---|
| 149 | | p_fmt->i_cat, /* es category */ |
|---|
| 150 | | NULL, /* description */ |
|---|
| 151 | | 0 ); /* no extra data */ |
|---|
| 152 | | |
|---|
| 153 | | if( !id->p_es ) |
|---|
| 154 | | { |
|---|
| 155 | | vlc_mutex_unlock( &p_sys->p_input->stream.stream_lock ); |
|---|
| 156 | | |
|---|
| 157 | | msg_Err( p_stream, "cannot create es" ); |
|---|
| | 145 | id->p_es = malloc( sizeof( es_descriptor_t ) ); |
|---|
| | 146 | memset( id->p_es, 0, sizeof( es_descriptor_t ) ); |
|---|
| | 147 | id->p_es->i_cat = p_fmt->i_cat; |
|---|
| | 148 | id->p_es->i_fourcc = p_fmt->i_codec; |
|---|
| | 149 | id->p_es->b_force_decoder = VLC_TRUE; |
|---|
| | 150 | es_format_Copy( &id->p_es->fmt, p_fmt ); |
|---|
| | 151 | |
|---|
| | 152 | id->p_es->p_dec = input_RunDecoder( p_sys->p_input, id->p_es ); |
|---|
| | 153 | if( id->p_es->p_dec == NULL ) |
|---|
| | 154 | { |
|---|
| | 155 | msg_Err( p_stream, "cannot create decoder for fcc=`%4.4s'", |
|---|
| | 156 | (char*)&p_fmt->i_codec ); |
|---|
| | 157 | free( id->p_es ); |
|---|
| 158 | 158 | free( id ); |
|---|
| 159 | 159 | return NULL; |
|---|
| 160 | 160 | } |
|---|
| 161 | | id->p_es->i_stream_id = 1; |
|---|
| 162 | | id->p_es->i_fourcc = p_fmt->i_codec; |
|---|
| 163 | | id->p_es->b_force_decoder = VLC_TRUE; |
|---|
| 164 | | |
|---|
| 165 | | es_format_Copy( &id->p_es->fmt, p_fmt ); |
|---|
| 166 | | |
|---|
| 167 | | if( input_SelectES( p_sys->p_input, id->p_es ) ) |
|---|
| 168 | | { |
|---|
| 169 | | input_DelES( p_sys->p_input, id->p_es ); |
|---|
| 170 | | vlc_mutex_unlock( &p_sys->p_input->stream.stream_lock ); |
|---|
| 171 | | |
|---|
| 172 | | msg_Err( p_stream, "cannot select es" ); |
|---|
| 173 | | free( id ); |
|---|
| 174 | | return NULL; |
|---|
| 175 | | } |
|---|
| 176 | | vlc_mutex_unlock( &p_sys->p_input->stream.stream_lock ); |
|---|
| 177 | 161 | |
|---|
| 178 | 162 | return id; |
|---|
| … | … | |
| 183 | 167 | sout_stream_sys_t *p_sys = p_stream->p_sys; |
|---|
| 184 | 168 | |
|---|
| 185 | | input_DelES( p_sys->p_input, id->p_es ); |
|---|
| 186 | | |
|---|
| | 169 | input_EndDecoder( p_sys->p_input, id->p_es ); |
|---|
| | 170 | |
|---|
| | 171 | free( id->p_es ); |
|---|
| 187 | 172 | free( id ); |
|---|
| 188 | 173 | |
|---|
| … | … | |
| 200 | 185 | block_t *p_block; |
|---|
| 201 | 186 | |
|---|
| 202 | | vlc_mutex_lock( &p_sys->p_input->stream.stream_lock ); |
|---|
| 203 | 187 | if( id->p_es->p_dec && p_buffer->i_size > 0 && |
|---|
| 204 | 188 | (p_block = block_New( p_stream, p_buffer->i_size )) ) |
|---|
| … | … | |
| 214 | 198 | input_DecodeBlock( id->p_es->p_dec, p_block ); |
|---|
| 215 | 199 | } |
|---|
| 216 | | vlc_mutex_unlock( &p_sys->p_input->stream.stream_lock ); |
|---|
| 217 | 200 | |
|---|
| 218 | 201 | /* *** go to next buffer *** */ |
|---|