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
449bf4a7
Commit
449bf4a7
authored
Jul 22, 2013
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Demux: Correctly differenciate MLP and THD raw samples
Ref #8850
parent
94026a9a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
2 deletions
+23
-2
modules/demux/mpeg/es.c
modules/demux/mpeg/es.c
+23
-2
No files found.
modules/demux/mpeg/es.c
View file @
449bf4a7
...
...
@@ -141,6 +141,7 @@ static int DtsProbe( demux_t *p_demux, int64_t *pi_offset );
static
int
DtsInit
(
demux_t
*
p_demux
);
static
int
MlpProbe
(
demux_t
*
p_demux
,
int64_t
*
pi_offset
);
static
int
ThdProbe
(
demux_t
*
p_demux
,
int64_t
*
pi_offset
);
static
int
MlpInit
(
demux_t
*
p_demux
);
static
bool
Parse
(
demux_t
*
p_demux
,
block_t
**
pp_output
);
...
...
@@ -152,6 +153,7 @@ static const codec_t p_codecs[] = {
{
VLC_CODEC_EAC3
,
true
,
"eac3 audio"
,
EA52Probe
,
A52Init
},
{
VLC_CODEC_DTS
,
false
,
"dts audio"
,
DtsProbe
,
DtsInit
},
{
VLC_CODEC_MLP
,
false
,
"mlp audio"
,
MlpProbe
,
MlpInit
},
{
VLC_CODEC_TRUEHD
,
false
,
"TrueHD audio"
,
ThdProbe
,
MlpInit
},
{
0
,
false
,
NULL
,
NULL
,
NULL
}
};
...
...
@@ -969,7 +971,19 @@ static int MlpCheckSync( const uint8_t *p_peek, int *pi_samples )
if
(
p_peek
[
4
+
0
]
!=
0xf8
||
p_peek
[
4
+
1
]
!=
0x72
||
p_peek
[
4
+
2
]
!=
0x6f
)
return
-
1
;
if
(
p_peek
[
4
+
3
]
!=
0xba
&&
p_peek
[
4
+
3
]
!=
0xbb
)
if
(
p_peek
[
4
+
3
]
!=
0xbb
)
return
-
1
;
/* TODO checksum and real size for robustness */
VLC_UNUSED
(
pi_samples
);
return
0
;
}
static
int
ThdCheckSync
(
const
uint8_t
*
p_peek
,
int
*
pi_samples
)
{
if
(
p_peek
[
4
+
0
]
!=
0xf8
||
p_peek
[
4
+
1
]
!=
0x72
||
p_peek
[
4
+
2
]
!=
0x6f
)
return
-
1
;
if
(
p_peek
[
4
+
3
]
!=
0xba
)
return
-
1
;
/* TODO checksum and real size for robustness */
...
...
@@ -978,11 +992,18 @@ static int MlpCheckSync( const uint8_t *p_peek, int *pi_samples )
}
static
int
MlpProbe
(
demux_t
*
p_demux
,
int64_t
*
pi_offset
)
{
const
char
*
ppsz_name
[]
=
{
"mlp"
,
"thd"
,
NULL
};
const
char
*
ppsz_name
[]
=
{
"mlp"
,
NULL
};
const
int
pi_wav
[]
=
{
WAVE_FORMAT_PCM
,
WAVE_FORMAT_UNKNOWN
};
return
GenericProbe
(
p_demux
,
pi_offset
,
ppsz_name
,
MlpCheckSync
,
4
+
28
+
16
*
4
,
pi_wav
);
}
static
int
ThdProbe
(
demux_t
*
p_demux
,
int64_t
*
pi_offset
)
{
const
char
*
ppsz_name
[]
=
{
"thd"
,
NULL
};
const
int
pi_wav
[]
=
{
WAVE_FORMAT_PCM
,
WAVE_FORMAT_UNKNOWN
};
return
GenericProbe
(
p_demux
,
pi_offset
,
ppsz_name
,
ThdCheckSync
,
4
+
28
+
16
*
4
,
pi_wav
);
}
static
int
MlpInit
(
demux_t
*
p_demux
)
{
...
...
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