diff options
author | Kifayat ullah <kifayat.ullah@fortiumtech.com> | 2012-08-02 15:01:56 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-08-02 16:55:17 +0200 |
commit | 32aeba12755f05db7fbd24e530dd309e3cf93557 (patch) | |
tree | 921380cb447fe715adae83779d65299a8957aacb /libavformat/mpegtsenc.c | |
parent | 93d428953c91d68e8e6e98f8fda379d204507bb6 (diff) | |
download | ffmpeg-32aeba12755f05db7fbd24e530dd309e3cf93557.tar.gz |
mpegtsenc: Fix AC3 Sound issue with Blu-ray Players.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mpegtsenc.c')
-rw-r--r-- | libavformat/mpegtsenc.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c index 5d74971490..2ed6f031a9 100644 --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c @@ -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; |