Changeset 1c94ebe4d604b51644f9a129c3aa40f81ed6a97b
- Timestamp:
- 21/07/08 18:36:50
(4 months ago)
- Author:
- Rémi Duraffort <ivoire@videolan.org>
- git-committer:
- Rémi Duraffort <ivoire@videolan.org> 1216658210 +0200
- git-parent:
[64868251fe44f3659459c254df6928f170d15b89]
- git-author:
- Rémi Duraffort <ivoire@videolan.org> 1216657524 +0200
- Message:
Use pl_Release an factorise two lines.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r95addd5 |
r1c94ebe |
|
| 52 | 52 | input_thread_t *p_input = p_playlist->p_input; |
|---|
| 53 | 53 | if( p_input ) vlc_object_yield( p_input ); |
|---|
| 54 | | vlc_object_release( p_playlist ); |
|---|
| | 54 | pl_Release( p_playlist ); |
|---|
| 55 | 55 | return p_input; |
|---|
| 56 | 56 | } |
|---|
| ra518149 |
r1c94ebe |
|
| 59 | 59 | playlist_t *p_playlist = vlclua_get_playlist_internal( L ); |
|---|
| 60 | 60 | playlist_Prev( p_playlist ); |
|---|
| 61 | | vlc_object_release( p_playlist ); |
|---|
| | 61 | pl_Release( p_playlist ); |
|---|
| 62 | 62 | return 0; |
|---|
| 63 | 63 | } |
|---|
| … | … | |
| 67 | 67 | playlist_t *p_playlist = vlclua_get_playlist_internal( L ); |
|---|
| 68 | 68 | playlist_Next( p_playlist ); |
|---|
| 69 | | vlc_object_release( p_playlist ); |
|---|
| | 69 | pl_Release( p_playlist ); |
|---|
| 70 | 70 | return 0; |
|---|
| 71 | 71 | } |
|---|
| … | … | |
| 76 | 76 | playlist_t *p_playlist = vlclua_get_playlist_internal( L ); |
|---|
| 77 | 77 | playlist_Skip( p_playlist, i_skip ); |
|---|
| 78 | | vlc_object_release( p_playlist ); |
|---|
| | 78 | pl_Release( p_playlist ); |
|---|
| 79 | 79 | return 0; |
|---|
| 80 | 80 | } |
|---|
| … | … | |
| 84 | 84 | playlist_t *p_playlist = vlclua_get_playlist_internal( L ); |
|---|
| 85 | 85 | playlist_Play( p_playlist ); |
|---|
| 86 | | vlc_object_release( p_playlist ); |
|---|
| | 86 | pl_Release( p_playlist ); |
|---|
| 87 | 87 | return 0; |
|---|
| 88 | 88 | } |
|---|
| … | … | |
| 92 | 92 | playlist_t *p_playlist = vlclua_get_playlist_internal( L ); |
|---|
| 93 | 93 | playlist_Pause( p_playlist ); |
|---|
| 94 | | vlc_object_release( p_playlist ); |
|---|
| | 94 | pl_Release( p_playlist ); |
|---|
| 95 | 95 | return 0; |
|---|
| 96 | 96 | } |
|---|
| … | … | |
| 100 | 100 | playlist_t *p_playlist = vlclua_get_playlist_internal( L ); |
|---|
| 101 | 101 | playlist_Stop( p_playlist ); |
|---|
| 102 | | vlc_object_release( p_playlist ); |
|---|
| | 102 | pl_Release( p_playlist ); |
|---|
| 103 | 103 | return 0; |
|---|
| 104 | 104 | } |
|---|
| … | … | |
| 109 | 109 | playlist_Stop( p_playlist ); /* Isn't this already implied by Clear? */ |
|---|
| 110 | 110 | playlist_Clear( p_playlist, pl_Unlocked ); |
|---|
| 111 | | vlc_object_release( p_playlist ); |
|---|
| | 111 | pl_Release( p_playlist ); |
|---|
| 112 | 112 | return 0; |
|---|
| 113 | 113 | } |
|---|
| … | … | |
| 117 | 117 | playlist_t *p_playlist = vlclua_get_playlist_internal( L ); |
|---|
| 118 | 118 | int i_ret = vlclua_var_toggle_or_set( L, p_playlist, "repeat" ); |
|---|
| 119 | | vlc_object_release( p_playlist ); |
|---|
| | 119 | pl_Release( p_playlist ); |
|---|
| 120 | 120 | return i_ret; |
|---|
| 121 | 121 | } |
|---|
| … | … | |
| 125 | 125 | playlist_t *p_playlist = vlclua_get_playlist_internal( L ); |
|---|
| 126 | 126 | int i_ret = vlclua_var_toggle_or_set( L, p_playlist, "loop" ); |
|---|
| 127 | | vlc_object_release( p_playlist ); |
|---|
| | 127 | pl_Release( p_playlist ); |
|---|
| 128 | 128 | return i_ret; |
|---|
| 129 | 129 | } |
|---|
| … | … | |
| 133 | 133 | playlist_t *p_playlist = vlclua_get_playlist_internal( L ); |
|---|
| 134 | 134 | int i_ret = vlclua_var_toggle_or_set( L, p_playlist, "random" ); |
|---|
| 135 | | vlc_object_release( p_playlist ); |
|---|
| | 135 | pl_Release( p_playlist ); |
|---|
| 136 | 136 | return i_ret; |
|---|
| 137 | 137 | } |
|---|
| … | … | |
| 145 | 145 | playlist_ItemGetById( p_playlist, i_id, |
|---|
| 146 | 146 | true ) ); |
|---|
| 147 | | vlc_object_release( p_playlist ); |
|---|
| | 147 | pl_Release( p_playlist ); |
|---|
| 148 | 148 | return vlclua_push_ret( L, i_ret ); |
|---|
| 149 | 149 | } |
|---|
| … | … | |
| 156 | 156 | i_count = vlclua_playlist_add_internal( p_this, L, p_playlist, |
|---|
| 157 | 157 | NULL, true ); |
|---|
| 158 | | vlc_object_release( p_playlist ); |
|---|
| | 158 | pl_Release( p_playlist ); |
|---|
| 159 | 159 | lua_pushinteger( L, i_count ); |
|---|
| 160 | 160 | return 1; |
|---|
| … | … | |
| 168 | 168 | i_count = vlclua_playlist_add_internal( p_this, L, p_playlist, |
|---|
| 169 | 169 | NULL, false ); |
|---|
| 170 | | vlc_object_release( p_playlist ); |
|---|
| | 170 | pl_Release( p_playlist ); |
|---|
| 171 | 171 | lua_pushinteger( L, i_count ); |
|---|
| 172 | 172 | return 1; |
|---|
| … | … | |
| 236 | 236 | if( !p_item ) |
|---|
| 237 | 237 | { |
|---|
| 238 | | vlc_object_release( p_playlist ); |
|---|
| | 238 | pl_Release( p_playlist ); |
|---|
| 239 | 239 | return 0; /* Should we return an error instead? */ |
|---|
| 240 | 240 | } |
|---|
| … | … | |
| 269 | 269 | if( !p_item ) |
|---|
| 270 | 270 | { |
|---|
| 271 | | vlc_object_release( p_playlist ); |
|---|
| | 271 | pl_Release( p_playlist ); |
|---|
| 272 | 272 | return 0; /* Should we return an error instead? */ |
|---|
| 273 | 273 | } |
|---|
| … | … | |
| 280 | 280 | } |
|---|
| 281 | 281 | push_playlist_item( L, p_item ); |
|---|
| 282 | | vlc_object_release( p_playlist ); |
|---|
| | 282 | pl_Release( p_playlist ); |
|---|
| 283 | 283 | return 1; |
|---|
| 284 | 284 | } |
|---|
| … | … | |
| 293 | 293 | playlist_LiveSearchUpdate( p_playlist, p_item, psz_string ); |
|---|
| 294 | 294 | push_playlist_item( L, p_item ); |
|---|
| 295 | | vlc_object_release( p_playlist ); |
|---|
| | 295 | pl_Release( p_playlist ); |
|---|
| 296 | 296 | return 1; |
|---|
| 297 | 297 | } |
|---|
| … | … | |
| 301 | 301 | playlist_t *p_playlist = vlclua_get_playlist_internal( L ); |
|---|
| 302 | 302 | lua_pushinteger( L, var_GetInteger( p_playlist, "playlist-current" ) ); |
|---|
| 303 | | vlc_object_release( p_playlist ); |
|---|
| | 303 | pl_Release( p_playlist ); |
|---|
| 304 | 304 | return 1; |
|---|
| 305 | 305 | } |
|---|
| … | … | |
| 344 | 344 | int i_ret = playlist_RecursiveNodeSort( p_playlist, p_root, i_mode, |
|---|
| 345 | 345 | i_type ); |
|---|
| 346 | | vlc_object_release( p_playlist ); |
|---|
| | 346 | pl_Release( p_playlist ); |
|---|
| 347 | 347 | return vlclua_push_ret( L, i_ret ); |
|---|
| 348 | 348 | } |
|---|
| … | … | |
| 386 | 386 | lua_pushstring( L, "stopped" ); |
|---|
| 387 | 387 | } |
|---|
| 388 | | vlc_object_release( p_playlist ); |
|---|
| | 388 | pl_Release( p_playlist ); |
|---|
| 389 | 389 | return 1; |
|---|
| 390 | 390 | } |
|---|
| r95addd5 |
r1c94ebe |
|
| 77 | 77 | playlist_t *p_playlist = vlclua_get_playlist_internal( L ); |
|---|
| 78 | 78 | int i_ret = playlist_ServicesDiscoveryAdd( p_playlist, psz_sd ); |
|---|
| 79 | | vlc_object_release( p_playlist ); |
|---|
| | 79 | pl_Release( p_playlist ); |
|---|
| 80 | 80 | return vlclua_push_ret( L, i_ret ); |
|---|
| 81 | 81 | } |
|---|
| … | … | |
| 86 | 86 | playlist_t *p_playlist = vlclua_get_playlist_internal( L ); |
|---|
| 87 | 87 | int i_ret = playlist_ServicesDiscoveryRemove( p_playlist, psz_sd ); |
|---|
| 88 | | vlc_object_release( p_playlist ); |
|---|
| | 88 | pl_Release( p_playlist ); |
|---|
| 89 | 89 | return vlclua_push_ret( L, i_ret ); |
|---|
| 90 | 90 | } |
|---|
| … | … | |
| 95 | 95 | playlist_t *p_playlist = vlclua_get_playlist_internal( L ); |
|---|
| 96 | 96 | lua_pushboolean( L, playlist_IsServicesDiscoveryLoaded( p_playlist, psz_sd )); |
|---|
| 97 | | vlc_object_release( p_playlist ); |
|---|
| | 97 | pl_Release( p_playlist ); |
|---|
| 98 | 98 | return 1; |
|---|
| 99 | 99 | } |
|---|
| r3561b9b |
r1c94ebe |
|
| 163 | 163 | |
|---|
| 164 | 164 | p_input = p_playlist->p_input; |
|---|
| 165 | | vlc_object_release( p_playlist ); |
|---|
| | 165 | pl_Release( p_playlist ); |
|---|
| 166 | 166 | |
|---|
| 167 | 167 | if( !p_input ) return VLC_SUCCESS; |
|---|
| r3561b9b |
r1c94ebe |
|
| 125 | 125 | |
|---|
| 126 | 126 | p_input = p_playlist->p_input; |
|---|
| 127 | | vlc_object_release( p_playlist ); |
|---|
| | 127 | pl_Release( p_playlist ); |
|---|
| 128 | 128 | |
|---|
| 129 | 129 | if( !p_input ) return VLC_SUCCESS; |
|---|
| r00b9584 |
r1c94ebe |
|
| 221 | 221 | if( playlist_IsEmpty( p_playlist ) ) |
|---|
| 222 | 222 | { |
|---|
| 223 | | vlc_object_release( p_playlist ); |
|---|
| | 223 | pl_Release( p_playlist ); |
|---|
| 224 | 224 | continue; |
|---|
| 225 | 225 | } |
|---|
| … | … | |
| 229 | 229 | { |
|---|
| 230 | 230 | psz_display = strdup(_("Stop")); |
|---|
| 231 | | vlc_object_release( p_playlist ); |
|---|
| | 231 | pl_Release( p_playlist ); |
|---|
| 232 | 232 | } |
|---|
| 233 | 233 | else if( p_playlist->status.i_status == PLAYLIST_PAUSED ) |
|---|
| 234 | 234 | { |
|---|
| 235 | 235 | psz_display = strdup(_("Pause")); |
|---|
| 236 | | vlc_object_release( p_playlist ); |
|---|
| | 236 | pl_Release( p_playlist ); |
|---|
| 237 | 237 | } |
|---|
| 238 | 238 | else |
|---|
| … | … | |
| 240 | 240 | p_item = p_playlist->status.p_item; |
|---|
| 241 | 241 | p_input = p_item->p_input; |
|---|
| | 242 | |
|---|
| | 243 | pl_Release( p_playlist ); |
|---|
| 242 | 244 | if( !p_item ) |
|---|
| 243 | | { |
|---|
| 244 | | vlc_object_release( p_playlist ); |
|---|
| 245 | 245 | continue; |
|---|
| 246 | | } |
|---|
| 247 | | |
|---|
| 248 | | vlc_object_release( p_playlist ); |
|---|
| 249 | 246 | |
|---|
| 250 | 247 | mtime_t i_duration = input_item_GetDuration( p_input ); |
|---|