Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
449bf4a7
Commit
449bf4a7
authored
Jul 22, 2013
by
Jean-Baptiste Kempf
Browse files
Demux: Correctly differenciate MLP and THD raw samples
Ref #8850
parent
94026a9a
Changes
1
Hide whitespace changes
Inline
Side-by-side
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
Supports
Markdown
0%
Try again
or
attach a new 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