vcap/file: set FPS from avg_frame_rate

The [file] (URL few commits below) has actually set r_frame_rate as
1/1200k, which causes the libavcodec JPEG decoder crash (received is
something like 1792i due to overflow). avg_frame_rate contains 1/25.
This commit is contained in:
Martin Pulec
2025-10-01 13:56:49 +02:00
parent 0cf18b75fe
commit cab9e7b45f

View File

@@ -695,7 +695,8 @@ static bool setup_video(struct vidcap_state_lavf_decoder *s) {
AVStream *st = s->fmt_ctx->streams[s->video_stream_idx];
s->video_desc.width = st->codecpar->width;
s->video_desc.height = st->codecpar->height;
s->video_desc.fps = (double)st->r_frame_rate.num / st->r_frame_rate.den;
s->video_desc.fps =
(double) st->avg_frame_rate.num / st->avg_frame_rate.den;
s->video_desc.tile_count = 1;
if (s->no_decode) {
s->video_desc.color_spec =