Changeset 5c9c07f8e066b6a9d4115ca1b19a5a4203719da7
- Timestamp:
- 23/03/07 20:59:11
(2 years ago)
- Author:
- Laurent Aimar <fenrir@videolan.org>
- git-committer:
- Laurent Aimar <fenrir@videolan.org> 1174679951 +0000
- git-parent:
[d5c128a3b7a8812506929bc381de72fe206a5398]
- git-author:
- Laurent Aimar <fenrir@videolan.org> 1174679951 +0000
- Message:
Extended INPUT_DEL_INFO (Allow deleting a whole category with NULL name)
Fixed VLC_META_NOW_PLAYING update.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rd3fe7f2 |
r5c9c07f |
|
| 206 | 206 | |
|---|
| 207 | 207 | info_category_t *p_cat = NULL; |
|---|
| | 208 | int i_cat; |
|---|
| 208 | 209 | int i; |
|---|
| 209 | 210 | |
|---|
| 210 | 211 | vlc_mutex_lock( &p_input->p->input.p_item->lock ); |
|---|
| 211 | | for( i = 0; i < p_input->p->input.p_item->i_categories; i++ ) |
|---|
| 212 | | { |
|---|
| 213 | | if( !strcmp( p_input->p->input.p_item->pp_categories[i]->psz_name, |
|---|
| | 212 | for( i_cat = 0; i_cat < p_input->p->input.p_item->i_categories; i_cat++ ) |
|---|
| | 213 | { |
|---|
| | 214 | if( !strcmp( p_input->p->input.p_item->pp_categories[i_cat]->psz_name, |
|---|
| 214 | 215 | psz_cat ) ) |
|---|
| 215 | 216 | { |
|---|
| 216 | | p_cat = p_input->p->input.p_item->pp_categories[i]; |
|---|
| | 217 | p_cat = p_input->p->input.p_item->pp_categories[i_cat]; |
|---|
| 217 | 218 | break; |
|---|
| 218 | 219 | } |
|---|
| … | … | |
| 224 | 225 | } |
|---|
| 225 | 226 | |
|---|
| 226 | | for( i = 0; i < p_cat->i_infos; i++ ) |
|---|
| 227 | | { |
|---|
| 228 | | if( !strcmp( p_cat->pp_infos[i]->psz_name, psz_name ) ) |
|---|
| | 227 | if( psz_name ) |
|---|
| | 228 | { |
|---|
| | 229 | /* Remove a specific info */ |
|---|
| | 230 | for( i = 0; i < p_cat->i_infos; i++ ) |
|---|
| | 231 | { |
|---|
| | 232 | if( !strcmp( p_cat->pp_infos[i]->psz_name, psz_name ) ) |
|---|
| | 233 | { |
|---|
| | 234 | free( p_cat->pp_infos[i]->psz_name ); |
|---|
| | 235 | if( p_cat->pp_infos[i]->psz_value ) |
|---|
| | 236 | free( p_cat->pp_infos[i]->psz_value ); |
|---|
| | 237 | free( p_cat->pp_infos[i] ); |
|---|
| | 238 | REMOVE_ELEM( p_cat->pp_infos, p_cat->i_infos, i ); |
|---|
| | 239 | break; |
|---|
| | 240 | } |
|---|
| | 241 | } |
|---|
| | 242 | if( i >= p_cat->i_infos ) |
|---|
| | 243 | { |
|---|
| | 244 | vlc_mutex_unlock( &p_input->p->input.p_item->lock ); |
|---|
| | 245 | return VLC_EGENERIC; |
|---|
| | 246 | } |
|---|
| | 247 | } |
|---|
| | 248 | else |
|---|
| | 249 | { |
|---|
| | 250 | /* Remove the complete categorie */ |
|---|
| | 251 | for( i = 0; i < p_cat->i_infos; i++ ) |
|---|
| 229 | 252 | { |
|---|
| 230 | 253 | free( p_cat->pp_infos[i]->psz_name ); |
|---|
| … | … | |
| 232 | 255 | free( p_cat->pp_infos[i]->psz_value ); |
|---|
| 233 | 256 | free( p_cat->pp_infos[i] ); |
|---|
| 234 | | REMOVE_ELEM( p_cat->pp_infos, p_cat->i_infos, i ); |
|---|
| 235 | | break; |
|---|
| 236 | | } |
|---|
| 237 | | } |
|---|
| 238 | | vlc_mutex_unlock( &p_input->p->input.p_item->lock ); |
|---|
| 239 | | |
|---|
| 240 | | if( i >= p_cat->i_infos ) |
|---|
| 241 | | return VLC_EGENERIC; |
|---|
| | 257 | } |
|---|
| | 258 | if( p_cat->pp_infos ) |
|---|
| | 259 | free( p_cat->pp_infos ); |
|---|
| | 260 | REMOVE_ELEM( p_input->p->input.p_item->pp_categories, p_input->p->input.p_item->i_categories, i_cat ); |
|---|
| | 261 | } |
|---|
| | 262 | vlc_mutex_unlock( &p_input->p->input.p_item->lock ); |
|---|
| 242 | 263 | |
|---|
| 243 | 264 | if( !p_input->b_preparsing ) |
|---|
| 244 | 265 | NotifyPlaylist( p_input ); |
|---|
| | 266 | |
|---|
| | 267 | return VLC_SUCCESS; |
|---|
| 245 | 268 | } |
|---|
| 246 | | return VLC_SUCCESS; |
|---|
| 247 | 269 | |
|---|
| 248 | 270 | |
|---|
| r6b8c8ec |
r5c9c07f |
|
| 254 | 254 | |
|---|
| 255 | 255 | /* Remove 'Now playing' info as it is probably outdated */ |
|---|
| 256 | | input_Control( p_input, INPUT_DEL_INFO, _(VLC_META_INFO_CAT), |
|---|
| 257 | | VLC_META_NOW_PLAYING ); /* ? Don't translate as it might has been copied ? */ |
|---|
| | 256 | input_Control( p_input, INPUT_DEL_INFO, _(VLC_META_INFO_CAT), VLC_META_NOW_PLAYING ); |
|---|
| | 257 | vlc_meta_SetNowPlaying( p_item->p_meta, NULL ); |
|---|
| 258 | 258 | |
|---|
| 259 | 259 | /* */ |
|---|