aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLimin Wang <lance.lmwang@gmail.com>2020-08-23 23:02:31 +0800
committerLimin Wang <lance.lmwang@gmail.com>2020-08-26 14:20:10 +0800
commit4aa6eda76ebe195bae2c5a3183371f6a57ca4cdd (patch)
tree87c1cfa9b25274950d1cdaa4b951fa6dfb7aab07
parent8f2c1f2cbe77685435362f1940b637a6c3ff1934 (diff)
downloadffmpeg-4aa6eda76ebe195bae2c5a3183371f6a57ca4cdd.tar.gz
avformat/mpegtsenc: add registration descriptor for AC-3 and EAC3
Some DVB and ATSC captures are using the official MPEG2 registration descriptor in addition to using the correct stream type and the AC-3_audio_stream_descriptor/AC3_descriptor. So let's add it even if it is not strictly needed for DVB/ATSC. Reviewed-by: Marton Balint <cus@passwd.hu> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
-rw-r--r--libavformat/mpegtsenc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 61fdd09f7a..c415078177 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -487,6 +487,10 @@ static int mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
/* write optional descriptors here */
switch (st->codecpar->codec_type) {
case AVMEDIA_TYPE_AUDIO:
+ if (codec_id == AV_CODEC_ID_AC3)
+ put_registration_descriptor(&q, MKTAG('A', 'C', '-', '3'));
+ if (codec_id == AV_CODEC_ID_EAC3)
+ put_registration_descriptor(&q, MKTAG('E', 'A', 'C', '3'));
if (ts->flags & MPEGTS_FLAG_SYSTEM_B) {
if (codec_id == AV_CODEC_ID_AC3) {
DVBAC3Descriptor *dvb_ac3_desc = ts_st->dvb_ac3_desc;