summaryrefslogtreecommitdiff
path: root/fftools/ffmpeg_enc.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2023-07-21 15:22:57 +0200
committerAnton Khirnov <anton@khirnov.net>2023-08-30 11:53:50 +0200
commit8b6b2518faf6fab23f9993498e71ab4fa1f1b812 (patch)
tree66bfa0bdf771e6b20b2b468d1c8639b4194654f1 /fftools/ffmpeg_enc.c
parentd1a2cd1e139dc87930bd0fd25e9cc30e1545deef (diff)
fftools/ffmpeg_enc: reindent after previous commit
Diffstat (limited to 'fftools/ffmpeg_enc.c')
-rw-r--r--fftools/ffmpeg_enc.c66
1 files changed, 33 insertions, 33 deletions
diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c
index c4874b4d78..4b5bd3d9b4 100644
--- a/fftools/ffmpeg_enc.c
+++ b/fftools/ffmpeg_enc.c
@@ -228,44 +228,44 @@ static int enc_choose_timebase(OutputStream *ost, AVFrame *frame)
return 0;
}
- fr = ost->frame_rate;
- if (!fr.num)
- fr = fd->frame_rate_filter;
- if (!fr.num && !ost->max_frame_rate.num) {
- fr = (AVRational){25, 1};
- av_log(ost, AV_LOG_WARNING,
- "No information "
- "about the input framerate is available. Falling "
- "back to a default value of 25fps. Use the -r option "
- "if you want a different framerate.\n");
- }
+ fr = ost->frame_rate;
+ if (!fr.num)
+ fr = fd->frame_rate_filter;
+ if (!fr.num && !ost->max_frame_rate.num) {
+ fr = (AVRational){25, 1};
+ av_log(ost, AV_LOG_WARNING,
+ "No information "
+ "about the input framerate is available. Falling "
+ "back to a default value of 25fps. Use the -r option "
+ "if you want a different framerate.\n");
+ }
- if (ost->max_frame_rate.num &&
- (av_q2d(fr) > av_q2d(ost->max_frame_rate) ||
- !fr.den))
- fr = ost->max_frame_rate;
+ if (ost->max_frame_rate.num &&
+ (av_q2d(fr) > av_q2d(ost->max_frame_rate) ||
+ !fr.den))
+ fr = ost->max_frame_rate;
- if (enc->codec->supported_framerates && !ost->force_fps) {
- int idx = av_find_nearest_q_idx(fr, enc->codec->supported_framerates);
- fr = enc->codec->supported_framerates[idx];
- }
- // reduce frame rate for mpeg4 to be within the spec limits
- if (enc->codec_id == AV_CODEC_ID_MPEG4) {
- av_reduce(&fr.num, &fr.den,
- fr.num, fr.den, 65535);
- }
+ if (enc->codec->supported_framerates && !ost->force_fps) {
+ int idx = av_find_nearest_q_idx(fr, enc->codec->supported_framerates);
+ fr = enc->codec->supported_framerates[idx];
+ }
+ // reduce frame rate for mpeg4 to be within the spec limits
+ if (enc->codec_id == AV_CODEC_ID_MPEG4) {
+ av_reduce(&fr.num, &fr.den,
+ fr.num, fr.den, 65535);
+ }
- if (av_q2d(fr) > 1e3 && ost->vsync_method != VSYNC_PASSTHROUGH &&
- (ost->vsync_method == VSYNC_CFR || ost->vsync_method == VSYNC_VSCFR ||
- (ost->vsync_method == VSYNC_AUTO && !(of->format->flags & AVFMT_VARIABLE_FPS)))){
- av_log(ost, AV_LOG_WARNING, "Frame rate very high for a muxer not efficiently supporting it.\n"
- "Please consider specifying a lower framerate, a different muxer or "
- "setting vsync/fps_mode to vfr\n");
- }
+ if (av_q2d(fr) > 1e3 && ost->vsync_method != VSYNC_PASSTHROUGH &&
+ (ost->vsync_method == VSYNC_CFR || ost->vsync_method == VSYNC_VSCFR ||
+ (ost->vsync_method == VSYNC_AUTO && !(of->format->flags & AVFMT_VARIABLE_FPS)))){
+ av_log(ost, AV_LOG_WARNING, "Frame rate very high for a muxer not efficiently supporting it.\n"
+ "Please consider specifying a lower framerate, a different muxer or "
+ "setting vsync/fps_mode to vfr\n");
+ }
- enc->framerate = fr;
+ enc->framerate = fr;
- ost->st->avg_frame_rate = fr;
+ ost->st->avg_frame_rate = fr;
if (!(tb.num > 0 && tb.den > 0))
tb = av_inv_q(fr);