Skip to content

Commit 1dd00d0

Browse files
committed
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.
1 parent b3b504d commit 1dd00d0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/video_capture/file.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,8 @@ static bool setup_video(struct vidcap_state_lavf_decoder *s) {
697697
AVStream *st = s->fmt_ctx->streams[s->video_stream_idx];
698698
s->video_desc.width = st->codecpar->width;
699699
s->video_desc.height = st->codecpar->height;
700-
s->video_desc.fps = (double)st->r_frame_rate.num / st->r_frame_rate.den;
700+
s->video_desc.fps =
701+
(double) st->avg_frame_rate.num / st->avg_frame_rate.den;
701702
s->video_desc.tile_count = 1;
702703
if (s->no_decode) {
703704
s->video_desc.color_spec =

0 commit comments

Comments
 (0)