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
2a08faba
Commit
2a08faba
authored
Nov 27, 2018
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/mpegenc: extend muxing PCM-DVD to other depths
Fixes #6783.
parent
e9967822
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
7 deletions
+22
-7
mpegenc.c
libavformat/mpegenc.c
+21
-6
version.h
libavformat/version.h
+1
-1
No files found.
libavformat/mpegenc.c
View file @
2a08faba
...
@@ -364,12 +364,7 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx)
...
@@ -364,12 +364,7 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx)
stream
->
id
=
ac3_id
++
;
stream
->
id
=
ac3_id
++
;
}
else
if
(
st
->
codecpar
->
codec_id
==
AV_CODEC_ID_DTS
)
{
}
else
if
(
st
->
codecpar
->
codec_id
==
AV_CODEC_ID_DTS
)
{
stream
->
id
=
dts_id
++
;
stream
->
id
=
dts_id
++
;
}
else
if
(
st
->
codecpar
->
codec_id
==
AV_CODEC_ID_PCM_S16BE
||
}
else
if
(
st
->
codecpar
->
codec_id
==
AV_CODEC_ID_PCM_S16BE
)
{
st
->
codecpar
->
codec_id
==
AV_CODEC_ID_PCM_DVD
)
{
if
(
st
->
codecpar
->
bits_per_coded_sample
!=
16
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Only 16 bit LPCM streams can be muxed.
\n
"
);
goto
fail
;
}
stream
->
id
=
lpcm_id
++
;
stream
->
id
=
lpcm_id
++
;
for
(
j
=
0
;
j
<
4
;
j
++
)
{
for
(
j
=
0
;
j
<
4
;
j
++
)
{
if
(
lpcm_freq_tab
[
j
]
==
st
->
codecpar
->
sample_rate
)
if
(
lpcm_freq_tab
[
j
]
==
st
->
codecpar
->
sample_rate
)
...
@@ -392,6 +387,26 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx)
...
@@ -392,6 +387,26 @@ static av_cold int mpeg_mux_init(AVFormatContext *ctx)
stream
->
lpcm_header
[
1
]
=
(
st
->
codecpar
->
channels
-
1
)
|
(
j
<<
4
);
stream
->
lpcm_header
[
1
]
=
(
st
->
codecpar
->
channels
-
1
)
|
(
j
<<
4
);
stream
->
lpcm_header
[
2
]
=
0x80
;
stream
->
lpcm_header
[
2
]
=
0x80
;
stream
->
lpcm_align
=
st
->
codecpar
->
channels
*
2
;
stream
->
lpcm_align
=
st
->
codecpar
->
channels
*
2
;
}
else
if
(
st
->
codecpar
->
codec_id
==
AV_CODEC_ID_PCM_DVD
)
{
int
freq
;
switch
(
st
->
codecpar
->
sample_rate
)
{
case
48000
:
freq
=
0
;
break
;
case
96000
:
freq
=
1
;
break
;
case
44100
:
freq
=
2
;
break
;
case
32000
:
freq
=
3
;
break
;
default:
av_log
(
ctx
,
AV_LOG_ERROR
,
"Unsupported sample rate.
\n
"
);
return
AVERROR
(
EINVAL
);
}
stream
->
lpcm_header
[
0
]
=
0x0c
;
stream
->
lpcm_header
[
1
]
=
(
freq
<<
4
)
|
(((
st
->
codecpar
->
bits_per_coded_sample
-
16
)
/
4
)
<<
6
)
|
st
->
codecpar
->
channels
-
1
;
stream
->
lpcm_header
[
2
]
=
0x80
;
stream
->
id
=
lpcm_id
++
;
stream
->
lpcm_align
=
st
->
codecpar
->
channels
*
st
->
codecpar
->
bits_per_coded_sample
/
8
;
}
else
{
}
else
{
stream
->
id
=
mpa_id
++
;
stream
->
id
=
mpa_id
++
;
}
}
...
...
libavformat/version.h
View file @
2a08faba
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
// Also please add any ticket numbers that you believe might be affected here
// Also please add any ticket numbers that you believe might be affected here
#define LIBAVFORMAT_VERSION_MAJOR 58
#define LIBAVFORMAT_VERSION_MAJOR 58
#define LIBAVFORMAT_VERSION_MINOR 23
#define LIBAVFORMAT_VERSION_MINOR 23
#define LIBAVFORMAT_VERSION_MICRO 10
1
#define LIBAVFORMAT_VERSION_MICRO 10
2
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \
LIBAVFORMAT_VERSION_MINOR, \
...
...
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