Changeset 23942f1f36db6ab5ed4272da903c054336bed5ee
- Timestamp:
- 06/25/07 20:06:52
(1 year ago)
- Author:
- Damien Fouilleul <damienf@videolan.org>
- git-committer:
- Damien Fouilleul <damienf@videolan.org> 1182794812 +0000
- git-parent:
[4f2cfd119c634d9e0564734ad1c5ae4e1bdd2420]
- git-author:
- Damien Fouilleul <damienf@videolan.org> 1182794812 +0000
- Message:
- libvlc APIs: bug fixing, and please note that exception argument is OPTIONAL (can be null), do not use exception to control API flow unless you created your own
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r34f8161 |
r23942f1 |
|
| 90 | 90 | static input_thread_t * get_input(libvlc_instance_t * p_instance) |
|---|
| 91 | 91 | { |
|---|
| 92 | | libvlc_exception_t p_e_unused; /* FIXME: error checking here */ |
|---|
| 93 | 92 | libvlc_media_instance_t * p_mi; |
|---|
| 94 | 93 | input_thread_t * p_input; |
|---|
| 95 | 94 | |
|---|
| 96 | | p_mi = libvlc_playlist_get_media_instance( p_instance, &p_e_unused ); |
|---|
| | 95 | p_mi = libvlc_playlist_get_media_instance( p_instance, NULL ); |
|---|
| 97 | 96 | |
|---|
| 98 | 97 | if( !p_mi ) |
|---|
| 99 | 98 | return NULL; |
|---|
| 100 | 99 | |
|---|
| 101 | | p_input = libvlc_get_input_thread( p_mi, &p_e_unused ); |
|---|
| 102 | | |
|---|
| 103 | | libvlc_media_instance_destroy( p_mi ); |
|---|
| | 100 | p_input = libvlc_get_input_thread( p_mi, NULL ); |
|---|
| | 101 | |
|---|
| | 102 | libvlc_media_instance_release( p_mi ); |
|---|
| 104 | 103 | |
|---|
| 105 | 104 | return p_input; |
|---|
| … | … | |
| 119 | 118 | struct libvlc_callback_entry_list_t *p_listitem; |
|---|
| 120 | 119 | input_thread_t * p_input = get_input( p_instance ); |
|---|
| | 120 | |
|---|
| | 121 | if( !p_input ) |
|---|
| | 122 | return; |
|---|
| 121 | 123 | |
|---|
| 122 | 124 | vlc_mutex_lock( &p_instance->instance_lock ); |
|---|
| r40fbcb7 |
r23942f1 |
|
| 139 | 139 | libvlc_media_instance_t * p_mi; |
|---|
| 140 | 140 | |
|---|
| | 141 | if( !p_input ) |
|---|
| | 142 | { |
|---|
| | 143 | libvlc_exception_raise( p_e, "invalid input thread" ); |
|---|
| | 144 | return NULL; |
|---|
| | 145 | } |
|---|
| | 146 | |
|---|
| 141 | 147 | p_mi = malloc( sizeof(libvlc_media_instance_t) ); |
|---|
| 142 | 148 | p_mi->p_md = libvlc_media_descriptor_new_from_input_item( |
|---|
| … | … | |
| 144 | 150 | p_input->p->input.p_item, p_e ); |
|---|
| 145 | 151 | |
|---|
| 146 | | if( libvlc_exception_raised( p_e ) ) |
|---|
| | 152 | if( !p_mi->p_md ) |
|---|
| 147 | 153 | { |
|---|
| 148 | 154 | free( p_mi ); |
|---|
| … | … | |
| 267 | 273 | p_input_thread = libvlc_get_input_thread( p_mi, p_e ); |
|---|
| 268 | 274 | |
|---|
| 269 | | if( libvlc_exception_raised( p_e ) ) |
|---|
| | 275 | if( !p_input_thread ) |
|---|
| 270 | 276 | return; |
|---|
| 271 | 277 | |
|---|
| … | … | |
| 301 | 307 | p_input_thread = libvlc_get_input_thread( p_mi, p_e ); |
|---|
| 302 | 308 | |
|---|
| 303 | | if( libvlc_exception_raised( p_e ) ) |
|---|
| | 309 | if( !p_input_thread ) |
|---|
| 304 | 310 | return; |
|---|
| 305 | 311 | |
|---|
| re131482 |
r23942f1 |
|
| 220 | 220 | |
|---|
| 221 | 221 | vlc_mutex_lock( &PL->object_lock ); |
|---|
| 222 | | p_mi = libvlc_media_instance_new_from_input_thread( |
|---|
| 223 | | p_instance, PL->p_input, p_e ); |
|---|
| | 222 | if( PL->p_input ) |
|---|
| | 223 | { |
|---|
| | 224 | p_mi = libvlc_media_instance_new_from_input_thread( |
|---|
| | 225 | p_instance, PL->p_input, p_e ); |
|---|
| | 226 | } |
|---|
| | 227 | else |
|---|
| | 228 | /* no active input */ |
|---|
| | 229 | p_mi = NULL; |
|---|
| | 230 | |
|---|
| 224 | 231 | vlc_mutex_unlock( &PL->object_lock ); |
|---|
| 225 | 232 | |
|---|
| 226 | 233 | return p_mi; |
|---|
| 227 | 234 | } |
|---|
| | 235 | |
|---|