summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAlfred E. Heggestad <alfred.heggestad@gmail.com>2017-01-01 13:43:08 +0100
committerAlfred E. Heggestad <alfred.heggestad@gmail.com>2017-01-01 13:43:08 +0100
commitec25f5e12f2d6102eac2adffb63237452136a6e8 (patch)
treeae319e3b82be65ba1a3669a6b36691a2983d4398 /modules
parent1cc463c767498ba2e0928916632084c1f0bb13df (diff)
avformat: compile fix for old versions of ffmpeg
Diffstat (limited to 'modules')
-rw-r--r--modules/avformat/avformat.c6
1 files changed, 6 insertions, 0 deletions
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