Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
07ed191b
Commit
07ed191b
authored
Oct 27, 2012
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parse ID3v2 chapters
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
3f448094
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
id3v2.c
libavformat/id3v2.c
+31
-0
No files found.
libavformat/id3v2.c
View file @
07ed191b
...
...
@@ -508,6 +508,36 @@ fail:
avio_seek
(
pb
,
end
,
SEEK_SET
);
}
static
void
read_chapter
(
AVFormatContext
*
s
,
AVIOContext
*
pb
,
int
taglen
,
char
*
tag
,
ID3v2ExtraMeta
**
extra_meta
)
{
AVRational
time_base
=
{
1
,
1000
};
char
title
[
1024
];
uint32_t
start
,
end
;
taglen
-=
avio_get_str
(
pb
,
taglen
,
title
,
sizeof
(
title
));
if
(
taglen
<
16
)
return
;
start
=
avio_rb32
(
pb
);
end
=
avio_rb32
(
pb
);
taglen
-=
27
;
if
(
taglen
>
0
)
{
char
tag
[
4
];
avio_skip
(
pb
,
8
);
avio_read
(
pb
,
tag
,
4
);
if
(
!
memcmp
(
tag
,
"TIT2"
,
4
))
{
taglen
=
FFMIN
(
taglen
,
avio_rb32
(
pb
));
if
(
taglen
<
0
)
return
;
avio_skip
(
pb
,
3
);
avio_get_str
(
pb
,
taglen
,
title
,
sizeof
(
title
));
}
}
avpriv_new_chapter
(
s
,
s
->
nb_chapters
+
1
,
time_base
,
start
,
end
,
title
);
}
typedef
struct
ID3v2EMFunc
{
const
char
*
tag3
;
const
char
*
tag4
;
...
...
@@ -518,6 +548,7 @@ typedef struct ID3v2EMFunc {
static
const
ID3v2EMFunc
id3v2_extra_meta_funcs
[]
=
{
{
"GEO"
,
"GEOB"
,
read_geobtag
,
free_geobtag
},
{
"PIC"
,
"APIC"
,
read_apic
,
free_apic
},
{
"CHAP"
,
"CHAP"
,
read_chapter
,
NULL
},
{
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