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
32aeba12
Commit
32aeba12
authored
Aug 02, 2012
by
Kifayat ullah
Committed by
Michael Niedermayer
Aug 02, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpegtsenc: Fix AC3 Sound issue with Blu-ray Players.
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
93d42895
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
mpegtsenc.c
libavformat/mpegtsenc.c
+26
-0
No files found.
libavformat/mpegtsenc.c
View file @
32aeba12
...
...
@@ -921,6 +921,10 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st,
st
->
codec
->
codec_id
==
CODEC_ID_MP3
||
st
->
codec
->
codec_id
==
CODEC_ID_AAC
))
{
*
q
++
=
0xc0
;
}
else
if
(
st
->
codec
->
codec_type
==
AVMEDIA_TYPE_AUDIO
&&
st
->
codec
->
codec_id
==
CODEC_ID_AC3
&&
ts
->
m2ts_mode
)
{
*
q
++
=
0xfd
;
}
else
{
*
q
++
=
0xbd
;
if
(
st
->
codec
->
codec_type
==
AVMEDIA_TYPE_SUBTITLE
)
{
...
...
@@ -950,6 +954,17 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st,
*/
header_len
+=
3
;
}
/* for Blu-ray AC3 Audio the PES Extension flag should be as follow
* otherwise it will not play sound on blu-ray
*/
if
(
ts
->
m2ts_mode
&&
st
->
codec
->
codec_type
==
AVMEDIA_TYPE_AUDIO
&&
st
->
codec
->
codec_id
==
CODEC_ID_AC3
)
{
/* set PES_extension_flag */
pes_extension
=
1
;
flags
|=
0x01
;
header_len
+=
3
;
}
len
=
payload_size
+
header_len
+
3
;
if
(
private_code
!=
0
)
len
++
;
...
...
@@ -982,6 +997,17 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st,
*/
*
q
++
=
0x00
|
0x60
;
}
/* For Blu-ray AC3 Audio Setting extended flags */
if
(
ts
->
m2ts_mode
&&
pes_extension
&&
st
->
codec
->
codec_id
==
CODEC_ID_AC3
)
{
flags
=
0x01
;
/* set PES_extension_flag_2 */
*
q
++
=
flags
;
*
q
++
=
0x80
|
0x01
;
/* marker bit + extension length */
*
q
++
=
0x00
|
0x71
;
/* for AC3 Audio (specifically on blue-rays) */
}
if
(
private_code
!=
0
)
*
q
++
=
private_code
;
is_start
=
0
;
...
...
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