lavf/movenc: small cleanup for style

Small cleanup for style, indent, switch case lables.
BTW, the preferred way to ease multiple indentation levels in a
switch statement is to align the switch and its subordinate
case labels in the same column

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
This commit is contained in:
Jun Zhao 2024-03-21 10:31:13 +08:00 committed by Jun Zhao
parent b792e4d4c7
commit 5ebcca4e08
1 changed files with 35 additions and 36 deletions

View File

@ -668,10 +668,10 @@ static int mov_write_enda_tag(AVIOContext *pb)
static int mov_write_enda_tag_be(AVIOContext *pb) static int mov_write_enda_tag_be(AVIOContext *pb)
{ {
avio_wb32(pb, 10); avio_wb32(pb, 10);
ffio_wfourcc(pb, "enda"); ffio_wfourcc(pb, "enda");
avio_wb16(pb, 0); /* big endian */ avio_wb16(pb, 0); /* big endian */
return 10; return 10;
} }
static void put_descr(AVIOContext *pb, int tag, unsigned int size) static void put_descr(AVIOContext *pb, int tag, unsigned int size)
@ -979,9 +979,9 @@ static int mov_write_wave_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *tra
ffio_wfourcc(pb, "wave"); ffio_wfourcc(pb, "wave");
if (track->par->codec_id != AV_CODEC_ID_QDM2) { if (track->par->codec_id != AV_CODEC_ID_QDM2) {
avio_wb32(pb, 12); /* size */ avio_wb32(pb, 12); /* size */
ffio_wfourcc(pb, "frma"); ffio_wfourcc(pb, "frma");
avio_wl32(pb, track->tag); avio_wl32(pb, track->tag);
} }
if (track->par->codec_id == AV_CODEC_ID_AAC) { if (track->par->codec_id == AV_CODEC_ID_AAC) {
@ -991,9 +991,9 @@ static int mov_write_wave_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *tra
avio_wb32(pb, 0); avio_wb32(pb, 0);
mov_write_esds_tag(pb, track); mov_write_esds_tag(pb, track);
} else if (mov_pcm_le_gt16(track->par->codec_id)) { } else if (mov_pcm_le_gt16(track->par->codec_id)) {
mov_write_enda_tag(pb); mov_write_enda_tag(pb);
} else if (mov_pcm_be_gt16(track->par->codec_id)) { } else if (mov_pcm_be_gt16(track->par->codec_id)) {
mov_write_enda_tag_be(pb); mov_write_enda_tag_be(pb);
} else if (track->par->codec_id == AV_CODEC_ID_AMR_NB) { } else if (track->par->codec_id == AV_CODEC_ID_AMR_NB) {
mov_write_amr_tag(pb, track); mov_write_amr_tag(pb, track);
} else if (track->par->codec_id == AV_CODEC_ID_AC3) { } else if (track->par->codec_id == AV_CODEC_ID_AC3) {
@ -1805,11 +1805,11 @@ static const struct {
static int mov_get_dnxhd_codec_tag(AVFormatContext *s, MOVTrack *track) static int mov_get_dnxhd_codec_tag(AVFormatContext *s, MOVTrack *track)
{ {
int tag = MKTAG('A','V','d','n'); int tag = MKTAG('A','V','d','n');
if (track->par->profile != AV_PROFILE_UNKNOWN && if (track->par->profile != AV_PROFILE_UNKNOWN &&
track->par->profile != AV_PROFILE_DNXHD) track->par->profile != AV_PROFILE_DNXHD)
tag = MKTAG('A','V','d','h'); tag = MKTAG('A','V','d','h');
return tag; return tag;
} }
static int mov_get_rawvideo_codec_tag(AVFormatContext *s, MOVTrack *track) static int mov_get_rawvideo_codec_tag(AVFormatContext *s, MOVTrack *track)
@ -2997,18 +2997,18 @@ static int mov_write_gmhd_tag(AVIOContext *pb, MOVTrack *track)
* bytes are copied verbatim. * bytes are copied verbatim.
*/ */
if (track->tag != MKTAG('c','6','0','8')) { if (track->tag != MKTAG('c','6','0','8')) {
avio_wb32(pb, 0x2C); /* size */ avio_wb32(pb, 0x2C); /* size */
ffio_wfourcc(pb, "text"); ffio_wfourcc(pb, "text");
avio_wb16(pb, 0x01); avio_wb16(pb, 0x01);
avio_wb32(pb, 0x00); avio_wb32(pb, 0x00);
avio_wb32(pb, 0x00); avio_wb32(pb, 0x00);
avio_wb32(pb, 0x00); avio_wb32(pb, 0x00);
avio_wb32(pb, 0x01); avio_wb32(pb, 0x01);
avio_wb32(pb, 0x00); avio_wb32(pb, 0x00);
avio_wb32(pb, 0x00); avio_wb32(pb, 0x00);
avio_wb32(pb, 0x00); avio_wb32(pb, 0x00);
avio_wb32(pb, 0x00004000); avio_wb32(pb, 0x00004000);
avio_wb16(pb, 0x0000); avio_wb16(pb, 0x0000);
} }
if (track->par->codec_tag == MKTAG('t','m','c','d')) { if (track->par->codec_tag == MKTAG('t','m','c','d')) {
@ -4853,16 +4853,15 @@ static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov, AVFormat
param_write_int(pb, "DisplayHeight", track->par->height); param_write_int(pb, "DisplayHeight", track->par->height);
} else { } else {
if (track->par->codec_id == AV_CODEC_ID_AAC) { if (track->par->codec_id == AV_CODEC_ID_AAC) {
switch (track->par->profile) switch (track->par->profile) {
{ case AV_PROFILE_AAC_HE_V2:
case AV_PROFILE_AAC_HE_V2: param_write_string(pb, "FourCC", "AACP");
param_write_string(pb, "FourCC", "AACP"); break;
break; case AV_PROFILE_AAC_HE:
case AV_PROFILE_AAC_HE: param_write_string(pb, "FourCC", "AACH");
param_write_string(pb, "FourCC", "AACH"); break;
break; default:
default: param_write_string(pb, "FourCC", "AACL");
param_write_string(pb, "FourCC", "AACL");
} }
} else if (track->par->codec_id == AV_CODEC_ID_WMAPRO) { } else if (track->par->codec_id == AV_CODEC_ID_WMAPRO) {
param_write_string(pb, "FourCC", "WMAP"); param_write_string(pb, "FourCC", "WMAP");