[vlc-devel] commit: VCDX: use var_Inherit ( Rémi Denis-Courmont )
git version control
git at videolan.org
Wed Dec 30 19:39:44 CET 2009
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Dec 30 20:23:29 2009 +0200| [b4f5c5e6d1a46516b91d540676abbecfc4aca657] | committer: Rémi Denis-Courmont
VCDX: use var_Inherit
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b4f5c5e6d1a46516b91d540676abbecfc4aca657
---
modules/access/vcdx/access.c | 13 ++++++-------
modules/access/vcdx/info.c | 17 ++++++++++-------
2 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/modules/access/vcdx/access.c b/modules/access/vcdx/access.c
index f3c6192..2210a59 100644
--- a/modules/access/vcdx/access.c
+++ b/modules/access/vcdx/access.c
@@ -546,7 +546,7 @@ VCDParse( access_t * p_access, /*out*/ vcdinfo_itemid_t * p_itemid,
char *psz_source;
char *psz_next;
- if( config_GetInt( p_access, MODULE_STRING "-PBC" ) ) {
+ if( var_InheritInteger( p_access, MODULE_STRING "-PBC" ) ) {
p_itemid->type = VCDINFO_ITEM_TYPE_LID;
p_itemid->num = 1;
*play_single_item = false;
@@ -628,11 +628,10 @@ VCDParse( access_t * p_access, /*out*/ vcdinfo_itemid_t * p_itemid,
/* No source specified, so figure it out. */
if( !p_access->psz_access ) return NULL;
- psz_source = config_GetPsz( p_access, "vcd" );
+ psz_source = var_InheritString( p_access, "vcd" );
- if( !psz_source || 0==strlen(psz_source) )
+ if( !psz_source )
{
- free( psz_source );
/* Scan for a CD-ROM drive with a VCD in it. */
char **cd_drives = cdio_get_devices_with_cap(NULL,
(CDIO_FS_ANAL_SVCD|CDIO_FS_ANAL_CVD
@@ -868,7 +867,7 @@ VCDOpen ( vlc_object_t *p_this )
if( p_vcdplayer == NULL )
return VLC_ENOMEM;
- p_vcdplayer->i_debug = config_GetInt( p_this, MODULE_STRING "-debug" );
+ p_vcdplayer->i_debug = var_InheritInteger( p_this, MODULE_STRING "-debug" );
p_access->p_sys = (access_sys_t *) p_vcdplayer;
/* Set where to log errors messages from libcdio. */
@@ -888,9 +887,9 @@ VCDOpen ( vlc_object_t *p_this )
psz_source, p_access->psz_path );
p_vcdplayer->psz_source = strdup(psz_source);
- p_vcdplayer->i_blocks_per_read = config_GetInt( p_this, MODULE_STRING
+ p_vcdplayer->i_blocks_per_read = var_InheritInteger( p_this, MODULE_STRING
"-blocks-per-read" );
- p_vcdplayer->b_track_length = config_GetInt( p_this, MODULE_STRING
+ p_vcdplayer->b_track_length = var_InheritInteger( p_this, MODULE_STRING
"-track-length" );
p_vcdplayer->in_still = false;
p_vcdplayer->play_item.type = VCDINFO_ITEM_TYPE_NOTFOUND;
diff --git a/modules/access/vcdx/info.c b/modules/access/vcdx/info.c
index e492fe7..090605d 100644
--- a/modules/access/vcdx/info.c
+++ b/modules/access/vcdx/info.c
@@ -139,7 +139,7 @@ VCDMetaInfo( access_t *p_access, /*const*/ char *psz_mrl )
if ( CDIO_INVALID_TRACK != i_track )
{
- char *psz_tfmt = config_GetPsz( p_access, MODULE_STRING "-title-format" );
+ char *psz_tfmt = var_InheritString( p_access, MODULE_STRING "-title-format" );
char *psz_name = VCDFormatStr( p_vcdplayer, psz_tfmt, psz_mrl,
&(p_vcdplayer->play_item) );
free( psz_tfmt );
@@ -309,15 +309,18 @@ VCDUpdateTitle( access_t *p_access )
if( psz_mrl )
{
char *psz_name;
- char *psz_tfmt = config_GetPsz( p_access, MODULE_STRING "-title-format" );
+ char *psz_tfmt = var_InheritString( 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_vcdplayer, psz_tfmt, psz_mrl,
- &(p_vcdplayer->play_item) );
- free(psz_tfmt);
+ if( psz_tfmt )
+ {
+ psz_name = VCDFormatStr( p_vcdplayer, psz_tfmt, psz_mrl,
+ &(p_vcdplayer->play_item) );
+ free(psz_tfmt);
+ input_Control( p_vcdplayer->p_input, INPUT_SET_NAME, psz_name );
+ free(psz_name);
+ }
free(psz_mrl);
- input_Control( p_vcdplayer->p_input, INPUT_SET_NAME, psz_name );
- free(psz_name);
}
}
More information about the vlc-devel
mailing list