Skip to content

Commit 2af8a44

Browse files
committed
transcoder_ffmpeg: fix error C4576
(AVRational){1, 60} is GCC/C99 “compound literal” syntax, that’s not valid C++
1 parent 0968e45 commit 2af8a44

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/transcoder/src/transcoder_ffmpeg.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,8 @@ bool TranscoderFFmpeg::prepare_Encoder_Video(StreamContext *decoder,
458458
encoder->videoCodecCtx->pix_fmt = decoder->videoCodecCtx->pix_fmt;
459459

460460
// encoder->videoCodecCtx->max_b_frames = 0;
461-
encoder->videoCodecCtx->time_base = (AVRational){1, 60};
462-
encoder->videoCodecCtx->framerate = (AVRational){60, 1};
461+
encoder->videoCodecCtx->time_base = av_make_q(1, 60);
462+
encoder->videoCodecCtx->framerate = av_make_q(60, 1);
463463
}
464464

465465
// bind codec and codec context
@@ -476,9 +476,9 @@ bool TranscoderFFmpeg::prepare_Encoder_Video(StreamContext *decoder,
476476
return false;
477477
}
478478
encoder->videoStream->r_frame_rate =
479-
(AVRational){60, 1}; // For setting real frame rate
479+
av_make_q(60, 1); // For setting real frame rate
480480
encoder->videoStream->avg_frame_rate =
481-
(AVRational){60, 1}; // For setting average frame rate
481+
av_make_q(60, 1); // For setting average frame rate
482482
// the input file's time_base is wrong
483483
encoder->videoStream->time_base = encoder->videoCodecCtx->time_base;
484484

@@ -537,7 +537,7 @@ bool TranscoderFFmpeg::prepare_Encoder_Audio(StreamContext *decoder,
537537
encoder->audioCodec->sample_fmts[0];
538538
encoder->audioCodecCtx->bit_rate = OUTPUT_BIT_RATE;
539539
encoder->audioCodecCtx->time_base =
540-
(AVRational){1, decoder->audioCodecCtx->sample_rate};
540+
av_make_q(1, decoder->audioCodecCtx->sample_rate);
541541
encoder->audioCodecCtx->strict_std_compliance =
542542
FF_COMPLIANCE_EXPERIMENTAL;
543543
}

0 commit comments

Comments
 (0)