From ec25f5e12f2d6102eac2adffb63237452136a6e8 Mon Sep 17 00:00:00 2001 From: "Alfred E. Heggestad" Date: Sun, 1 Jan 2017 13:43:08 +0100 Subject: avformat: compile fix for old versions of ffmpeg --- modules/avformat/avformat.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'modules') diff --git a/modules/avformat/avformat.c b/modules/avformat/avformat.c index ae450c8..6a15fe4 100644 --- a/modules/avformat/avformat.c +++ b/modules/avformat/avformat.c @@ -65,6 +65,7 @@ struct vidsrc_st { vidsrc_frame_h *frameh; void *arg; int sindex; + int fps; }; @@ -173,8 +174,12 @@ static void handle_packet(struct vidsrc_st *st, AVPacket *pkt) st->frameh(&vf, st->arg); +#if LIBAVUTIL_VERSION_INT > ((49<<16)+(15<<8)+100) /* simulate framerate (NOTE: not accurate) */ dur = 1.0 * av_frame_get_pkt_duration(frame) * av_q2d(st->time_base); +#else + dur = 1.0 / st->fps; +#endif sys_msleep(1000.0 * dur); out: @@ -251,6 +256,7 @@ static int alloc(struct vidsrc_st **stp, const struct vidsrc *vs, st->sz = *size; st->frameh = frameh; st->arg = arg; + st->fps = prm->fps; /* * avformat_open_input() was added in lavf 53.2.0 according to -- cgit v1.2.3