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
f51013b0
Commit
f51013b0
authored
Nov 20, 2012
by
Denis Charmet
Committed by
Jean-Baptiste Kempf
Nov 21, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Detect Theora keyframe without blockreference
Fix #7513 Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
ab75e4f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
1 deletion
+25
-1
modules/demux/mkv/matroska_segment.cpp
modules/demux/mkv/matroska_segment.cpp
+25
-1
No files found.
modules/demux/mkv/matroska_segment.cpp
View file @
f51013b0
...
...
@@ -1581,6 +1581,7 @@ int matroska_segment_c::BlockGet( KaxBlock * & pp_block, KaxSimpleBlock * & pp_s
*
pb_key_picture
=
true
;
*
pb_discardable_picture
=
false
;
size_t
i_tk
;
for
(
;;
)
{
...
...
@@ -1593,7 +1594,7 @@ int matroska_segment_c::BlockGet( KaxBlock * & pp_block, KaxSimpleBlock * & pp_s
if
(
pp_simpleblock
!=
NULL
||
((
el
=
ep
->
Get
())
==
NULL
&&
pp_block
!=
NULL
)
)
{
/* Check blocks validity to protect againts broken files */
if
(
BlockFindTrackIndex
(
NULL
,
pp_block
,
pp_simpleblock
)
)
if
(
BlockFindTrackIndex
(
&
i_tk
,
pp_block
,
pp_simpleblock
)
)
{
delete
pp_block
;
pp_simpleblock
=
NULL
;
...
...
@@ -1605,6 +1606,29 @@ int matroska_segment_c::BlockGet( KaxBlock * & pp_block, KaxSimpleBlock * & pp_s
*
pb_key_picture
=
pp_simpleblock
->
IsKeyframe
();
*
pb_discardable_picture
=
pp_simpleblock
->
IsDiscardable
();
}
/* We have block group let's check if the picture is a keyframe */
else
if
(
*
pb_key_picture
)
{
switch
(
tracks
[
i_tk
]
->
fmt
.
i_codec
)
{
case
VLC_CODEC_THEORA
:
{
DataBuffer
*
p_data
=
&
pp_block
->
GetBuffer
(
0
);
size_t
sz
=
p_data
->
Size
();
const
uint8_t
*
p_buff
=
p_data
->
Buffer
();
/* if the second bit of a Theora frame is 1
it's not a keyframe */
if
(
sz
&&
p_buff
)
{
if
(
p_buff
[
0
]
&
0x40
)
*
pb_key_picture
=
false
;
}
else
*
pb_key_picture
=
false
;
break
;
}
}
}
/* update the index */
#define idx p_indexes[i_index - 1]
...
...
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