[FFmpeg-devel] [PATCH v2 5/5] avformat/mpegtsenc: support 0x6a descriptor for AC-3 by side data if have

Moritz Barsnick barsnick at gmx.net
Fri Aug 7 09:43:05 EEST 2020


On Thu, Jul 30, 2020 at 22:58:58 +0800, lance.lmwang at gmail.com wrote:
>                  if (codec_id == AV_CODEC_ID_AC3) {
> +                    int len = 1;
> +
> +                    if (ts_st->desc6a.component_type_flag) len++;
> +                    if (ts_st->desc6a.bsid_flag)           len++;
> +                    if (ts_st->desc6a.mainid_flag)         len++;
> +                    if (ts_st->desc6a.asvc_flag)           len++;

This could be coded as
    int len = 1
              + !!(ts_st->desc6a.component_type_flag)
              + !!(ts_st->desc6a.bsid_flag)
              + ...

but I don't know what is preferred (and technically, it results in the
same amount of machine commands). It probably doesn't matter.

> +        side_data = (AVDescriptor6A *) av_packet_get_side_data(pkt,
> +                    AV_PKT_DATA_MPEGTS_DESC_6A, &sd_size);

Indentation is incorrect.

Cheers,
Moritz


More information about the ffmpeg-devel mailing list