Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
46bef03e
Commit
46bef03e
authored
Dec 29, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tag_id3: use GLib logging
parent
0a9f69ea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
12 deletions
+19
-12
tag_id3.c
src/tag_id3.c
+19
-12
No files found.
src/tag_id3.c
View file @
46bef03e
...
...
@@ -19,12 +19,14 @@
#include "tag_id3.h"
#include "tag.h"
#include "utils.h"
#include "log.h"
#include "conf.h"
#include <glib.h>
#include <id3tag.h>
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "id3"
# define isId3v1(tag) (id3_tag_options(tag, 0, 0) & ID3_TAG_OPTION_ID3V1)
# ifndef ID3_FRAME_COMPOSER
# define ID3_FRAME_COMPOSER "TCOM"
...
...
@@ -61,8 +63,8 @@ static id3_utf8_t * processID3FieldString (int is_id3v1, const id3_ucs4_t *ucs4,
encoding
,
"utf-8"
,
NULL
,
NULL
,
NULL
,
&
error
);
if
(
utf8
==
NULL
)
{
DEBUG
(
"Unable to convert %s string to UTF-8: "
"'%s'
\n
"
,
encoding
,
isostr
);
g_debug
(
"Unable to convert %s string to UTF-8: '%s'"
,
encoding
,
isostr
);
g_error_free
(
error
);
free
(
isostr
);
return
NULL
;
...
...
@@ -99,7 +101,7 @@ static struct tag *getID3Info(
/* Check fields in frame */
if
(
frame
->
nfields
==
0
)
{
DEBUG
(
__FILE__
": Frame has no fields
\n
"
);
g_debug
(
"Frame has no fields
"
);
return
mpdTag
;
}
...
...
@@ -114,7 +116,8 @@ static struct tag *getID3Info(
*/
if
(
frame
->
nfields
!=
2
)
{
DEBUG
(
__FILE__
": Invalid number '%i' of fields for TXX frame
\n
"
,
frame
->
nfields
);
g_debug
(
"Invalid number '%i' of fields for TXX frame"
,
frame
->
nfields
);
return
mpdTag
;
}
field
=
&
frame
->
fields
[
0
];
...
...
@@ -124,7 +127,8 @@ static struct tag *getID3Info(
*/
if
(
field
->
type
!=
ID3_FIELD_TYPE_TEXTENCODING
)
{
DEBUG
(
__FILE__
": Expected encoding, found: %i
\n
"
,
field
->
type
);
g_debug
(
"Expected encoding, found: %i"
,
field
->
type
);
}
/* Process remaining fields, should be only one */
field
=
&
frame
->
fields
[
1
];
...
...
@@ -147,7 +151,8 @@ static struct tag *getID3Info(
}
}
else
{
ERROR
(
__FILE__
": Field type not processed: %i
\n
"
,(
int
)
id3_field_gettextencoding
(
field
));
g_warning
(
"Field type not processed: %i"
,
(
int
)
id3_field_gettextencoding
(
field
));
}
}
/* A comment frame */
...
...
@@ -181,17 +186,19 @@ static struct tag *getID3Info(
}
else
{
DEBUG
(
__FILE__
": 4th field in comment frame differs from expected, got '%i': ignoring
\n
"
,
field
->
type
);
g_debug
(
"4th field in comment frame differs from expected, got '%i': ignoring"
,
field
->
type
);
}
}
else
{
DEBUG
(
__FILE__
": Invalid 'comments' tag, got '%i' fields instead of 4
\n
"
,
frame
->
nfields
);
g_debug
(
"Invalid 'comments' tag, got '%i' fields instead of 4"
,
frame
->
nfields
);
}
}
/* Unsupported */
else
{
DEBUG
(
__FILE__
": Unsupported tag type requrested
\n
"
);
g_debug
(
"Unsupported tag type requrested
"
);
return
mpdTag
;
}
...
...
@@ -337,8 +344,8 @@ struct tag *tag_id3_load(const char *file)
stream
=
fopen
(
file
,
"r"
);
if
(
!
stream
)
{
DEBUG
(
"tag_id3_load: Failed to open file: '%s', %s
\n
"
,
file
,
strerror
(
errno
));
g_debug
(
"tag_id3_load: Failed to open file: '%s', %s"
,
file
,
strerror
(
errno
));
return
NULL
;
}
...
...
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