Changeset 45cd6d75350e2f9f3d1e7c30a7f34c119acb5ec8
- Timestamp:
- 26/04/05 09:17:42 (4 years ago)
- git-parent:
- Files:
-
- src/input/control.c (modified) (2 diffs)
- src/input/es_out.c (modified) (6 diffs)
- src/input/input.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
src/input/control.c
rbfb6686 r45cd6d7 197 197 } 198 198 return VLC_SUCCESS; 199 case INPUT_DEL_INFO: 200 { 201 char *psz_cat = (char *)va_arg( args, char * ); 202 char *psz_name = (char *)va_arg( args, char * ); 203 204 info_category_t *p_cat = NULL; 205 int i; 206 207 vlc_mutex_lock( &p_input->input.p_item->lock ); 208 for( i = 0; i < p_input->input.p_item->i_categories; i++ ) 209 { 210 if( !strcmp( p_input->input.p_item->pp_categories[i]->psz_name, 211 psz_cat ) ) 212 { 213 p_cat = p_input->input.p_item->pp_categories[i]; 214 break; 215 } 216 } 217 if( p_cat == NULL ) 218 { 219 vlc_mutex_unlock( &p_input->input.p_item->lock ); 220 return VLC_EGENERIC; 221 } 222 223 for( i = 0; i < p_cat->i_infos; i++ ) 224 { 225 if( !strcmp( p_cat->pp_infos[i]->psz_name, psz_name ) ) 226 { 227 REMOVE_ELEM( p_cat->pp_infos, p_cat->i_infos, i ); 228 break; 229 } 230 } 231 vlc_mutex_unlock( &p_input->input.p_item->lock ); 232 233 if( i >= p_cat->i_infos ) 234 return VLC_EGENERIC; 235 236 NotifyPlaylist( p_input ); 237 } 238 return VLC_SUCCESS; 239 199 240 200 241 case INPUT_GET_INFO: … … 204 245 char **ppsz_value = (char **)va_arg( args, char ** ); 205 246 int i_ret = VLC_EGENERIC; 206 int i;207 247 *ppsz_value = NULL; 208 248 src/input/es_out.c
rfb217d8 r45cd6d7 54 54 input_clock_t clock; 55 55 56 char *psz_now_playing; 57 56 58 } es_out_pgrm_t; 57 59 … … 239 241 for( i = 0; i < p_sys->i_pgrm; i++ ) 240 242 { 243 if( p_sys->pgrm[i]->psz_now_playing ) 244 free( p_sys->pgrm[i]->psz_now_playing ); 241 245 free( p_sys->pgrm[i] ); 242 246 } … … 442 446 } 443 447 448 /* Update now playing if defined per program */ 449 if( p_pgrm->psz_now_playing ) 450 { 451 char *psz_cat = malloc( strlen(_("Program")) + 10 ); 452 453 sprintf( psz_cat, "%s %d", _("Program"), p_pgrm->i_id ); 454 input_Control( p_input, INPUT_ADD_INFO, _("Meta-information"), 455 VLC_META_NOW_PLAYING, "%s", p_pgrm->psz_now_playing ); 456 free( psz_cat ); 457 } 458 459 444 460 var_SetBool( p_sys->p_input, "intf-change", VLC_TRUE ); 445 461 } … … 460 476 p_pgrm->i_es = 0; 461 477 p_pgrm->b_selected = VLC_FALSE; 478 p_pgrm->psz_now_playing = NULL; 462 479 input_ClockInit( &p_pgrm->clock, VLC_FALSE, p_input->input.i_cr_average ); 463 480 … … 485 502 { 486 503 es_out_sys_t *p_sys = out->p_sys; 504 es_out_pgrm_t *p_pgrm = NULL; 487 505 input_thread_t *p_input = p_sys->p_input; 488 506 char *psz_cat = malloc( strlen(_("Program")) + 10 ); 507 char *psz_name = NULL; 508 char *psz_now_playing = NULL; 509 char *psz_provider = NULL; 489 510 int i; 490 511 … … 498 519 input_Control( p_input, INPUT_ADD_INFO, psz_cat, 499 520 _(p_meta->name[i]), "%s", p_meta->value[i] ); 521 if( !strcasecmp( p_meta->name[i], "Name" ) ) 522 psz_name = p_meta->value[i]; 523 else if( !strcasecmp( p_meta->name[i], "Provider" ) ) 524 psz_provider = p_meta->value[i]; 525 else if( !strcasecmp( p_meta->name[i], VLC_META_NOW_PLAYING ) ) 526 psz_now_playing = p_meta->value[i]; 527 } 528 529 if( !psz_name && !psz_now_playing ) 530 { 531 free( psz_cat ); 532 return; 533 } 534 535 for( i = 0; i < p_sys->i_pgrm; i++ ) 536 { 537 if( p_sys->pgrm[i]->i_id == i_group ) 538 { 539 p_pgrm = p_sys->pgrm[i]; 540 break; 541 } 542 } 543 544 if( p_pgrm == NULL ) 545 p_pgrm = EsOutProgramAdd( out, i_group ); 546 547 /* Update the description text of the program */ 548 if( psz_name && *psz_name ) 549 { 550 vlc_value_t val; 551 vlc_value_t text; 552 553 /* ugly but it works */ 554 val.i_int = i_group; 555 var_Change( p_input, "program", VLC_VAR_DELCHOICE, &val, NULL ); 556 557 if( psz_provider && *psz_provider ) 558 { 559 asprintf( &text.psz_string, "%s [%s]", psz_name, psz_provider ); 560 var_Change( p_input, "program", VLC_VAR_ADDCHOICE, &val, &text ); 561 free( text.psz_string ); 562 } 563 else 564 { 565 text.psz_string = psz_name; 566 var_Change( p_input, "program", VLC_VAR_ADDCHOICE, &val, &text ); 567 } 568 } 569 if( psz_now_playing ) 570 { 571 p_pgrm->psz_now_playing = strdup(psz_now_playing); 572 573 if( p_sys->p_pgrm == p_pgrm ) 574 { 575 input_Control( p_input, INPUT_ADD_INFO, _("Meta-information"), 576 VLC_META_NOW_PLAYING, "%s", psz_now_playing ); 577 } 500 578 } 501 579 free( psz_cat ); src/input/input.c
r41c5188 r45cd6d7 218 218 free( val.psz_string ); 219 219 } 220 221 /* Remove 'Now playing' info as it is probably outdated */ 222 input_Control( p_input, INPUT_DEL_INFO, _("Meta-information"), 223 VLC_META_NOW_PLAYING ); 220 224 221 225 /* Now we can attach our new input */ … … 1912 1916 char *psz_demux; 1913 1917 char *psz_path; 1918 char *psz_tmp; 1914 1919 char *psz; 1915 1920 vlc_value_t val; … … 1918 1923 if( !b_quick ) 1919 1924 { 1920 MRLSplit( p_input, psz_dup, &psz_access, &psz_demux, &psz_path ); 1925 MRLSplit( VLC_OBJECT(p_input), psz_dup, 1926 &psz_access, &psz_demux, &psz_path ); 1921 1927 1922 1928 msg_Dbg( p_input, "`%s' gives access `%s' demux `%s' path `%s'", … … 2023 2029 2024 2030 /* */ 2025 psz = var_GetString( p_input, "access-filter" );2026 if(*psz )2031 psz_tmp = psz = var_GetString( p_input, "access-filter" ); 2032 while( psz && *psz ) 2027 2033 { 2028 2034 access_t *p_access = in->p_access; 2029 2030 /* TODO support chained access-filter */ 2035 char *end = strchr( psz, ':' ); 2036 2037 if( end ) 2038 *end++ = '\0'; 2039 2031 2040 in->p_access = access2_FilterNew( in->p_access, psz ); 2032 2041 if( in->p_access == NULL ) … … 2036 2045 psz ); 2037 2046 } 2038 } 2039 free( psz ); 2047 2048 psz = end; 2049 } 2050 free( psz_tmp ); 2040 2051 2041 2052 /* Get infos from access */
