diff options
Diffstat (limited to 'src/video_decode.c')
-rw-r--r-- | src/video_decode.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/video_decode.c b/src/video_decode.c index ea23aea..7ce6f42 100644 --- a/src/video_decode.c +++ b/src/video_decode.c @@ -100,6 +100,18 @@ video_decode_uninit(struct video_decode **_vd) } int +video_decode_seek(struct video_decode *_vd, int64_t timestamp) +{ + struct video_decode_priv *vd = (struct video_decode_priv *) _vd; + + if (vd->fmt_ctx->start_time != AV_NOPTS_VALUE) + timestamp += vd->fmt_ctx->start_time; + + return avformat_seek_file(vd->fmt_ctx, vd->stream, + INT64_MIN, timestamp, INT64_MAX,0); +} + +int video_decode_get_frame(struct video_decode *_vd, struct video_frame **frame) { struct video_decode_priv *vd = (struct video_decode_priv *) _vd; |