Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
9ec05e36
Commit
9ec05e36
authored
Jan 31, 2003
by
Fabrice Bellard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added DVD LPCM decoding support
Originally committed as revision 1525 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
f17457ac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
mpeg.c
libavformat/mpeg.c
+20
-0
No files found.
libavformat/mpeg.c
View file @
9ec05e36
...
...
@@ -598,6 +598,9 @@ static int mpegps_read_packet(AVFormatContext *s,
}
else
if
(
startcode
>=
0x80
&&
startcode
<=
0x9f
)
{
type
=
CODEC_TYPE_AUDIO
;
codec_id
=
CODEC_ID_AC3
;
}
else
if
(
startcode
>=
0xa0
&&
startcode
<=
0xbf
)
{
type
=
CODEC_TYPE_AUDIO
;
codec_id
=
CODEC_ID_PCM_S16BE
;
}
else
{
skip:
/* skip packet */
...
...
@@ -611,6 +614,23 @@ static int mpegps_read_packet(AVFormatContext *s,
st
->
codec
.
codec_type
=
type
;
st
->
codec
.
codec_id
=
codec_id
;
found:
if
(
startcode
>=
0xa0
&&
startcode
<=
0xbf
)
{
int
b1
,
freq
;
static
const
int
lpcm_freq_tab
[
4
]
=
{
48000
,
96000
,
44100
,
32000
};
/* for LPCM, we just skip the header and consider it is raw
audio data */
if
(
len
<=
3
)
goto
skip
;
get_byte
(
&
s
->
pb
);
/* emphasis (1), muse(1), reserved(1), frame number(5) */
b1
=
get_byte
(
&
s
->
pb
);
/* quant (2), freq(2), reserved(1), channels(3) */
get_byte
(
&
s
->
pb
);
/* dynamic range control (0x80 = off) */
len
-=
3
;
freq
=
(
b1
>>
4
)
&
3
;
st
->
codec
.
sample_rate
=
lpcm_freq_tab
[
freq
];
st
->
codec
.
channels
=
1
+
(
b1
&
7
);
st
->
codec
.
bit_rate
=
st
->
codec
.
channels
*
st
->
codec
.
sample_rate
*
2
;
}
av_new_packet
(
pkt
,
len
);
//printf("\nRead Packet ID: %x PTS: %f Size: %d", startcode,
// (float)pts/90000, len);
...
...
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