Changeset 47fd5024be5edf4ef7f85d56482d17bc598766e3
- Timestamp:
- 28/09/08 02:08:39
(2 months ago)
- Author:
- Pierre d'Herbemont <pdherbemont@videolan.org>
- git-committer:
- Pierre d'Herbemont <pdherbemont@videolan.org> 1222560519 +0200
- git-parent:
[f5292e55aa88b99533607ff1c191f2285d5e0d29]
- git-author:
- Pierre d'Herbemont <pdherbemont@videolan.org> 1222560519 +0200
- Message:
Fix playlist_CurrentInput usage.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rc205ecf |
r47fd502 |
|
| 168 | 168 | |
|---|
| 169 | 169 | playlist_t *p_playlist = pl_Hold( ((vlc_object_t*) p_this) ); |
|---|
| 170 | | PL_LOCK; |
|---|
| 171 | 170 | input_thread_t *p_input = playlist_CurrentInput( p_playlist ); |
|---|
| 172 | 171 | |
|---|
| … | … | |
| 177 | 176 | var_Get( p_input, "time", &position ); |
|---|
| 178 | 177 | i_pos = position.i_time / 1000; |
|---|
| 179 | | } |
|---|
| 180 | | PL_UNLOCK; |
|---|
| | 178 | vlc_object_release( p_input ); |
|---|
| | 179 | } |
|---|
| 181 | 180 | pl_Release( ((vlc_object_t*) p_this) ); |
|---|
| 182 | 181 | ADD_INT32( &i_pos ); |
|---|
| … | … | |
| 207 | 206 | } |
|---|
| 208 | 207 | p_playlist = pl_Hold( ((vlc_object_t*) p_this) ); |
|---|
| 209 | | PL_LOCK; |
|---|
| 210 | 208 | input_thread_t *p_input = playlist_CurrentInput( p_playlist ); |
|---|
| 211 | 209 | |
|---|
| … | … | |
| 214 | 212 | position.i_time = i_pos * 1000; |
|---|
| 215 | 213 | var_Set( p_input, "time", position ); |
|---|
| 216 | | } |
|---|
| 217 | | PL_UNLOCK; |
|---|
| | 214 | vlc_object_release( p_input ); |
|---|
| | 215 | } |
|---|
| 218 | 216 | pl_Release( ((vlc_object_t*) p_this) ); |
|---|
| 219 | 217 | REPLY_SEND; |
|---|
| … | … | |
| 320 | 318 | playlist_t *p_playlist = pl_Hold( (vlc_object_t*) p_this ); |
|---|
| 321 | 319 | |
|---|
| 322 | | PL_LOCK; |
|---|
| 323 | 320 | input_thread_t *p_input = playlist_CurrentInput( p_playlist ); |
|---|
| 324 | | if( p_input ) |
|---|
| 325 | | vlc_object_hold( p_input ); |
|---|
| 326 | | PL_UNLOCK; |
|---|
| 327 | 321 | |
|---|
| 328 | 322 | if( p_input ) |
|---|
| … | … | |
| 797 | 791 | input_thread_t *p_input; |
|---|
| 798 | 792 | |
|---|
| 799 | | PL_LOCK; |
|---|
| 800 | 793 | var_DelCallback( p_playlist, "playlist-current", TrackChange, p_intf ); |
|---|
| 801 | 794 | var_DelCallback( p_playlist, "intf-change", TrackListChangeEmit, p_intf ); |
|---|
| … | … | |
| 809 | 802 | if ( p_input ) |
|---|
| 810 | 803 | { |
|---|
| 811 | | vlc_object_hold( p_input ); |
|---|
| 812 | 804 | var_DelCallback( p_input, "state", StateChange, p_intf ); |
|---|
| 813 | 805 | vlc_object_release( p_input ); |
|---|
| 814 | 806 | } |
|---|
| 815 | 807 | |
|---|
| 816 | | PL_UNLOCK; |
|---|
| 817 | 808 | pl_Release( p_intf ); |
|---|
| 818 | 809 | |
|---|
| … | … | |
| 1000 | 991 | p_playlist = pl_Hold( p_intf ); |
|---|
| 1001 | 992 | p_input = playlist_CurrentInput( p_playlist ); |
|---|
| 1002 | | |
|---|
| 1003 | 993 | if( !p_input ) |
|---|
| 1004 | 994 | { |
|---|
| 1005 | | PL_UNLOCK; |
|---|
| 1006 | 995 | pl_Release( p_intf ); |
|---|
| 1007 | 996 | return VLC_SUCCESS; |
|---|
| 1008 | 997 | } |
|---|
| 1009 | 998 | |
|---|
| 1010 | | vlc_object_hold( p_input ); |
|---|
| 1011 | 999 | pl_Release( p_intf ); |
|---|
| 1012 | 1000 | |
|---|
| … | … | |
| 1042 | 1030 | if( p_playlist->current.i_size > 0 ) |
|---|
| 1043 | 1031 | i_caps |= CAPS_CAN_PLAY | CAPS_CAN_GO_PREV | CAPS_CAN_GO_NEXT; |
|---|
| 1044 | | |
|---|
| | 1032 | if( !b_playlist_locked ) PL_UNLOCK; |
|---|
| | 1033 | |
|---|
| 1045 | 1034 | input_thread_t* p_input = playlist_CurrentInput( p_playlist ); |
|---|
| 1046 | 1035 | if( p_input ) |
|---|
| … | … | |
| 1052 | 1041 | if( var_GetBool( p_input, "seekable" ) ) |
|---|
| 1053 | 1042 | i_caps |= CAPS_CAN_SEEK; |
|---|
| 1054 | | } |
|---|
| 1055 | | |
|---|
| 1056 | | if( !b_playlist_locked ) PL_UNLOCK; |
|---|
| | 1043 | vlc_object_release( p_input ); |
|---|
| | 1044 | } |
|---|
| | 1045 | |
|---|
| 1057 | 1046 | pl_Release( p_intf ); |
|---|
| 1058 | 1047 | |
|---|
| … | … | |
| 1164 | 1153 | |
|---|
| 1165 | 1154 | p_playlist = pl_Hold( p_intf ); |
|---|
| 1166 | | if( lock ) |
|---|
| 1167 | | PL_LOCK; |
|---|
| 1168 | 1155 | |
|---|
| 1169 | 1156 | i_state = 2; |
|---|
| … | … | |
| 1179 | 1166 | else if( val.i_int <= PLAYING_S ) |
|---|
| 1180 | 1167 | i_state = 0; |
|---|
| | 1168 | vlc_object_release( p_input ); |
|---|
| 1181 | 1169 | } |
|---|
| 1182 | 1170 | |
|---|
| … | … | |
| 1187 | 1175 | i_loop = var_CreateGetBool( p_playlist, "loop" ); |
|---|
| 1188 | 1176 | |
|---|
| 1189 | | if( lock ) |
|---|
| 1190 | | PL_UNLOCK; |
|---|
| 1191 | 1177 | pl_Release( p_intf ); |
|---|
| 1192 | 1178 | |
|---|
| rf5292e5 |
r47fd502 |
|
| 331 | 331 | getIntf()->p_sys->p_input = |
|---|
| 332 | 332 | playlist_CurrentInput( getIntf()->p_sys->p_playlist ); |
|---|
| 333 | | if( getIntf()->p_sys->p_input ) |
|---|
| 334 | | vlc_object_hold( getIntf()->p_sys->p_input ); |
|---|
| 335 | 333 | } |
|---|
| 336 | 334 | else if( getIntf()->p_sys->p_input->b_dead ) |
|---|
| … | … | |
| 562 | 560 | void VlcProc::updateStreamName( playlist_t *p_playlist ) |
|---|
| 563 | 561 | { |
|---|
| 564 | | if( p_playlist && playlist_CurrentInput( p_playlist )) |
|---|
| 565 | | { |
|---|
| | 562 | if( p_playlist ) |
|---|
| | 563 | { |
|---|
| | 564 | input_thread_t * p_input = playlist_CurrentInput( p_playlist ) |
|---|
| 566 | 565 | // Get playlist item information |
|---|
| 567 | | input_item_t *pItem = input_GetItem(playlist_CurrentInput( p_playlist)); |
|---|
| | 566 | input_item_t *pItem = input_GetItem( p_input ); |
|---|
| 568 | 567 | |
|---|
| 569 | 568 | VarText &rStreamName = getStreamNameVar(); |
|---|
| … | … | |
| 590 | 589 | pQueue->push( CmdGenericPtr( pCmd1 ), false ); |
|---|
| 591 | 590 | pQueue->push( CmdGenericPtr( pCmd2 ), false ); |
|---|
| | 591 | vlc_object_release( p_input ); |
|---|
| 592 | 592 | } |
|---|
| 593 | 593 | } |
|---|
| rc205ecf |
r47fd502 |
|
| 151 | 151 | |
|---|
| 152 | 152 | if( !p_input ) return VLC_SUCCESS; |
|---|
| 153 | | vlc_object_hold( p_input ); |
|---|
| 154 | 153 | |
|---|
| 155 | 154 | if( p_input->b_dead ) |
|---|
| rc205ecf |
r47fd502 |
|
| 140 | 140 | input_thread_t *p_input = NULL; |
|---|
| 141 | 141 | |
|---|
| 142 | | PL_LOCK; |
|---|
| 143 | 142 | var_DelCallback( p_playlist, "item-change", ItemChange, p_intf ); |
|---|
| 144 | 143 | var_DelCallback( p_playlist, "playlist-current", ItemChange, p_intf ); |
|---|
| 145 | 144 | if( (p_input = playlist_CurrentInput( p_playlist )) ) |
|---|
| | 145 | { |
|---|
| 146 | 146 | var_DelCallback( p_input, "state", StateChange, p_intf ); |
|---|
| 147 | | PL_UNLOCK; |
|---|
| | 147 | vlc_object_release( p_input ); |
|---|
| | 148 | } |
|---|
| 148 | 149 | pl_Release( p_this ); |
|---|
| 149 | 150 | |
|---|
| … | … | |
| 195 | 196 | |
|---|
| 196 | 197 | if( !p_input ) return VLC_SUCCESS; |
|---|
| 197 | | vlc_object_hold( p_input ); |
|---|
| 198 | 198 | |
|---|
| 199 | 199 | if( p_input->b_dead || !input_GetItem(p_input)->psz_name ) |
|---|
| rc205ecf |
r47fd502 |
|
| 1935 | 1935 | { |
|---|
| 1936 | 1936 | var_AddCallback( p_input, "state", StateCallback, p_filter ); |
|---|
| 1937 | | } |
|---|
| 1938 | | vlc_object_release( p_playlist ); |
|---|
| | 1937 | vlc_object_release( p_input ); |
|---|
| | 1938 | } |
|---|
| | 1939 | pl_Release( p_filter ); |
|---|
| 1939 | 1940 | } |
|---|
| 1940 | 1941 | |
|---|
| … | … | |
| 1953 | 1954 | { |
|---|
| 1954 | 1955 | var_DelCallback( p_input, "state", StateCallback, p_filter ); |
|---|
| 1955 | | } |
|---|
| 1956 | | vlc_object_release( p_playlist ); |
|---|
| | 1956 | vlc_object_release( p_input ); |
|---|
| | 1957 | } |
|---|
| | 1958 | pl_Release( p_filter ); |
|---|
| 1957 | 1959 | } |
|---|
| 1958 | 1960 | |
|---|