Changeset f60a8c729f19447d9982c769a3cc95eef383d9c3
- Timestamp:
- 15/07/08 19:38:51
(4 months ago)
- Author:
- Pierre d'Herbemont <pdherbemont@videolan.org>
- git-committer:
- Pierre d'Herbemont <pdherbemont@videolan.org> 1216143531 +0200
- git-parent:
[9399329f8c097eb2356ee42d8896e0261283cc2f]
- git-author:
- Pierre d'Herbemont <pdherbemont@videolan.org> 1216143531 +0200
- Message:
services_discovery: Don't forget a PL_LOCK.
Spotted by 3af47f42e2ac5cfd6ab35bee5320788270a10a29 and ivoire.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r115d054 |
rf60a8c7 |
|
| 215 | 215 | const char * psz_cat = p_event->u.services_discovery_item_added.psz_category; |
|---|
| 216 | 216 | playlist_item_t *p_new_item, * p_parent = user_data; |
|---|
| 217 | | |
|---|
| 218 | | msg_Dbg( p_parent->p_playlist, "Adding %s in %s", |
|---|
| | 217 | playlist_t * p_playlist = p_parent->p_playlist; |
|---|
| | 218 | |
|---|
| | 219 | msg_Dbg( p_playlist, "Adding %s in %s", |
|---|
| 219 | 220 | p_input->psz_name ? p_input->psz_name : "(null)", |
|---|
| 220 | 221 | psz_cat ? psz_cat : "(null)" ); |
|---|
| 221 | 222 | |
|---|
| | 223 | PL_LOCK; |
|---|
| 222 | 224 | /* If p_parent is in root category (this is clearly a hack) and we have a cat */ |
|---|
| 223 | 225 | if( !EMPTY_STR(psz_cat) && |
|---|
| 224 | | p_parent->p_parent == p_parent->p_playlist->p_root_category ) |
|---|
| | 226 | p_parent->p_parent == p_playlist->p_root_category ) |
|---|
| 225 | 227 | { |
|---|
| 226 | 228 | /* */ |
|---|
| … | … | |
| 229 | 231 | if( !p_cat ) |
|---|
| 230 | 232 | { |
|---|
| 231 | | p_cat = playlist_NodeCreate( p_parent->p_playlist, psz_cat, |
|---|
| | 233 | p_cat = playlist_NodeCreate( p_playlist, psz_cat, |
|---|
| 232 | 234 | p_parent, 0, NULL ); |
|---|
| 233 | 235 | p_cat->i_flags &= ~PLAYLIST_SKIP_FLAG; |
|---|
| … | … | |
| 236 | 238 | } |
|---|
| 237 | 239 | |
|---|
| 238 | | p_new_item = playlist_NodeAddInput( p_parent->p_playlist, p_input, p_parent, |
|---|
| 239 | | PLAYLIST_APPEND, PLAYLIST_END, false ); |
|---|
| | 240 | p_new_item = playlist_NodeAddInput( p_playlist, p_input, p_parent, |
|---|
| | 241 | PLAYLIST_APPEND, PLAYLIST_END, pl_Locked ); |
|---|
| 240 | 242 | if( p_new_item ) |
|---|
| 241 | 243 | { |
|---|
| … | … | |
| 243 | 245 | p_new_item->i_flags &= ~PLAYLIST_SAVE_FLAG; |
|---|
| 244 | 246 | } |
|---|
| | 247 | PL_UNLOCK; |
|---|
| 245 | 248 | } |
|---|
| 246 | 249 | |
|---|