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
9f2442c9
Commit
9f2442c9
authored
Oct 24, 2012
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ogg: Parse chapters in comments
Ref #6895 Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
1009e7f5
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
5 deletions
+38
-5
modules/demux/flac.c
modules/demux/flac.c
+1
-1
modules/demux/ogg.c
modules/demux/ogg.c
+5
-1
modules/demux/ogg.h
modules/demux/ogg.h
+2
-1
modules/demux/vorbis.h
modules/demux/vorbis.h
+30
-2
No files found.
modules/demux/flac.c
View file @
9f2442c9
...
...
@@ -578,7 +578,7 @@ static void ParseComment( demux_t *p_demux, const uint8_t *p_data, int i_data )
if
(
i_data
<
4
)
return
;
vorbis_ParseComment
(
&
p_sys
->
p_meta
,
&
p_data
[
4
],
i_data
-
4
,
NULL
,
NULL
);
vorbis_ParseComment
(
&
p_sys
->
p_meta
,
&
p_data
[
4
],
i_data
-
4
,
NULL
,
NULL
,
NULL
,
NULL
);
}
...
...
modules/demux/ogg.c
View file @
9f2442c9
...
...
@@ -188,6 +188,7 @@ static int Open( vlc_object_t * p_this )
/* */
p_sys
->
p_meta
=
NULL
;
TAB_INIT
(
p_sys
->
i_seekpoints
,
p_sys
->
pp_seekpoints
);
return
VLC_SUCCESS
;
}
...
...
@@ -208,6 +209,8 @@ static void Close( vlc_object_t *p_this )
if
(
p_sys
->
p_old_stream
)
Ogg_LogicalStreamDelete
(
p_demux
,
p_sys
->
p_old_stream
);
TAB_CLEAN
(
p_sys
->
i_seekpoints
,
p_sys
->
pp_seekpoints
);
free
(
p_sys
);
}
...
...
@@ -1783,7 +1786,8 @@ static void Ogg_ExtractXiphMeta( demux_t *p_demux, const void *p_headers, unsign
/* TODO how to handle multiple comments properly ? */
if
(
i_count
>=
2
&&
pi_size
[
1
]
>
i_skip
)
vorbis_ParseComment
(
&
p_ogg
->
p_meta
,
(
uint8_t
*
)
pp_data
[
1
]
+
i_skip
,
pi_size
[
1
]
-
i_skip
,
&
p_ogg
->
i_attachments
,
&
p_ogg
->
attachments
);
&
p_ogg
->
i_attachments
,
&
p_ogg
->
attachments
,
&
p_ogg
->
i_seekpoints
,
&
p_ogg
->
pp_seekpoints
);
for
(
unsigned
i
=
0
;
i
<
i_count
;
i
++
)
free
(
pp_data
[
i
]
);
...
...
modules/demux/ogg.h
View file @
9f2442c9
...
...
@@ -133,9 +133,10 @@ struct demux_sys_t
mtime_t
i_st_pts
;
/* */
vlc_meta_t
*
p_meta
;
int
i_seekpoints
;
seekpoint_t
**
pp_seekpoints
;
/* */
int
i_attachments
;
...
...
modules/demux/vorbis.h
View file @
9f2442c9
...
...
@@ -23,6 +23,7 @@
#include <vlc_charset.h>
#include <vlc_strings.h>
#include <vlc_input.h>
static
input_attachment_t
*
ParseFlacPicture
(
const
uint8_t
*
p_data
,
int
i_data
,
int
i_attachments
,
int
*
i_type
)
{
...
...
@@ -70,8 +71,10 @@ error:
return
p_attachment
;
}
static
inline
void
vorbis_ParseComment
(
vlc_meta_t
**
pp_meta
,
const
uint8_t
*
p_data
,
int
i_data
,
int
*
i_attachments
,
input_attachment_t
***
attachments
)
static
inline
void
vorbis_ParseComment
(
vlc_meta_t
**
pp_meta
,
const
uint8_t
*
p_data
,
int
i_data
,
int
*
i_attachments
,
input_attachment_t
***
attachments
,
int
*
i_seekpoint
,
seekpoint_t
***
ppp_seekpoint
)
{
int
n
;
int
i_comment
;
...
...
@@ -185,6 +188,31 @@ static inline void vorbis_ParseComment( vlc_meta_t **pp_meta, const uint8_t *p_d
*
i_attachments
,
*
attachments
,
p_attachment
);
}
}
else
if
(
!
strncasecmp
(
psz_comment
,
"chapter"
,
strlen
(
"chapter"
))
)
{
if
(
ppp_seekpoint
==
NULL
)
continue
;
int
i_chapt
;
if
(
strstr
(
psz_comment
,
"name"
)
&&
sscanf
(
psz_comment
,
"chapter%i="
,
&
i_chapt
)
==
1
)
{
char
*
p
=
strchr
(
psz_comment
,
'='
);
*
p
++
=
'\0'
;
}
else
if
(
sscanf
(
psz_comment
,
"chapter %i="
,
&
i_chapt
)
==
1
)
{
int
h
,
m
,
s
,
ms
;
char
*
p
=
strchr
(
psz_comment
,
'='
);
*
p
++
=
'\0'
;
if
(
sscanf
(
p
,
"%d:%d:%d.%d"
,
&
h
,
&
m
,
&
s
,
&
ms
)
==
4
)
{
seekpoint_t
*
sk
=
vlc_seekpoint_New
();
sk
->
i_time_offset
=
((
h
*
3600
+
m
*
60
+
s
)
*
1000
+
ms
)
*
1000
;
TAB_APPEND_CAST
(
(
seekpoint_t
**
),
*
i_seekpoint
,
*
ppp_seekpoint
,
sk
);
}
}
}
else
if
(
strchr
(
psz_comment
,
'='
)
)
{
/* generic (PERFORMER/LICENSE/ORGANIZATION/LOCATION/CONTACT/ISRC,
...
...
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