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
eec7c30f
Commit
eec7c30f
authored
Dec 30, 2006
by
Sigmund Augdal Helberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mkv.cpp: Added support for theora in mkv. Fixes #925
(not particularly beautiful code, but it works)
parent
dd400e15
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
0 deletions
+70
-0
modules/demux/mkv.cpp
modules/demux/mkv.cpp
+70
-0
No files found.
modules/demux/mkv.cpp
View file @
eec7c30f
...
...
@@ -2197,6 +2197,76 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
{
tracks
[
i_track
]
->
fmt
.
i_codec
=
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'v'
);
}
else
if
(
!
strncmp
(
tracks
[
i_track
]
->
psz_codec
,
"V_THEORA"
,
8
)
)
{
uint8_t
*
p_data
=
tracks
[
i_track
]
->
p_extra_data
;
tracks
[
i_track
]
->
fmt
.
i_codec
=
VLC_FOURCC
(
't'
,
'h'
,
'e'
,
'o'
);
if
(
tracks
[
i_track
]
->
i_extra_data
>=
4
)
{
if
(
p_data
[
0
]
==
2
)
{
int
i
=
1
;
int
i_size1
=
0
,
i_size2
=
0
;
p_data
++
;
/* read size of first header packet */
while
(
*
p_data
==
0xFF
&&
i
<
tracks
[
i_track
]
->
i_extra_data
)
{
i_size1
+=
*
p_data
;
p_data
++
;
i
++
;
}
i_size1
+=
*
p_data
;
p_data
++
;
i
++
;
msg_Dbg
(
&
sys
.
demuxer
,
"first theora header size %d"
,
i_size1
);
/* read size of second header packet */
while
(
*
p_data
==
0xFF
&&
i
<
tracks
[
i_track
]
->
i_extra_data
)
{
i_size2
+=
*
p_data
;
p_data
++
;
i
++
;
}
i_size2
+=
*
p_data
;
p_data
++
;
i
++
;
int
i_size3
=
tracks
[
i_track
]
->
i_extra_data
-
i
-
i_size1
-
i_size2
;
msg_Dbg
(
&
sys
.
demuxer
,
"second theora header size %d"
,
i_size2
);
msg_Dbg
(
&
sys
.
demuxer
,
"third theora header size %d"
,
i_size3
);
tracks
[
i_track
]
->
fmt
.
i_extra
=
i_size1
+
i_size2
+
i_size3
+
6
;
if
(
i_size1
>
0
&&
i_size2
>
0
&&
i_size3
>
0
)
{
tracks
[
i_track
]
->
fmt
.
p_extra
=
malloc
(
tracks
[
i_track
]
->
fmt
.
i_extra
);
uint8_t
*
p_out
=
(
uint8_t
*
)
tracks
[
i_track
]
->
fmt
.
p_extra
;
*
p_out
++
=
(
i_size1
>>
8
)
&
0xFF
;
*
p_out
++
=
i_size1
&
0xFF
;
memcpy
(
p_out
,
p_data
,
i_size1
);
p_data
+=
i_size1
;
p_out
+=
i_size1
;
*
p_out
++
=
(
i_size2
>>
8
)
&
0xFF
;
*
p_out
++
=
i_size2
&
0xFF
;
memcpy
(
p_out
,
p_data
,
i_size2
);
p_data
+=
i_size2
;
p_out
+=
i_size2
;
*
p_out
++
=
(
i_size3
>>
8
)
&
0xFF
;
*
p_out
++
=
i_size3
&
0xFF
;
memcpy
(
p_out
,
p_data
,
i_size3
);
p_data
+=
i_size3
;
p_out
+=
i_size3
;
}
else
{
msg_Err
(
&
sys
.
demuxer
,
"inconsistant theora extradata"
);
}
}
else
{
msg_Err
(
&
sys
.
demuxer
,
"Wrong number of ogg packets with theora headers (%d)"
,
p_data
[
0
]
+
1
);
}
}
}
else
if
(
!
strncmp
(
tracks
[
i_track
]
->
psz_codec
,
"V_MPEG4"
,
7
)
)
{
if
(
!
strcmp
(
tracks
[
i_track
]
->
psz_codec
,
"V_MPEG4/MS/V3"
)
)
...
...
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