From 616334f2b98508389c62b3b1906720d143060df1 Mon Sep 17 00:00:00 2001 From: nick black Date: Tue, 20 Oct 2020 23:24:00 -0400 Subject: [PATCH] implement FFmpeg ncvisual_decode_loop() #1066 --- src/lib/ffmpeg.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/lib/ffmpeg.cpp b/src/lib/ffmpeg.cpp index 4cb0fc85a..fcd882683 100644 --- a/src/lib/ffmpeg.cpp +++ b/src/lib/ffmpeg.cpp @@ -394,6 +394,17 @@ int ncvisual_stream(notcurses* nc, ncvisual* ncv, float timescale, return ncerr; } +int ncvisual_decode_loop(ncvisual* ncv){ + int r = ncvisual_decode(ncv); + if(r == 1){ + if(av_seek_frame(ncv->details.fmtctx, ncv->details.stream_index, 0, AVSEEK_FLAG_FRAME) < 0){ + // FIXME log error + return -1; + } + } + return r; +} + int ncvisual_blit(ncvisual* ncv, int rows, int cols, ncplane* n, const struct blitset* bset, int placey, int placex, int begy, int begx, int leny, int lenx,