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
affcd511
Commit
affcd511
authored
Jun 27, 2007
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Uses TagLib class to represent UTF8 strings when writing metadata
parent
661efb2e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
5 deletions
+19
-5
modules/meta_engine/taglib.cpp
modules/meta_engine/taglib.cpp
+19
-5
No files found.
modules/meta_engine/taglib.cpp
View file @
affcd511
...
...
@@ -29,6 +29,7 @@
#include <fileref.h>
#include <tag.h>
#include <tstring.h>
#include <id3v2tag.h>
#include <mpegfile.h>
#include <flacfile.h>
...
...
@@ -166,7 +167,12 @@ static int ReadMeta( vlc_object_t *p_this )
return
VLC_EGENERIC
;
}
#define SET(a,b) if(b) tag->set##a( b );
#define SET(a,b) if(b) { \
TagLib::String *psz_##a = new TagLib::String( b, \
TagLib::String::UTF8 ); \
tag->set##a( *psz_##a ); \
delete psz_##a; \
}
static
int
WriteMeta
(
vlc_object_t
*
p_this
)
{
...
...
@@ -184,18 +190,26 @@ static int WriteMeta( vlc_object_t *p_this )
if
(
!
f
.
isNull
()
&&
f
.
tag
()
)
{
msg_Dbg
(
p_this
,
"Updating metadata for %s"
,
p_export
->
psz_file
);
TagLib
::
Tag
*
tag
=
f
.
tag
();
SET
(
Artist
,
p_item
->
p_meta
->
psz_artist
);
if
(
p_item
->
p_meta
->
psz_title
)
tag
->
setTitle
(
p_item
->
p_meta
->
psz_title
);
else
tag
->
setTitle
(
p_item
->
psz_name
);
char
*
psz_titlec
=
(
p_item
->
p_meta
->
psz_title
?
p_item
->
p_meta
->
psz_title
:
p_item
->
psz_name
);
TagLib
::
String
*
psz_title
=
new
TagLib
::
String
(
psz_titlec
,
TagLib
::
String
::
UTF8
);
tag
->
setTitle
(
*
psz_title
);
delete
psz_title
;
SET
(
Album
,
p_item
->
p_meta
->
psz_album
);
SET
(
Genre
,
p_item
->
p_meta
->
psz_genre
);
if
(
p_item
->
p_meta
->
psz_date
)
tag
->
setYear
(
atoi
(
p_item
->
p_meta
->
psz_date
)
);
if
(
p_item
->
p_meta
->
psz_tracknum
)
tag
->
setTrack
(
atoi
(
p_item
->
p_meta
->
psz_tracknum
)
);
f
.
save
();
return
VLC_SUCCESS
;
}
...
...
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