aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLimin Wang <lance.lmwang@gmail.com>2020-07-08 10:40:10 +0800
committerLimin Wang <lance.lmwang@gmail.com>2020-07-25 10:20:18 +0800
commitcf81d64282167fc232d28c9e3c12ea8f2246f9fb (patch)
tree8895aa0c8556248e8a2ff62cb6f9e1f3323f1f3f
parent017bf9643fc042267abaac1d60acdcfdaeee4814 (diff)
downloadffmpeg-cf81d64282167fc232d28c9e3c12ea8f2246f9fb.tar.gz
avformat/mpegtsenc: simplify code for condition checks
Reviewed-by: Marton Balint <cus@passwd.hu> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
-rw-r--r--libavformat/mpegtsenc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index d827ba3e28..2d7a8ab326 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -483,16 +483,18 @@ static int mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
/* write optional descriptors here */
switch (st->codecpar->codec_type) {
case AVMEDIA_TYPE_AUDIO:
- if (st->codecpar->codec_id==AV_CODEC_ID_AC3 && (ts->flags & MPEGTS_FLAG_SYSTEM_B)) {
+ if (ts->flags & MPEGTS_FLAG_SYSTEM_B) {
+ if (st->codecpar->codec_id==AV_CODEC_ID_AC3) {
*q++=0x6a; // AC3 descriptor see A038 DVB SI
*q++=1; // 1 byte, all flags sets to 0
*q++=0; // omit all fields...
}
- if (st->codecpar->codec_id==AV_CODEC_ID_EAC3 && (ts->flags & MPEGTS_FLAG_SYSTEM_B)) {
+ else if (st->codecpar->codec_id==AV_CODEC_ID_EAC3) {
*q++=0x7a; // EAC3 descriptor see A038 DVB SI
*q++=1; // 1 byte, all flags sets to 0
*q++=0; // omit all fields...
}
+ }
if (st->codecpar->codec_id==AV_CODEC_ID_S302M)
put_registration_descriptor(&q, MKTAG('B', 'S', 'S', 'D'));
if (st->codecpar->codec_id==AV_CODEC_ID_OPUS) {