Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
d5c128a3
Commit
d5c128a3
authored
Mar 23, 2007
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-extended vlc_meta_t.
parent
a7dbb480
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
30 deletions
+46
-30
include/vlc_meta.h
include/vlc_meta.h
+46
-30
No files found.
include/vlc_meta.h
View file @
d5c128a3
...
...
@@ -76,22 +76,18 @@ struct vlc_meta_t
char
*
psz_encodedby
;
char
*
psz_arturl
;
char
*
psz_trackid
;
#if 0 //not used
char *psz_artistid
;
char *
psz_albumid
;
#endif
int
i_extra
;
char
*
*
ppsz_extra_name
;
char
**
ppsz_extra_value
;
int
i_status
;
#if 0
/* track meta information */
int i_track;
vlc_meta_t **track;
#endif
};
#define vlc_meta_Set( meta,var,val ) { \
#define vlc_meta_Set( meta,var,val )
do
{ \
if( meta->psz_##var ) free( meta->psz_##var ); \
meta->psz_##var =
strdup( val ); }
meta->psz_##var =
(val) ? strdup( val ) : NULL; } while(0)
#define vlc_meta_SetTitle( meta, b ) vlc_meta_Set( meta, title, b );
#define vlc_meta_SetArtist( meta, b ) vlc_meta_Set( meta, artist, b );
...
...
@@ -110,11 +106,6 @@ struct vlc_meta_t
#define vlc_meta_SetEncodedBy( meta, b ) vlc_meta_Set( meta, encodedby, b );
#define vlc_meta_SetArtURL( meta, b ) vlc_meta_Set( meta, arturl, b );
#define vlc_meta_SetTrackID( meta, b ) vlc_meta_Set( meta, trackid, b );
#if 0 //not used
#define vlc_meta_SetArtistID( meta, b ) vlc_meta_Set( meta, artistid, b );
#define vlc_meta_SetAlbumID( meta, b ) vlc_meta_Set( meta, albumid, b );
#endif
static
inline
vlc_meta_t
*
vlc_meta_New
(
void
)
{
...
...
@@ -137,16 +128,19 @@ static inline vlc_meta_t *vlc_meta_New( void )
m
->
psz_encodedby
=
NULL
;
m
->
psz_arturl
=
NULL
;
m
->
psz_trackid
=
NULL
;
#if 0 //not used
m->psz_artistid = NULL;
m->psz_albumid = NULL;
#endif
m
->
i_extra
=
0
;
m
->
ppsz_extra_name
=
NULL
;
m
->
ppsz_extra_value
=
NULL
;
m
->
i_status
=
0
;
return
m
;
}
static
inline
void
vlc_meta_Delete
(
vlc_meta_t
*
m
)
{
int
i
;
free
(
m
->
psz_title
);
free
(
m
->
psz_artist
);
free
(
m
->
psz_genre
);
...
...
@@ -163,17 +157,27 @@ static inline void vlc_meta_Delete( vlc_meta_t *m )
free
(
m
->
psz_publisher
);
free
(
m
->
psz_encodedby
);
free
(
m
->
psz_trackid
);
#if 0 //not used
free( m->psz_artistid );
free( m->psz_albumid );
#endif
free
(
m
->
psz_arturl
);
for
(
i
=
0
;
i
<
m
->
i_extra
;
i
++
)
{
free
(
m
->
ppsz_extra_name
[
i
]
);
free
(
m
->
ppsz_extra_value
[
i
]
);
}
free
(
m
->
ppsz_extra_name
);
free
(
m
->
ppsz_extra_value
);
free
(
m
);
}
static
inline
void
vlc_meta_AddExtra
(
vlc_meta_t
*
m
,
const
char
*
psz_name
,
const
char
*
psz_value
)
{
int
i_extra
=
m
->
i_extra
;
TAB_APPEND_CPP
(
char
,
m
->
i_extra
,
m
->
ppsz_extra_name
,
strdup
(
psz_name
)
);
TAB_APPEND_CPP
(
char
,
i_extra
,
m
->
ppsz_extra_value
,
strdup
(
psz_value
)
);
}
static
inline
void
vlc_meta_Merge
(
vlc_meta_t
*
dst
,
vlc_meta_t
*
src
)
static
inline
void
vlc_meta_Merge
(
vlc_meta_t
*
dst
,
const
vlc_meta_t
*
src
)
{
int
i
;
if
(
!
dst
||
!
src
)
return
;
#define COPY_FIELD( a ) \
if( src->psz_ ## a ) { \
...
...
@@ -196,13 +200,25 @@ static inline void vlc_meta_Merge( vlc_meta_t *dst, vlc_meta_t *src )
COPY_FIELD
(
publisher
);
COPY_FIELD
(
encodedby
);
COPY_FIELD
(
trackid
);
#if 0 //not used
COPY_FIELD( artistid );
COPY_FIELD( albumid );
#endif
COPY_FIELD
(
arturl
);
#undef COPY_FIELD
for
(
i
=
0
;
i
<
src
->
i_extra
;
i
++
)
{
int
j
;
for
(
j
=
0
;
j
<
dst
->
i_extra
;
j
++
)
{
if
(
!
strcmp
(
dst
->
ppsz_extra_name
[
i
],
src
->
ppsz_extra_name
[
i
]
)
)
{
free
(
dst
->
ppsz_extra_value
[
i
]
);
dst
->
ppsz_extra_value
[
i
]
=
strdup
(
src
->
ppsz_extra_value
[
i
]
);
break
;
}
if
(
j
>=
dst
->
i_extra
)
vlc_meta_AddExtra
(
dst
,
src
->
ppsz_extra_name
[
i
],
src
->
ppsz_extra_value
[
i
]
);
}
}
}
/** \todo Track meta */
enum
{
ALBUM_ART_WHEN_ASKED
,
...
...
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