Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
d66eff36
Commit
d66eff36
authored
Jan 19, 2011
by
Anton Khirnov
Committed by
Mans Rullgard
Jan 21, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
id3v2: use an enum for encodings instead of magic numbers.
Signed-off-by:
Mans Rullgard
<
mans@mansr.com
>
parent
c2dd0e9e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
id3v2.c
libavformat/id3v2.c
+4
-4
id3v2.h
libavformat/id3v2.h
+7
-0
No files found.
libavformat/id3v2.c
View file @
d66eff36
...
...
@@ -74,7 +74,7 @@ static void read_ttag(AVFormatContext *s, ByteIOContext *pb, int taglen, const c
switch
(
get_byte
(
pb
))
{
/* encoding type */
case
0
:
/* ISO-8859-1 (0 - 255 maps directly into unicode) */
case
ID3v2_ENCODING_ISO8859
:
q
=
dst
;
while
(
taglen
--
&&
q
-
dst
<
dstlen
-
7
)
{
uint8_t
tmp
;
...
...
@@ -83,7 +83,7 @@ static void read_ttag(AVFormatContext *s, ByteIOContext *pb, int taglen, const c
*
q
=
0
;
break
;
case
1
:
/* UTF-16 with BOM */
case
ID3v2_ENCODING_UTF16BOM
:
taglen
-=
2
;
switch
(
get_be16
(
pb
))
{
case
0xfffe
:
...
...
@@ -96,7 +96,7 @@ static void read_ttag(AVFormatContext *s, ByteIOContext *pb, int taglen, const c
}
// fall-through
case
2
:
/* UTF-16BE without BOM */
case
ID3v2_ENCODING_UTF16BE
:
q
=
dst
;
while
(
taglen
>
1
&&
q
-
dst
<
dstlen
-
7
)
{
uint32_t
ch
;
...
...
@@ -108,7 +108,7 @@ static void read_ttag(AVFormatContext *s, ByteIOContext *pb, int taglen, const c
*
q
=
0
;
break
;
case
3
:
/* UTF-8 */
case
ID3v2_ENCODING_UTF8
:
len
=
FFMIN
(
taglen
,
dstlen
);
get_buffer
(
pb
,
dst
,
len
);
dst
[
len
]
=
0
;
...
...
libavformat/id3v2.h
View file @
d66eff36
...
...
@@ -38,6 +38,13 @@
#define ID3v2_FLAG_ENCRYPTION 0x0004
#define ID3v2_FLAG_COMPRESSION 0x0008
enum
ID3v2Encoding
{
ID3v2_ENCODING_ISO8859
=
0
,
ID3v2_ENCODING_UTF16BOM
=
1
,
ID3v2_ENCODING_UTF16BE
=
2
,
ID3v2_ENCODING_UTF8
=
3
,
};
/**
* Detect ID3v2 Header.
* @param buf must be ID3v2_HEADER_SIZE byte long
...
...
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