Also remove { } after an if if there is only one statement inside { }.
Unified · Split
| @@ -1284,22 +1284,21 @@ static int mkv_write_track(AVFormatContext *s, MatroskaMuxContext *mkv, · 1283 unmodified lines | ||
| 1284 | 1284 | |
| 1285 | 1285 | case AVMEDIA_TYPE_AUDIO: |
| 1286 | 1286 | if (par->initial_padding && par->codec_id == AV_CODEC_ID_OPUS) { |
| 1287 | − int64_t codecdelay = av_rescale_q(par->initial_padding, | |
| 1288 | − (AVRational){ 1, 48000 }, | |
| 1289 | − (AVRational){ 1, 1000000000 }); | |
| 1290 | − if (codecdelay < 0) { | |
| 1291 | − av_log(s, AV_LOG_ERROR, "Initial padding is invalid\n"); | |
| 1292 | − return AVERROR(EINVAL); | |
| 1293 | − } | |
| 1294 | −// mkv->tracks[i].ts_offset = av_rescale_q(par->initial_padding, | |
| 1295 | −// (AVRational){ 1, par->sample_rate }, | |
| 1296 | −// st->time_base); | |
| 1287 | + int64_t codecdelay = av_rescale_q(par->initial_padding, | |
| 1288 | + (AVRational){ 1, 48000 }, | |
| 1289 | + (AVRational){ 1, 1000000000 }); | |
| 1290 | + if (codecdelay < 0) { | |
| 1291 | + av_log(s, AV_LOG_ERROR, "Initial padding is invalid\n"); | |
| 1292 | + return AVERROR(EINVAL); | |
| 1293 | + } | |
| 1294 | +// mkv->tracks[i].ts_offset = av_rescale_q(par->initial_padding, | |
| 1295 | +// (AVRational){ 1, par->sample_rate }, | |
| 1296 | +// st->time_base); | |
| 1297 | 1297 | |
| 1298 | − put_ebml_uint(pb, MATROSKA_ID_CODECDELAY, codecdelay); | |
| 1299 | − } | |
| 1300 | − if (par->codec_id == AV_CODEC_ID_OPUS) { | |
| 1301 | − put_ebml_uint(pb, MATROSKA_ID_SEEKPREROLL, OPUS_SEEK_PREROLL); | |
| 1302 | − } | |
| 1298 | + put_ebml_uint(pb, MATROSKA_ID_CODECDELAY, codecdelay); | |
| 1299 | + } | |
| 1300 | + if (par->codec_id == AV_CODEC_ID_OPUS) | |
| 1301 | + put_ebml_uint(pb, MATROSKA_ID_SEEKPREROLL, OPUS_SEEK_PREROLL); | |
| 1303 | 1302 | |
| 1304 | 1303 | put_ebml_uint(pb, MATROSKA_ID_TRACKTYPE, MATROSKA_TRACK_TYPE_AUDIO); |
| 1305 | 1304 | |