Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
dfef7d71
Commit
dfef7d71
authored
Dec 02, 2004
by
Rocky Bernstein
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A little bit better if CDDB is not enabled or doesn't exist. Well, at
least it it no longer core dumps.
parent
ec5590ea
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
21 deletions
+48
-21
modules/access/cdda/access.c
modules/access/cdda/access.c
+5
-4
modules/access/cdda/info.c
modules/access/cdda/info.c
+42
-16
modules/access/cdda/info.h
modules/access/cdda/info.h
+1
-1
No files found.
modules/access/cdda/access.c
View file @
dfef7d71
...
...
@@ -516,11 +516,12 @@ static int CDDAControl( access_t *p_access, int i_query, va_list args )
{
*
pp_meta
=
vlc_meta_Duplicate
(
p_cdda
->
p_meta
);
dbg_print
(
INPUT_DBG_META
,
"%s"
,
"Meta copied"
);
return
VLC_SUCCESS
;
}
else
msg_Warn
(
p_access
,
"tried to copy NULL meta info"
);
return
VLC_SUCCESS
;
else
{
msg_Warn
(
p_access
,
"tried to copy NULL meta info"
);
return
VLC_EGENERIC
;
}
}
case
ACCESS_CAN_SEEK
:
...
...
modules/access/cdda/info.c
View file @
dfef7d71
...
...
@@ -149,14 +149,14 @@ cddb_end: ;
}
#endif
/*HAVE_LIBCDDB*/
#define add_meta_val(
FIELD, VLC_META, VAL)
\
#define add_meta_val(
VLC_META, VAL)
\
if ( p_cdda->p_meta && VAL) { \
vlc_meta_Add( p_cdda->p_meta, VLC_META, VAL ); \
dbg_print( INPUT_DBG_META, "field %s: %s\n", VLC_META, VAL ); \
} \
#define add_cddb_meta(FIELD, VLC_META)
\
add_meta_val(
FIELD,
VLC_META, p_cdda->cddb.disc->FIELD);
#define add_cddb_meta(FIELD, VLC_META)
\
add_meta_val(VLC_META, p_cdda->cddb.disc->FIELD);
#define add_cddb_meta_fmt(FIELD, FORMAT_SPEC, VLC_META) \
{ \
...
...
@@ -164,7 +164,7 @@ cddb_end: ;
snprintf( psz_buf, sizeof(psz_buf)-1, FORMAT_SPEC, \
p_cdda->cddb.disc->FIELD ); \
psz_buf[sizeof(psz_buf)-1] = '\0'; \
add_meta_val(
FIELD, VLC_META, psz_buf);
\
add_meta_val(
VLC_META, psz_buf);
\
}
/* Adds a string-valued entry to the stream and media information if
...
...
@@ -219,13 +219,16 @@ cddb_end: ;
media info" or in playlist info. The intialization of CD-Text or CDDB
is done here though.
*/
void
CDDAMetaInfo
(
access_t
*
p_access
,
int
i_track
)
void
CDDAMetaInfo
(
access_t
*
p_access
,
int
i_track
,
/*const*/
char
*
psz_mrl
)
{
cdda_data_t
*
p_cdda
=
(
cdda_data_t
*
)
p_access
->
p_sys
;
char
*
psz_meta_title
=
psz_mrl
;
char
*
psz_meta_artist
=
NULL
;
if
(
!
p_cdda
)
return
;
p_cdda
->
psz_mcn
=
cdio_get_mcn
(
p_cdda
->
p_cdio
);
p_cdda
->
p_meta
=
vlc_meta_New
();
#ifdef HAVE_LIBCDDB
if
(
p_cdda
->
b_cddb_enabled
)
...
...
@@ -233,11 +236,11 @@ void CDDAMetaInfo( access_t *p_access, int i_track )
GetCDDBInfo
(
p_access
,
p_cdda
);
if
(
p_cdda
->
cddb
.
disc
)
{
p_cdda
->
p_meta
=
vlc_meta_New
();
if
(
i_track
==
-
1
)
{
add_cddb_meta
(
title
,
VLC_META_TITLE
);
add_cddb_meta
(
artist
,
VLC_META_ARTIST
);
psz_meta_title
=
p_cdda
->
cddb
.
disc
->
title
;
psz_meta_artist
=
p_cdda
->
cddb
.
disc
->
artist
;
input_Control
(
p_cdda
->
p_input
,
INPUT_SET_NAME
,
p_cdda
->
cddb
.
disc
->
artist
);
}
...
...
@@ -249,20 +252,22 @@ void CDDAMetaInfo( access_t *p_access, int i_track )
{
if
(
t
->
title
!=
NULL
)
{
add_meta_val
(
NULL
,
VLC_META_TITLE
,
t
->
title
);
add_meta_val
(
VLC_META_TITLE
,
t
->
title
);
}
if
(
t
->
artist
!=
NULL
)
{
add_meta_val
(
NULL
,
VLC_META_ARTIST
,
t
->
artist
);
add_meta_val
(
VLC_META_ARTIST
,
t
->
artist
);
}
}
}
add_cddb_meta
(
genre
,
VLC_META_GENRE
);
add_cddb_meta_fmt
(
year
,
"%d"
,
VLC_META_DATE
);
}
add_cddb_meta
(
genre
,
VLC_META_GENRE
);
add_cddb_meta_fmt
(
year
,
"%d"
,
VLC_META_DATE
);
}
}
#endif
/*HAVE_LIBCDDB*/
#define TITLE_MAX 30
{
track_t
i
=
p_cdda
->
i_tracks
;
...
...
@@ -299,6 +304,8 @@ void CDDAMetaInfo( access_t *p_access, int i_track )
p_cdda
->
p_cdtext
[
0
]
=
cdio_get_cdtext
(
p_cdda
->
p_cdio
,
0
);
if
(
p_cdda
->
p_cdtext
[
0
])
{
char
*
psz_field
;
add_cdtext_disc_info_str
(
"Arranger (CD-Text)"
,
CDTEXT_ARRANGER
);
add_cdtext_disc_info_str
(
"Composer (CD-Text)"
,
CDTEXT_COMPOSER
);
add_cdtext_disc_info_str
(
"Disc ID (CD-Text)"
,
CDTEXT_DISCID
);
...
...
@@ -307,6 +314,16 @@ void CDDAMetaInfo( access_t *p_access, int i_track )
add_cdtext_disc_info_str
(
"Performer (CD-Text)"
,
CDTEXT_PERFORMER
);
add_cdtext_disc_info_str
(
"Songwriter (CD-Text)"
,
CDTEXT_SONGWRITER
);
add_cdtext_disc_info_str
(
"Title (CD-Text)"
,
CDTEXT_TITLE
);
psz_field
=
p_cdda
->
p_cdtext
[
0
]
->
field
[
CDTEXT_TITLE
];
if
(
psz_field
&&
strlen
(
psz_field
))
{
psz_meta_title
=
psz_field
;
}
psz_field
=
p_cdda
->
p_cdtext
[
0
]
->
field
[
CDTEXT_PERFORMER
];
if
(
psz_field
&&
strlen
(
psz_field
))
{
psz_meta_artist
=
psz_field
;
}
}
for
(
i
=
0
;
i
<
p_cdda
->
i_tracks
;
i
++
)
...
...
@@ -359,6 +376,15 @@ void CDDAMetaInfo( access_t *p_access, int i_track )
}
#endif
/*HAVE_LIBCDDB*/
}
/* Above we should have set psz_meta_title and psz_meta_artist
to CDDB or CD-Text values or the default value depending on
availablity and user preferences. So now add it to VLC's meta.
*/
add_meta_val
(
VLC_META_TITLE
,
psz_meta_title
);
if
(
psz_meta_artist
)
add_meta_val
(
VLC_META_ARTIST
,
psz_meta_artist
);
}
}
...
...
@@ -805,11 +831,11 @@ CDDAFixupPlaylist( access_t *p_access, cdda_data_t *p_cdda,
if
(
b_single_track
)
{
CDDAMetaInfo
(
p_access
,
p_cdda
->
i_track
);
CDDAMetaInfo
(
p_access
,
p_cdda
->
i_track
,
psz_mrl
);
}
else
{
CDDAMetaInfo
(
p_access
,
-
1
);
CDDAMetaInfo
(
p_access
,
-
1
,
psz_mrl
);
}
p_item
=
playlist_ItemGetByInput
(
p_playlist
,
...
...
modules/access/cdda/info.h
View file @
dfef7d71
...
...
@@ -33,7 +33,7 @@ int CDDAFixupPlaylist( access_t *p_access, cdda_data_t *p_cdda,
we handle Meta Information requests and basically copy what we've
saved here.
*/
void
CDDAMetaInfo
(
access_t
*
p_access
,
int
);
void
CDDAMetaInfo
(
access_t
*
p_access
,
int
,
/*const*/
char
*
psz_mrl
);
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment