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
1cb53037
Commit
1cb53037
authored
Mar 08, 2012
by
Sébastien Escudier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve mxpeg detection : there are some cases where the jpeg comment is not included
parent
2c41ee00
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
modules/demux/mxpeg_helper.h
modules/demux/mxpeg_helper.h
+11
-7
No files found.
modules/demux/mxpeg_helper.h
View file @
1cb53037
...
...
@@ -46,7 +46,7 @@ static bool IsMxpeg(stream_t *s)
int
size
=
stream_Peek
(
s
,
&
header
,
256
);
int
position
=
0
;
if
(
find_jpeg_marker
(
&
position
,
header
,
size
)
!=
0xd8
)
if
(
find_jpeg_marker
(
&
position
,
header
,
size
)
!=
0xd8
||
position
>
size
-
2
)
return
false
;
if
(
find_jpeg_marker
(
&
position
,
header
,
position
+
2
)
!=
0xe0
)
return
false
;
...
...
@@ -57,23 +57,27 @@ static bool IsMxpeg(stream_t *s)
/* Skip this jpeg header */
uint32_t
header_size
=
GetWBE
(
&
header
[
position
]);
position
+=
header_size
;
if
(
position
+
4
>
size
)
/* Get enough data to analyse the next header */
if
(
position
+
6
>
size
)
{
size
=
position
+
4
;
size
=
position
+
6
;
if
(
stream_Peek
(
s
,
&
header
,
size
)
<
size
)
return
false
;
}
/* Skip the comment header */
if
(
!
(
header
[
position
]
==
0xFF
&&
header
[
position
+
1
]
==
0xFE
)
)
return
false
;
position
+=
2
;
header_size
=
GetWBE
(
&
header
[
position
]);
/* Find the MXF header */
/* Check if this is a MXF header. We may have a jpeg comment first */
if
(
!
memcmp
(
&
header
[
position
+
2
],
"MXF
\0
"
,
4
)
)
return
true
;
/* Skip the jpeg comment and find the MXF header after that */
size
=
position
+
header_size
+
8
;
//8 = FF FE 00 00 M X F 00
if
(
stream_Peek
(
s
,
&
header
,
position
+
header_size
+
8
)
<
size
)
if
(
stream_Peek
(
s
,
&
header
,
size
)
<
size
)
return
false
;
position
+=
header_size
;
...
...
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