Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
ed58d07d
Commit
ed58d07d
authored
Jun 14, 2008
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix indentation.
parent
117e2de0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
273 additions
and
274 deletions
+273
-274
include/vlc_input.h
include/vlc_input.h
+5
-2
modules/access/cdda/info.c
modules/access/cdda/info.c
+268
-272
No files found.
include/vlc_input.h
View file @
ed58d07d
...
...
@@ -58,7 +58,7 @@ struct input_item_t
char
*
psz_name
;
/**< text describing this item */
char
*
psz_uri
;
/**< mrl of this item */
bool
b_fixed_name
;
/**< Can the interface change the name ?*/
bool
b_fixed_name
;
/**< Can the interface change the name ?*/
int
i_options
;
/**< Number of input options */
char
**
ppsz_options
;
/**< Array of input options */
...
...
@@ -403,7 +403,7 @@ typedef struct
{
char
*
psz_name
;
bool
b_menu
;
/* Is it a menu or a normal entry */
bool
b_menu
;
/* Is it a menu or a normal entry */
int64_t
i_length
;
/* Length(microsecond) if known, else 0 */
int64_t
i_size
;
/* Size (bytes) if known, else 0 */
...
...
@@ -467,6 +467,7 @@ static inline input_title_t *vlc_input_title_Duplicate( input_title_t *t )
return
dup
;
}
/*****************************************************************************
* Attachments
*****************************************************************************/
...
...
@@ -479,6 +480,7 @@ struct input_attachment_t
int
i_data
;
void
*
p_data
;
};
static
inline
input_attachment_t
*
vlc_input_attachment_New
(
const
char
*
psz_name
,
const
char
*
psz_mime
,
const
char
*
psz_description
,
...
...
@@ -517,6 +519,7 @@ static inline void vlc_input_attachment_Delete( input_attachment_t *a )
free
(
a
->
p_data
);
free
(
a
);
}
/*****************************************************************************
* input defines/constants.
*****************************************************************************/
...
...
modules/access/cdda/info.c
View file @
ed58d07d
...
...
@@ -229,7 +229,7 @@ void
CDDAMetaInfoInit
(
access_t
*
p_access
)
{
cdda_data_t
*
p_cdda
=
(
cdda_data_t
*
)
p_access
->
p_sys
;
if
(
!
p_cdda
)
return
;
dbg_print
(
(
INPUT_DBG_CALL
),
"p_cdda->i_tracks %d"
,
...
...
@@ -252,11 +252,11 @@ CDDAMetaInfoInit( access_t *p_access )
{
track_t
i_track
;
for
(
i_track
=
0
;
i_track
<
p_cdda
->
i_tracks
;
i_track
++
)
{
p_cdda
->
p_cdtext
[
i_track
]
=
cdio_get_cdtext
(
p_cdda
->
p_cdio
,
i_track
);
}
for
(
i_track
=
0
;
i_track
<
p_cdda
->
i_tracks
;
i_track
++
)
{
p_cdda
->
p_cdtext
[
i_track
]
=
cdio_get_cdtext
(
p_cdda
->
p_cdio
,
i_track
);
}
}
}
...
...
@@ -273,7 +273,7 @@ CDDAMetaInfo( access_t *p_access, track_t i_track )
cdda_data_t
*
p_cdda
=
(
cdda_data_t
*
)
p_access
->
p_sys
;
char
*
psz_meta_title
=
CDDAFormatMRL
(
p_access
,
i_track
);
char
*
psz_meta_artist
=
NULL
;
if
(
!
p_cdda
)
return
;
dbg_print
(
(
INPUT_DBG_CALL
),
"i_track %d"
,
i_track
);
...
...
@@ -284,43 +284,42 @@ CDDAMetaInfo( access_t *p_access, track_t i_track )
if
(
p_cdda
->
b_cddb_enabled
&&
p_cdda
->
cddb
.
disc
)
{
if
(
CDIO_INVALID_TRACK
==
i_track
)
{
{
psz_meta_title
=
(
char
*
)
cddb_disc_get_title
(
p_cdda
->
cddb
.
disc
);
psz_meta_artist
=
(
char
*
)
cddb_disc_get_artist
(
p_cdda
->
cddb
.
disc
);
if
(
cddb_disc_get_genre
(
p_cdda
->
cddb
.
disc
)
&&
strlen
(
cddb_disc_get_genre
(
p_cdda
->
cddb
.
disc
))
)
add_cddb_meta
(
genre
,
vlc_meta_Genre
);
if
(
0
!=
cddb_disc_get_year
(
p_cdda
->
cddb
.
disc
))
add_cddb_meta_fmt
(
year
,
"%d"
,
vlc_meta_Date
);
}
else
{
cddb_track_t
*
t
=
cddb_disc_get_track
(
p_cdda
->
cddb
.
disc
,
i_track
-
1
);
if
(
t
!=
NULL
)
{
if
(
cddb_track_get_title
(
t
)
!=
NULL
&&
!
p_cdda
->
b_nav_mode
)
{
add_meta_val
(
vlc_meta_Title
,
cddb_track_get_title
(
t
)
);
}
if
(
cddb_track_get_artist
(
t
)
!=
NULL
)
{
add_meta_val
(
vlc_meta_Artist
,
cddb_track_get_artist
(
t
)
);
}
}
}
psz_meta_title
=
(
char
*
)
cddb_disc_get_title
(
p_cdda
->
cddb
.
disc
);
psz_meta_artist
=
(
char
*
)
cddb_disc_get_artist
(
p_cdda
->
cddb
.
disc
);
if
(
cddb_disc_get_genre
(
p_cdda
->
cddb
.
disc
)
&&
strlen
(
cddb_disc_get_genre
(
p_cdda
->
cddb
.
disc
))
)
add_cddb_meta
(
genre
,
vlc_meta_Genre
);
if
(
0
!=
cddb_disc_get_year
(
p_cdda
->
cddb
.
disc
))
add_cddb_meta_fmt
(
year
,
"%d"
,
vlc_meta_Date
);
}
else
{
cddb_track_t
*
t
=
cddb_disc_get_track
(
p_cdda
->
cddb
.
disc
,
i_track
-
1
);
if
(
t
!=
NULL
)
{
if
(
cddb_track_get_title
(
t
)
!=
NULL
&&
!
p_cdda
->
b_nav_mode
)
{
add_meta_val
(
vlc_meta_Title
,
cddb_track_get_title
(
t
)
);
}
if
(
cddb_track_get_artist
(
t
)
!=
NULL
)
{
add_meta_val
(
vlc_meta_Artist
,
cddb_track_get_artist
(
t
)
);
}
}
}
}
#endif
/*HAVE_LIBCDDB*/
#define TITLE_MAX 30
{
track_t
i
=
p_cdda
->
i_tracks
;
const
int
i_first_track
=
p_cdda
->
i_first_track
;
char
psz_buffer
[
MSTRTIME_MAX_SIZE
];
unsigned
int
i_track_frames
=
cdio_get_track_lba
(
p_cdda
->
p_cdio
,
CDIO_CDROM_LEADOUT_TRACK
);
unsigned
int
i_track_frames
=
cdio_get_track_lba
(
p_cdda
->
p_cdio
,
CDIO_CDROM_LEADOUT_TRACK
);
mtime_t
i_duration
=
i_track_frames
/
CDIO_CD_FRAMES_PER_SEC
;
dbg_print
(
INPUT_DBG_META
,
"Duration %ld, tracks %d"
,
...
...
@@ -329,37 +328,36 @@ CDDAMetaInfo( access_t *p_access, track_t i_track )
_
(
"Disc"
),
_
(
"Duration"
),
"%s"
,
secstotimestr
(
psz_buffer
,
i_duration
)
);
if
(
p_cdda
->
psz_mcn
)
{
input_Control
(
p_cdda
->
p_input
,
INPUT_ADD_INFO
,
_
(
"Disc"
),
_
(
"Media Catalog Number (MCN)"
),
"%s"
,
p_cdda
->
psz_mcn
);
input_Control
(
p_cdda
->
p_input
,
INPUT_ADD_INFO
,
_
(
"Disc"
),
_
(
"Tracks"
),
"%d"
,
p_cdda
->
i_tracks
);
}
if
(
p_cdda
->
psz_mcn
)
{
input_Control
(
p_cdda
->
p_input
,
INPUT_ADD_INFO
,
_
(
"Disc"
),
_
(
"Media Catalog Number (MCN)"
),
"%s"
,
p_cdda
->
psz_mcn
);
input_Control
(
p_cdda
->
p_input
,
INPUT_ADD_INFO
,
_
(
"Disc"
),
_
(
"Tracks"
),
"%d"
,
p_cdda
->
i_tracks
);
}
#ifdef HAVE_LIBCDDB
if
(
p_cdda
->
b_cddb_enabled
&&
p_cdda
->
cddb
.
disc
)
{
add_cddb_disc_info_str
(
"Artist (CDDB)"
,
artist
);
if
(
CDDB_CAT_INVALID
!=
cddb_disc_get_category
(
p_cdda
->
cddb
.
disc
)
)
add_info_str
(
"Disc"
,
"Category (CDDB)"
,
CDDB_CATEGORY
[
cddb_disc_get_category
(
p_cdda
->
cddb
.
disc
)]);
add_cddb_disc_info_val
(
"Disc ID (CDDB)"
,
"%x"
,
discid
);
add_cddb_disc_info_str
(
"Extended Data (CDDB)"
,
ext_data
);
add_cddb_disc_info_str
(
"Genre (CDDB)"
,
genre
);
add_cddb_disc_info_str
(
"Title (CDDB)"
,
title
);
if
(
0
!=
cddb_disc_get_year
(
p_cdda
->
cddb
.
disc
)
)
add_cddb_disc_info_val
(
"Year (CDDB)"
,
"%d"
,
year
);
add_cddb_disc_info_str
(
"Artist (CDDB)"
,
artist
);
if
(
CDDB_CAT_INVALID
!=
cddb_disc_get_category
(
p_cdda
->
cddb
.
disc
)
)
add_info_str
(
"Disc"
,
"Category (CDDB)"
,
CDDB_CATEGORY
[
cddb_disc_get_category
(
p_cdda
->
cddb
.
disc
)]);
add_cddb_disc_info_val
(
"Disc ID (CDDB)"
,
"%x"
,
discid
);
add_cddb_disc_info_str
(
"Extended Data (CDDB)"
,
ext_data
);
add_cddb_disc_info_str
(
"Genre (CDDB)"
,
genre
);
add_cddb_disc_info_str
(
"Title (CDDB)"
,
title
);
if
(
0
!=
cddb_disc_get_year
(
p_cdda
->
cddb
.
disc
)
)
add_cddb_disc_info_val
(
"Year (CDDB)"
,
"%d"
,
year
);
}
#endif
/*HAVE_LIBCDDB*/
if
(
p_cdda
->
p_cdtext
[
0
])
{
char
*
psz_field
;
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
);
...
...
@@ -369,74 +367,72 @@ CDDAMetaInfo( access_t *p_access, track_t i_track )
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
;
}
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
++
)
{
char
psz_track
[
TITLE_MAX
];
const
track_t
i_track
=
i_first_track
+
i
;
unsigned
int
i_track_frames
=
cdio_get_track_lsn
(
p_cdda
->
p_cdio
,
i_track
+
1
)
-
cdio_get_track_lsn
(
p_cdda
->
p_cdio
,
i_track
);
mtime_t
i_duration
=
i_track_frames
/
CDIO_CD_FRAMES_PER_SEC
;
char
*
psz_mrl
=
CDDAFormatMRL
(
p_access
,
i_track
);
snprintf
(
psz_track
,
TITLE_MAX
,
"%s %02d"
,
_
(
"Track"
),
i_track
);
input_Control
(
p_cdda
->
p_input
,
INPUT_ADD_INFO
,
psz_track
,
_
(
"Duration"
),
"%s"
,
secstotimestr
(
psz_buffer
,
i_duration
)
);
input_Control
(
p_cdda
->
p_input
,
INPUT_ADD_INFO
,
psz_track
,
_
(
"MRL"
),
"%s"
,
psz_mrl
);
free
(
psz_mrl
);
if
(
p_cdda
->
p_cdtext
[
i_track
])
for
(
i
=
0
;
i
<
p_cdda
->
i_tracks
;
i
++
)
{
add_cdtext_info_str
(
psz_track
,
"Arranger (CD-Text)"
,
i_track
,
CDTEXT_ARRANGER
);
add_cdtext_info_str
(
psz_track
,
"Composer (CD-Text)"
,
i_track
,
CDTEXT_COMPOSER
);
add_cdtext_info_str
(
psz_track
,
"Disc ID (CD-Text)"
,
i_track
,
CDTEXT_DISCID
);
add_cdtext_info_str
(
psz_track
,
"Genre (CD-Text)"
,
i_track
,
CDTEXT_GENRE
);
add_cdtext_info_str
(
psz_track
,
"Message (CD-Text)"
,
i_track
,
CDTEXT_MESSAGE
);
add_cdtext_info_str
(
psz_track
,
"Performer (CD-Text)"
,
i_track
,
CDTEXT_PERFORMER
);
add_cdtext_info_str
(
psz_track
,
"Songwriter (CD-Text)"
,
i_track
,
CDTEXT_SONGWRITER
);
add_cdtext_info_str
(
psz_track
,
"Title (CD-Text)"
,
i_track
,
CDTEXT_TITLE
);
}
char
psz_track
[
TITLE_MAX
];
const
track_t
i_track
=
i_first_track
+
i
;
unsigned
int
i_track_frames
=
cdio_get_track_lsn
(
p_cdda
->
p_cdio
,
i_track
+
1
)
-
cdio_get_track_lsn
(
p_cdda
->
p_cdio
,
i_track
);
mtime_t
i_duration
=
i_track_frames
/
CDIO_CD_FRAMES_PER_SEC
;
char
*
psz_mrl
=
CDDAFormatMRL
(
p_access
,
i_track
);
snprintf
(
psz_track
,
TITLE_MAX
,
"%s %02d"
,
_
(
"Track"
),
i_track
);
input_Control
(
p_cdda
->
p_input
,
INPUT_ADD_INFO
,
psz_track
,
_
(
"Duration"
),
"%s"
,
secstotimestr
(
psz_buffer
,
i_duration
)
);
input_Control
(
p_cdda
->
p_input
,
INPUT_ADD_INFO
,
psz_track
,
_
(
"MRL"
),
"%s"
,
psz_mrl
);
free
(
psz_mrl
);
if
(
p_cdda
->
p_cdtext
[
i_track
])
{
add_cdtext_info_str
(
psz_track
,
"Arranger (CD-Text)"
,
i_track
,
CDTEXT_ARRANGER
);
add_cdtext_info_str
(
psz_track
,
"Composer (CD-Text)"
,
i_track
,
CDTEXT_COMPOSER
);
add_cdtext_info_str
(
psz_track
,
"Disc ID (CD-Text)"
,
i_track
,
CDTEXT_DISCID
);
add_cdtext_info_str
(
psz_track
,
"Genre (CD-Text)"
,
i_track
,
CDTEXT_GENRE
);
add_cdtext_info_str
(
psz_track
,
"Message (CD-Text)"
,
i_track
,
CDTEXT_MESSAGE
);
add_cdtext_info_str
(
psz_track
,
"Performer (CD-Text)"
,
i_track
,
CDTEXT_PERFORMER
);
add_cdtext_info_str
(
psz_track
,
"Songwriter (CD-Text)"
,
i_track
,
CDTEXT_SONGWRITER
);
add_cdtext_info_str
(
psz_track
,
"Title (CD-Text)"
,
i_track
,
CDTEXT_TITLE
);
}
#ifdef HAVE_LIBCDDB
if
(
p_cdda
->
b_cddb_enabled
)
{
cddb_track_t
*
t
=
cddb_disc_get_track
(
p_cdda
->
cddb
.
disc
,
i
);
if
(
t
!=
NULL
)
{
add_info_str
(
psz_track
,
"Artist (CDDB)"
,
cddb_track_get_artist
(
t
));
add_info_str
(
psz_track
,
"Title (CDDB)"
,
cddb_track_get_title
(
t
));
add_info_str
(
psz_track
,
"Extended Data (CDDB)"
,
cddb_track_get_ext_data
(
t
));
}
}
if
(
p_cdda
->
b_cddb_enabled
)
{
cddb_track_t
*
t
=
cddb_disc_get_track
(
p_cdda
->
cddb
.
disc
,
i
);
if
(
t
!=
NULL
)
{
add_info_str
(
psz_track
,
"Artist (CDDB)"
,
cddb_track_get_artist
(
t
));
add_info_str
(
psz_track
,
"Title (CDDB)"
,
cddb_track_get_title
(
t
));
add_info_str
(
psz_track
,
"Extended Data (CDDB)"
,
cddb_track_get_ext_data
(
t
));
}
}
#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
...
...
@@ -451,20 +447,19 @@ CDDAMetaInfo( access_t *p_access, track_t i_track )
different things. In either case, we may have customized to
put in the track name.
*/
if
(
CDIO_INVALID_TRACK
!=
i_track
)
{
char
*
psz_name
=
CDDAFormatTitle
(
p_access
,
i_track
)
;
if
(
!
p_cdda
->
b_nav_mode
)
{
add_meta_val
(
vlc_meta_Title
,
psz_name
);
}
else
if
(
CDIO_INVALID_TRACK
!=
i_track
)
{
input_Control
(
p_cdda
->
p_input
,
INPUT_SET_NAME
,
psz_name
);
free
(
psz_name
);
char
*
psz_name
=
CDDAFormatTitle
(
p_access
,
i_track
)
;
if
(
!
p_cdda
->
b_nav_mode
)
{
add_meta_val
(
vlc_meta_Title
,
psz_name
);
}
else
{
input_Control
(
p_cdda
->
p_input
,
INPUT_SET_NAME
,
psz_name
);
free
(
psz_name
);
}
if
(
psz_meta_artist
)
add_meta_val
(
vlc_meta_Artist
,
psz_meta_artist
);
}
if
(
psz_meta_artist
)
add_meta_val
(
vlc_meta_Artist
,
psz_meta_artist
);
}
}
}
...
...
@@ -502,10 +497,10 @@ cdda_data_t *p_cdda, char *psz_cdtext)
/* We either don't have CD-Text info, or we do but we prefer to get CDDB
which means CDDB has been enabled and we were able to retrieve the info.*/
#ifdef HAVE_LIBCDDB
return
!
psz_cdtext
||
(
!
p_cdda
->
b_cdtext_prefer
&&
p_cdda
->
b_cddb_enabled
&&
p_cdda
->
cddb
.
disc
);
return
!
psz_cdtext
||
(
!
p_cdda
->
b_cdtext_prefer
&&
p_cdda
->
b_cddb_enabled
&&
p_cdda
->
cddb
.
disc
);
#else
return
false
;
return
false
;
#endif
}
...
...
@@ -570,16 +565,16 @@ CDDAFormatStr( const access_t *p_access, cdda_data_t *p_cdda,
case
'a'
:
if
(
p_cdda
->
p_cdtext
[
0
]
&&
p_cdda
->
p_cdtext
[
0
]
->
field
[
CDTEXT_PERFORMER
])
psz
=
p_cdda
->
p_cdtext
[
0
]
->
field
[
CDTEXT_PERFORMER
];
psz
=
p_cdda
->
p_cdtext
[
0
]
->
field
[
CDTEXT_PERFORMER
];
if
(
want_cddb_info
(
p_cdda
,
psz
))
psz
=
(
char
*
)
cddb_disc_get_artist
(
p_cdda
->
cddb
.
disc
);
psz
=
(
char
*
)
cddb_disc_get_artist
(
p_cdda
->
cddb
.
disc
);
goto
format_str
;
case
'A'
:
if
(
p_cdda
->
p_cdtext
[
0
]
&&
p_cdda
->
p_cdtext
[
0
]
->
field
[
CDTEXT_TITLE
])
psz
=
p_cdda
->
p_cdtext
[
0
]
->
field
[
CDTEXT_TITLE
];
if
(
want_cddb_info
(
p_cdda
,
psz
))
psz
=
(
char
*
)
cddb_disc_get_title
(
p_cdda
->
cddb
.
disc
);
psz
=
p_cdda
->
p_cdtext
[
0
]
->
field
[
CDTEXT_TITLE
];
if
(
want_cddb_info
(
p_cdda
,
psz
))
psz
=
(
char
*
)
cddb_disc_get_title
(
p_cdda
->
cddb
.
disc
);
goto
format_str
;
case
'C'
:
if
(
!
p_cdda
->
b_cddb_enabled
)
goto
not_special
;
...
...
@@ -589,18 +584,18 @@ CDDAFormatStr( const access_t *p_access, cdda_data_t *p_cdda,
case
'G'
:
if
(
p_cdda
->
p_cdtext
[
0
]
&&
p_cdda
->
p_cdtext
[
0
]
->
field
[
CDTEXT_GENRE
])
psz
=
p_cdda
->
p_cdtext
[
0
]
->
field
[
CDTEXT_GENRE
];
psz
=
p_cdda
->
p_cdtext
[
0
]
->
field
[
CDTEXT_GENRE
];
if
(
want_cddb_info
(
p_cdda
,
psz
))
psz
=
(
char
*
)
cddb_disc_get_genre
(
p_cdda
->
cddb
.
disc
);
psz
=
(
char
*
)
cddb_disc_get_genre
(
p_cdda
->
cddb
.
disc
);
goto
format_str
;
case
'I'
:
if
(
p_cdda
->
p_cdtext
[
0
]
&&
p_cdda
->
p_cdtext
[
0
]
->
field
[
CDTEXT_DISCID
])
psz
=
p_cdda
->
p_cdtext
[
0
]
->
field
[
CDTEXT_DISCID
];
psz
=
p_cdda
->
p_cdtext
[
0
]
->
field
[
CDTEXT_DISCID
];
if
(
want_cddb_info
(
p_cdda
,
psz
))
{
add_format_num_info
(
cddb_disc_get_discid
(
p_cdda
->
cddb
.
disc
),
"%x"
);
add_format_num_info
(
cddb_disc_get_discid
(
p_cdda
->
cddb
.
disc
),
"%x"
);
}
else
if
(
psz
)
add_format_str_info
(
psz
);
add_format_str_info
(
psz
);
break
;
case
'Y'
:
if
(
!
p_cdda
->
b_cddb_enabled
)
goto
not_special
;
...
...
@@ -619,132 +614,135 @@ CDDAFormatStr( const access_t *p_access, cdda_data_t *p_cdda,
}
else
{
add_format_str_info
(
psz_mrl
);
}
}
else
{
if
(
p_cdda
->
p_cdtext
[
i_track
]
&&
p_cdda
->
p_cdtext
[
i_track
]
->
field
[
CDTEXT_TITLE
])
{
add_format_str_info
(
p_cdda
->
p_cdtext
[
i_track
]
->
field
[
CDTEXT_TITLE
]);
}
else
add_format_str_info
(
psz_mrl
);
}
}
else
{
if
(
p_cdda
->
p_cdtext
[
i_track
]
&&
p_cdda
->
p_cdtext
[
i_track
]
->
field
[
CDTEXT_TITLE
])
{
add_format_str_info
(
p_cdda
->
p_cdtext
[
i_track
]
->
field
[
CDTEXT_TITLE
]);
}
else
add_format_str_info
(
psz_mrl
);
}
break
;
case
'p'
:
if
(
CDIO_INVALID_TRACK
==
i_track
)
break
;
if
(
p_cdda
->
p_cdtext
[
i_track
]
&&
p_cdda
->
p_cdtext
[
i_track
]
->
field
[
CDTEXT_PERFORMER
])
psz
=
p_cdda
->
p_cdtext
[
i_track
]
->
field
[
CDTEXT_PERFORMER
];
if
(
want_cddb_info
(
p_cdda
,
psz
))
{
cddb_track_t
*
t
=
cddb_disc_get_track
(
p_cdda
->
cddb
.
disc
,
i_track
-
1
);
if
(
t
!=
NULL
&&
cddb_track_get_artist
(
t
)
!=
NULL
)
psz
=
(
char
*
)
cddb_track_get_artist
(
t
);
}
goto
format_str
;
case
'e'
:
if
(
CDIO_INVALID_TRACK
==
i_track
)
break
;
if
(
p_cdda
->
p_cdtext
[
i_track
]
&&
p_cdda
->
p_cdtext
[
i_track
]
->
field
[
CDTEXT_MESSAGE
])
psz
=
p_cdda
->
p_cdtext
[
i_track
]
->
field
[
CDTEXT_MESSAGE
];
if
(
want_cddb_info
(
p_cdda
,
psz
))
case
'p'
:
if
(
CDIO_INVALID_TRACK
==
i_track
)
break
;
if
(
p_cdda
->
p_cdtext
[
i_track
]
&&
p_cdda
->
p_cdtext
[
i_track
]
->
field
[
CDTEXT_PERFORMER
])
psz
=
p_cdda
->
p_cdtext
[
i_track
]
->
field
[
CDTEXT_PERFORMER
];
if
(
want_cddb_info
(
p_cdda
,
psz
))
{
cddb_track_t
*
t
=
cddb_disc_get_track
(
p_cdda
->
cddb
.
disc
,
i_track
-
1
);
if
(
t
!=
NULL
&&
cddb_track_get_
ext_data
(
t
)
!=
NULL
)
psz
=
(
char
*
)
cddb_track_get_ext_data
(
t
);
i_track
-
1
);
if
(
t
!=
NULL
&&
cddb_track_get_
artist
(
t
)
!=
NULL
)
psz
=
(
char
*
)
cddb_track_get_artist
(
t
);
}
goto
format_str
;
goto
format_str
;
case
'e'
:
if
(
CDIO_INVALID_TRACK
==
i_track
)
break
;
if
(
p_cdda
->
p_cdtext
[
i_track
]
&&
p_cdda
->
p_cdtext
[
i_track
]
->
field
[
CDTEXT_MESSAGE
])
psz
=
p_cdda
->
p_cdtext
[
i_track
]
->
field
[
CDTEXT_MESSAGE
];
if
(
want_cddb_info
(
p_cdda
,
psz
))
{
cddb_track_t
*
t
=
cddb_disc_get_track
(
p_cdda
->
cddb
.
disc
,
i_track
-
1
);
if
(
t
!=
NULL
&&
cddb_track_get_ext_data
(
t
)
!=
NULL
)
psz
=
(
char
*
)
cddb_track_get_ext_data
(
t
);
}
goto
format_str
;
break
;
#else
case
'a'
:
if
(
p_cdda
->
p_cdtext
[
0
]
&&
p_cdda
->
p_cdtext
[
0
]
->
field
[
CDTEXT_PERFORMER
])
psz
=
p_cdda
->
p_cdtext
[
0
]
->
field
[
CDTEXT_PERFORMER
];
goto
format_str
;
if
(
p_cdda
->
p_cdtext
[
0
]
&&
p_cdda
->
p_cdtext
[
0
]
->
field
[
CDTEXT_PERFORMER
])
psz
=
p_cdda
->
p_cdtext
[
0
]
->
field
[
CDTEXT_PERFORMER
];
goto
format_str
;
case
'A'
:
if
(
p_cdda
->
p_cdtext
[
0
]
&&
p_cdda
->
p_cdtext
[
0
]
->
field
[
CDTEXT_TITLE
])
psz
=
p_cdda
->
p_cdtext
[
0
]
->
field
[
CDTEXT_TITLE
];
if
(
p_cdda
->
p_cdtext
[
0
]
&&
p_cdda
->
p_cdtext
[
0
]
->
field
[
CDTEXT_TITLE
])
psz
=
p_cdda
->
p_cdtext
[
0
]
->
field
[
CDTEXT_TITLE
];
goto
format_str
;
case
'G'
:
if
(
p_cdda
->
p_cdtext
[
0
]
&&
p_cdda
->
p_cdtext
[
0
]
->
field
[
CDTEXT_GENRE
])
psz
=
p_cdda
->
p_cdtext
[
0
]
->
field
[
CDTEXT_GENRE
];
goto
format_str
;
if
(
p_cdda
->
p_cdtext
[
0
]
&&
p_cdda
->
p_cdtext
[
0
]
->
field
[
CDTEXT_GENRE
])
psz
=
p_cdda
->
p_cdtext
[
0
]
->
field
[
CDTEXT_GENRE
];
goto
format_str
;
case
'I'
:
if
(
p_cdda
->
p_cdtext
[
0
]
&&
p_cdda
->
p_cdtext
[
0
]
->
field
[
CDTEXT_DISCID
])
add_format_str_info
(
p_cdda
->
p_cdtext
[
0
]
->
field
[
CDTEXT_DISCID
]);
if
(
p_cdda
->
p_cdtext
[
0
]
&&
p_cdda
->
p_cdtext
[
0
]
->
field
[
CDTEXT_DISCID
])
add_format_str_info
(
p_cdda
->
p_cdtext
[
0
]
->
field
[
CDTEXT_DISCID
]);
break
;
case
'p'
:
if
(
CDIO_INVALID_TRACK
==
i_track
)
break
;
if
(
p_cdda
->
p_cdtext
[
i_track
]
&&
p_cdda
->
p_cdtext
[
i_track
]
->
field
[
CDTEXT_PERFORMER
])
psz
=
p_cdda
->
p_cdtext
[
i_track
]
->
field
[
CDTEXT_PERFORMER
];
goto
format_str
;
case
'p'
:
if
(
CDIO_INVALID_TRACK
==
i_track
)
break
;
if
(
p_cdda
->
p_cdtext
[
i_track
]
&&
p_cdda
->
p_cdtext
[
i_track
]
->
field
[
CDTEXT_PERFORMER
])
psz
=
p_cdda
->
p_cdtext
[
i_track
]
->
field
[
CDTEXT_PERFORMER
];
goto
format_str
;
case
't'
:
if
(
CDIO_INVALID_TRACK
==
i_track
)
break
;
if
(
p_cdda
->
p_cdtext
[
i_track
]
&&
p_cdda
->
p_cdtext
[
i_track
]
->
field
[
CDTEXT_TITLE
])
psz
=
p_cdda
->
p_cdtext
[
i_track
]
->
field
[
CDTEXT_TITLE
];
else
psz
=
psz_mrl
;
if
(
CDIO_INVALID_TRACK
==
i_track
)
break
;
if
(
p_cdda
->
p_cdtext
[
i_track
]
&&
p_cdda
->
p_cdtext
[
i_track
]
->
field
[
CDTEXT_TITLE
])
psz
=
p_cdda
->
p_cdtext
[
i_track
]
->
field
[
CDTEXT_TITLE
];
else
psz
=
psz_mrl
;
goto
format_str
;
case
'e'
:
if
(
CDIO_INVALID_TRACK
==
i_track
)
break
;
if
(
p_cdda
->
p_cdtext
[
i_track
]
&&
p_cdda
->
p_cdtext
[
i_track
]
->
field
[
CDTEXT_MESSAGE
])
psz
=
p_cdda
->
p_cdtext
[
i_track
]
->
field
[
CDTEXT_MESSAGE
];
goto
format_str
;
if
(
CDIO_INVALID_TRACK
==
i_track
)
break
;
if
(
p_cdda
->
p_cdtext
[
i_track
]
&&
p_cdda
->
p_cdtext
[
i_track
]
->
field
[
CDTEXT_MESSAGE
])
psz
=
p_cdda
->
p_cdtext
[
i_track
]
->
field
[
CDTEXT_MESSAGE
];
goto
format_str
;
break
;
#endif
/*HAVE_LIBCDDB*/
case
's'
:
if
(
CDIO_INVALID_TRACK
!=
i_track
)
if
(
CDIO_INVALID_TRACK
!=
i_track
)
{
char
psz_buffer
[
MSTRTIME_MAX_SIZE
];
unsigned
int
i_track_frames
=
cdio_get_track_sec_count
(
p_cdda
->
p_cdio
,
i_track
);
unsigned
int
i_track_frames
=
cdio_get_track_sec_count
(
p_cdda
->
p_cdio
,
i_track
);
mtime_t
i_duration
=
i_track_frames
/
CDIO_CD_FRAMES_PER_SEC
;
i_track_frames
/
CDIO_CD_FRAMES_PER_SEC
;
add_format_str_info
(
secstotimestr
(
psz_buffer
,
i_duration
)
);
break
;
break
;
}
/* Fall through to disc duration if CDIO_INVALID_TRACK */
/* Fall through to disc duration if CDIO_INVALID_TRACK */
case
'S'
:
{
char
psz_buffer
[
MSTRTIME_MAX_SIZE
];
unsigned
int
i_track_frames
=
cdio_get_track_lba
(
p_cdda
->
p_cdio
,
CDIO_CDROM_LEADOUT_TRACK
);
unsigned
int
i_track_frames
=
cdio_get_track_lba
(
p_cdda
->
p_cdio
,
CDIO_CDROM_LEADOUT_TRACK
);
mtime_t
i_duration
=
i_track_frames
/
CDIO_CD_FRAMES_PER_SEC
;
i_track_frames
/
CDIO_CD_FRAMES_PER_SEC
;
add_format_str_info
(
secstotimestr
(
psz_buffer
,
i_duration
)
);
break
;
break
;
}
case
'M'
:
add_format_str_info
(
psz_mrl
);
break
;
add_format_str_info
(
psz_mrl
);
break
;
case
'm'
:
add_format_str_info
(
p_cdda
->
psz_mcn
);
break
;
add_format_str_info
(
p_cdda
->
psz_mcn
);
break
;
case
'n'
:
add_format_num_info
(
p_cdda
->
i_tracks
,
"%d"
);
break
;
add_format_num_info
(
p_cdda
->
i_tracks
,
"%d"
);
break
;
case
'T'
:
add_format_num_info
(
i_track
,
"%02d"
);
break
;
format_str:
if
(
psz
)
add_format_str_info
(
psz
);
break
;
add_format_num_info
(
i_track
,
"%02d"
);
break
;
format_str:
if
(
psz
)
add_format_str_info
(
psz
);
break
;
#ifdef HAVE_LIBCDDB
not_special:
#endif
...
...
@@ -767,7 +765,7 @@ CDDAFormatMRL( const access_t *p_access, track_t i_track )
+
strlen
(
p_cdda
->
psz_source
)
+
+
strlen
(
"@T"
)
+
strlen
(
"100"
)
+
1
;
char
*
psz_mrl
=
calloc
(
1
,
psz_mrl_max
);
if
(
CDIO_INVALID_TRACK
==
i_track
)
snprintf
(
psz_mrl
,
psz_mrl_max
,
"%s%s"
,
CDDA_MRL_PREFIX
,
p_cdda
->
psz_source
);
...
...
@@ -792,17 +790,17 @@ CDDAFormatTitle( const access_t *p_access, track_t i_track )
{
char
*
psz_name
;
#ifdef HAVE_LIBCDDB
if
(
p_cdda
->
b_cddb_enabled
)
{
config_varname
=
MODULE_STRING
"-cddb-title-format"
;
}
if
(
p_cdda
->
b_cddb_enabled
)
{
config_varname
=
MODULE_STRING
"-cddb-title-format"
;
}
#endif
/*HAVE_LIBCDDB*/
psz_name
=
CDDAFormatStr
(
p_access
,
p_cdda
,
config_GetPsz
(
p_access
,
config_varname
),
psz_mrl
,
i_track
);
free
(
psz_mrl
);
return
psz_name
;
psz_name
=
CDDAFormatStr
(
p_access
,
p_cdda
,
config_GetPsz
(
p_access
,
config_varname
),
psz_mrl
,
i_track
);
free
(
psz_mrl
);
return
psz_name
;
}
return
(
NULL
);
}
...
...
@@ -813,8 +811,8 @@ CDDACreatePlaylistItem( const access_t *p_access, cdda_data_t *p_cdda,
track_t
i_track
)
{
unsigned
int
i_track_frames
=
cdio_get_track_lsn
(
p_cdda
->
p_cdio
,
i_track
+
1
)
-
cdio_get_track_lsn
(
p_cdda
->
p_cdio
,
i_track
);
cdio_get_track_lsn
(
p_cdda
->
p_cdio
,
i_track
+
1
)
-
cdio_get_track_lsn
(
p_cdda
->
p_cdio
,
i_track
);
mtime_t
i_mduration
=
i_track_frames
*
(
CLOCK_FREQ
/
CDIO_CD_FRAMES_PER_SEC
)
;
char
*
psz_title
=
NULL
;
char
*
psz_mrl
=
NULL
;
...
...
@@ -898,41 +896,40 @@ CDDAFixupPlaylist( access_t *p_access, cdda_data_t *p_cdda,
more mature.
*/
track_t
i_track
=
p_cdda
->
i_track
;
unsigned
int
i_track_frames
=
cdio_get_track_sec_count
(
p_cdda
->
p_cdio
,
i_track
);
unsigned
int
i_track_frames
=
cdio_get_track_sec_count
(
p_cdda
->
p_cdio
,
i_track
);
input_title_t
*
t
=
p_cdda
->
p_title
[
0
]
=
//i_track-i_first_track] =
vlc_input_title_New
();
asprintf
(
&
t
->
psz_name
,
_
(
"Track %i"
),
i_track
);
t
->
i_size
=
i_track_frames
*
(
int64_t
)
CDIO_CD_FRAMESIZE_RAW
;
t
->
i_length
=
INT64_C
(
1000000
)
*
t
->
i_size
/
CDDA_FREQUENCY_SAMPLE
/
4
;
if
(
p_item
)
{
input_item_SetDuration
(
p_item
->
p_input
,
(
mtime_t
)
i_track_frames
*
(
CLOCK_FREQ
/
CDIO_CD_FRAMES_PER_SEC
)
);
input_item_SetURI
(
p_item
->
p_input
,
CDDAFormatMRL
(
p_access
,
i_track
)
);
}
if
(
p_item
)
{
input_item_SetDuration
(
p_item
->
p_input
,
(
mtime_t
)
i_track_frames
*
(
CLOCK_FREQ
/
CDIO_CD_FRAMES_PER_SEC
)
);
input_item_SetURI
(
p_item
->
p_input
,
CDDAFormatMRL
(
p_access
,
i_track
)
);
}
p_cdda
->
i_titles
=
1
;
p_access
->
info
.
i_update
=
INPUT_UPDATE_TITLE
;
p_access
->
info
.
i_update
=
INPUT_UPDATE_TITLE
;
}
else
{
input_title_t
*
t
;
input_title_t
*
t
;
if
(
!
p_cdda
->
b_nav_mode
)
playlist_ItemToNode
(
p_playlist
,
p_item
,
false
);
if
(
!
p_cdda
->
b_nav_mode
)
playlist_ItemToNode
(
p_playlist
,
p_item
,
false
);
for
(
i
=
0
;
i
<
p_cdda
->
i_tracks
;
i
++
)
{
playlist_item_t
*
p_child
;
const
track_t
i_track
=
i_first_track
+
i
;
unsigned
int
i_track_frames
=
cdio_get_track_sec_count
(
p_cdda
->
p_cdio
,
i_track
);
unsigned
int
i_track_frames
=
cdio_get_track_sec_count
(
p_cdda
->
p_cdio
,
i_track
);
t
=
p_cdda
->
p_title
[
i
]
=
vlc_input_title_New
();
...
...
@@ -940,26 +937,25 @@ CDDAFixupPlaylist( access_t *p_access, cdda_data_t *p_cdda,
t
->
i_size
=
i_track_frames
*
(
int64_t
)
CDIO_CD_FRAMESIZE_RAW
;
t
->
i_length
=
INT64_C
(
1000000
)
*
t
->
i_size
/
CDDA_FREQUENCY_SAMPLE
/
4
;
/
CDDA_FREQUENCY_SAMPLE
/
4
;
if
(
!
p_cdda
->
b_nav_mode
)
{
p_child
=
CDDACreatePlaylistItem
(
p_access
,
p_cdda
,
p_playlist
,
p_item
,
i_track
);
}
if
(
!
p_cdda
->
b_nav_mode
)
{
p_child
=
CDDACreatePlaylistItem
(
p_access
,
p_cdda
,
p_playlist
,
p_item
,
i_track
);
}
}
p_cdda
->
i_titles
=
p_cdda
->
i_tracks
;
p_access
->
info
.
i_update
|=
INPUT_UPDATE_TITLE
|
INPUT_UPDATE_SIZE
;
if
(
p_item
)
p_access
->
info
.
i_update
|=
INPUT_UPDATE_TITLE
|
INPUT_UPDATE_SIZE
;
if
(
p_item
)
{
input_item_SetDuration
(
p_item
->
p_input
,
(
mtime_t
)
p_access
->
info
.
i_size
input_item_SetDuration
(
p_item
->
p_input
,
(
mtime_t
)
p_access
->
info
.
i_size
*
(
CLOCK_FREQ
/
CDIO_CD_FRAMES_PER_SEC
)
);
input_item_SetURI
(
p_item
->
p_input
,
CDDAFormatMRL
(
p_access
,
p_cdda
->
i_track
)
);
}
}
}
if
(
b_play
)
{
...
...
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