Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
fd146628
Commit
fd146628
authored
May 11, 2012
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ASF/WMV: parser chapters
parent
535e8b60
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
10 deletions
+63
-10
modules/demux/asf/libasf.c
modules/demux/asf/libasf.c
+61
-1
modules/demux/asf/libasf.h
modules/demux/asf/libasf.h
+2
-9
No files found.
modules/demux/asf/libasf.c
View file @
fd146628
...
...
@@ -1187,6 +1187,65 @@ static void ASF_FreeObject_extended_content_description( asf_object_t *p_obj)
FREENULL
(
p_ec
->
ppsz_value
);
}
static
int
ASF_ReadObject_marker
(
stream_t
*
s
,
asf_object_t
*
p_obj
)
{
asf_object_marker_t
*
p_mk
=
(
asf_object_marker_t
*
)
p_obj
;
const
uint8_t
*
p_peek
,
*
p_data
;
int
i_peek
;
if
(
(
i_peek
=
stream_Peek
(
s
,
&
p_peek
,
p_mk
->
i_object_size
)
)
<
24
)
return
VLC_EGENERIC
;
p_data
=
&
p_peek
[
24
];
ASF_GetGUID
(
&
p_mk
->
i_reserved1
,
p_data
);
ASF_SKIP
(
16
);
p_mk
->
i_count
=
ASF_READ4
();
p_mk
->
i_reserved2
=
ASF_READ2
();
p_mk
->
name
=
ASF_READS
(
ASF_READ2
()
);
if
(
p_mk
->
i_count
>
0
)
{
p_mk
->
marker
=
calloc
(
p_mk
->
i_count
,
sizeof
(
asf_marker_t
)
);
if
(
!
p_mk
->
marker
)
return
VLC_ENOMEM
;
for
(
unsigned
i
=
0
;
i
<
p_mk
->
i_count
;
i
++
)
{
asf_marker_t
*
p_marker
=
&
p_mk
->
marker
[
i
];
if
(
!
ASF_HAVE
(
8
+
8
+
2
+
4
+
4
+
4
)
)
break
;
p_marker
->
i_offset
=
ASF_READ8
();
p_marker
->
i_presentation_time
=
ASF_READ8
();
p_marker
->
i_entry_length
=
ASF_READ2
();
p_marker
->
i_send_time
=
ASF_READ4
();
p_marker
->
i_flags
=
ASF_READ4
();
p_marker
->
i_marker_description_length
=
ASF_READ4
();
p_marker
->
p_marker_description
=
ASF_READS
(
p_marker
->
i_marker_description_length
*
2
);
}
}
#ifdef ASF_DEBUG
msg_Dbg
(
s
,
"Read
\"
marker object
\"
: %i chapters: %s"
,
p_mk
->
i_count
,
p_mk
->
name
);
for
(
unsigned
i
=
0
;
i
<
p_mk
->
i_count
;
i
++
)
msg_Dbg
(
s
,
"New chapter named: %s"
,
p_mk
->
marker
[
i
].
p_marker_description
);
#endif
return
VLC_SUCCESS
;
}
static
void
ASF_FreeObject_marker
(
asf_object_t
*
p_obj
)
{
asf_object_marker_t
*
p_mk
=
(
asf_object_marker_t
*
)
p_obj
;
for
(
unsigned
i
=
0
;
i
<
p_mk
->
i_count
;
i
++
)
{
FREENULL
(
p_mk
->
marker
[
i
].
p_marker_description
);
}
FREENULL
(
p_mk
->
name
);
}
#if 0
static int ASF_ReadObject_XXX(stream_t *s, asf_object_t *p_obj)
...
...
@@ -1242,7 +1301,8 @@ static const struct
ASF_ReadObject_metadata
,
ASF_FreeObject_metadata
},
{
&
asf_object_codec_list_guid
,
ASF_OBJECT_CODEC_LIST
,
ASF_ReadObject_codec_list
,
ASF_FreeObject_codec_list
},
{
&
asf_object_marker_guid
,
ASF_OBJECT_MARKER
,
NULL
,
NULL
},
{
&
asf_object_marker_guid
,
ASF_OBJECT_MARKER
,
ASF_ReadObject_marker
,
ASF_FreeObject_marker
},
{
&
asf_object_padding
,
ASF_OBJECT_PADDING
,
NULL
,
NULL
},
{
&
asf_object_compatibility_guid
,
ASF_OBJECT_OTHER
,
NULL
,
NULL
},
{
&
asf_object_content_description_guid
,
ASF_OBJECT_CONTENT_DESCRIPTION
,
...
...
modules/demux/asf/libasf.h
View file @
fd146628
...
...
@@ -181,13 +181,6 @@ typedef struct
}
asf_object_content_description_t
;
typedef
struct
{
uint16_t
i_length
;
uint16_t
*
i_char
;
}
string16_t
;
#define ASF_CODEC_TYPE_VIDEO 0x0001
#define ASF_CODEC_TYPE_AUDIO 0x0002
#define ASF_CODEC_TYPE_UNKNOWN 0xffff
...
...
@@ -219,7 +212,7 @@ typedef struct
uint32_t
i_send_time
;
uint32_t
i_flags
;
uint32_t
i_marker_description_length
;
uint8_t
*
i
_marker_description
;
uint8_t
*
p
_marker_description
;
}
asf_marker_t
;
...
...
@@ -229,7 +222,7 @@ typedef struct
guid_t
i_reserved1
;
uint32_t
i_count
;
uint16_t
i_reserved2
;
string16_t
name
;
char
*
name
;
asf_marker_t
*
marker
;
}
asf_object_marker_t
;
...
...
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