X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Faccess%2Fvcdx%2Finfo.c;h=5d3d16f71b92532c028ed823f2e4e987c6241433;hb=49ab2f56bf3809a18933baac3297e512fc115169;hp=3824548630f35dc09824fbdb9d62a9f8d9a619a5;hpb=6ee1e193fd896ab9a4729fde14f009d9ce629815;p=vlc diff --git a/modules/access/vcdx/info.c b/modules/access/vcdx/info.c index 3824548630..5d3d16f71b 100644 --- a/modules/access/vcdx/info.c +++ b/modules/access/vcdx/info.c @@ -21,11 +21,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ -#include +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include #include #include #include "vcd.h" -#include #include #include "info.h" @@ -172,10 +175,11 @@ VCDMetaInfo( access_t *p_access, /*const*/ char *psz_mrl ) if ( CDIO_INVALID_TRACK != i_track ) { + char* psz_title_format = config_GetPsz( p_access, MODULE_STRING "-title-format" ); char *psz_name = - VCDFormatStr( p_access, p_vcdplayer, - config_GetPsz( p_access, MODULE_STRING "-title-format" ), - psz_mrl, &(p_vcdplayer->play_item) ); + VCDFormatStr( p_access, p_vcdplayer, psz_title_format, psz_mrl, + &(p_vcdplayer->play_item) ); + free( psz_title_format ); input_Control( p_vcdplayer->p_input, INPUT_SET_NAME, psz_name ); } @@ -192,7 +196,7 @@ VCDMetaInfo( access_t *p_access, /*const*/ char *psz_mrl ) strncat(tp, str, TEMP_STR_LEN-(tp-temp_str)); \ tp += len; \ } \ - saw_control_prefix = VLC_FALSE; \ + saw_control_prefix = false; \ } \ } @@ -207,7 +211,7 @@ VCDMetaInfo( access_t *p_access, /*const*/ char *psz_mrl ) strncat(tp, num_str, TEMP_STR_LEN-(tp-temp_str)); \ tp += len; \ } \ - saw_control_prefix = VLC_FALSE; \ + saw_control_prefix = false; \ } /*! @@ -242,7 +246,7 @@ VCDFormatStr(const access_t *p_access, vcdplayer_t *p_vcdplayer, static char temp_str[TEMP_STR_SIZE]; size_t i; char * tp = temp_str; - vlc_bool_t saw_control_prefix = VLC_FALSE; + bool saw_control_prefix = false; size_t format_len = strlen(format_str); memset(temp_str, 0, TEMP_STR_SIZE); @@ -251,7 +255,7 @@ VCDFormatStr(const access_t *p_access, vcdplayer_t *p_vcdplayer, if (!saw_control_prefix && format_str[i] != '%') { *tp++ = format_str[i]; - saw_control_prefix = VLC_FALSE; + saw_control_prefix = false; continue; } @@ -306,7 +310,7 @@ VCDFormatStr(const access_t *p_access, vcdplayer_t *p_vcdplayer, /* What to do? */ ; } - saw_control_prefix = VLC_FALSE; + saw_control_prefix = false; } break; @@ -317,7 +321,7 @@ VCDFormatStr(const access_t *p_access, vcdplayer_t *p_vcdplayer, strncat(tp, num_str, TEMP_STR_LEN-(tp-temp_str)); tp += strlen(num_str); } - saw_control_prefix = VLC_FALSE; + saw_control_prefix = false; break; case 'M': @@ -345,7 +349,7 @@ VCDFormatStr(const access_t *p_access, vcdplayer_t *p_vcdplayer, strncat(tp, seg_type_str, TEMP_STR_LEN-(tp-temp_str)); tp += strlen(seg_type_str); } - saw_control_prefix = VLC_FALSE; + saw_control_prefix = false; break; case 'T': @@ -363,7 +367,7 @@ VCDFormatStr(const access_t *p_access, vcdplayer_t *p_vcdplayer, default: *tp++ = '%'; *tp++ = format_str[i]; - saw_control_prefix = VLC_FALSE; + saw_control_prefix = false; } } return strdup(temp_str); @@ -382,14 +386,14 @@ VCDUpdateTitle( access_t *p_access ) if( psz_mrl ) { char *psz_name; - snprintf(psz_mrl, psz_mrl_max, "%s%s", - VCD_MRL_PREFIX, p_vcdplayer->psz_source); - psz_name = VCDFormatStr( p_access, p_vcdplayer, - config_GetPsz( p_access, MODULE_STRING - "-title-format" ), - psz_mrl, &(p_vcdplayer->play_item) ); - input_Control( p_vcdplayer->p_input, INPUT_SET_NAME, psz_name ); - free(psz_mrl); + char* psz_title_format = config_GetPsz( p_access, MODULE_STRING "-title-format" ); + snprintf( psz_mrl, psz_mrl_max, "%s%s", + VCD_MRL_PREFIX, p_vcdplayer->psz_source ); + psz_name = VCDFormatStr( p_access, p_vcdplayer, psz_title_format, psz_mrl, + &(p_vcdplayer->play_item) ); + input_Control( p_vcdplayer->p_input, INPUT_SET_NAME, psz_name ); + free( psz_title_format ); + free(psz_mrl); } }