From 8b3c0478c5c34e7dab6a2679991e6c1ea9705427 Mon Sep 17 00:00:00 2001 From: nick black Date: Sun, 7 Feb 2021 22:44:46 -0500 Subject: [PATCH] ncplayer: show correct blitter string #1336 --- src/media/ffmpeg.cpp | 6 ++++++ src/media/oiio.cpp | 6 ++++++ src/player/play.cpp | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/media/ffmpeg.cpp b/src/media/ffmpeg.cpp index da792e29f..f9263692f 100644 --- a/src/media/ffmpeg.cpp +++ b/src/media/ffmpeg.cpp @@ -399,6 +399,12 @@ int ffmpeg_stream(notcurses* nc, ncvisual* ncv, float timescale, if(activevopts.n){ ncplane_erase(activevopts.n); // new frame could be partially transparent } + // decay the blitter explicitly, so that the callback knows the blitter it + // was actually rendered with + auto bset = rgba_blitter(nc, &activevopts); + if(bset){ + activevopts.blitter = bset->geom; + } if((newn = ncvisual_render(nc, ncv, &activevopts)) == NULL){ if(activevopts.n != vopts->n){ ncplane_destroy(activevopts.n); diff --git a/src/media/oiio.cpp b/src/media/oiio.cpp index c0d222dda..0182cc0e4 100644 --- a/src/media/oiio.cpp +++ b/src/media/oiio.cpp @@ -191,6 +191,12 @@ auto oiio_stream(notcurses* nc, ncvisual* ncv, float timescale, memcpy(&activevopts, vopts, sizeof(*vopts)); int ncerr; do{ + // decay the blitter explicitly, so that the callback knows the blitter it + // was actually rendered with + auto bset = rgba_blitter(nc, &activevopts); + if(bset){ + activevopts.blitter = bset->geom; + } if((newn = ncvisual_render(nc, ncv, &activevopts)) == NULL){ if(activevopts.n != vopts->n){ ncplane_destroy(activevopts.n); diff --git a/src/player/play.cpp b/src/player/play.cpp index 0f329f5a3..44980fb18 100644 --- a/src/player/play.cpp +++ b/src/player/play.cpp @@ -66,7 +66,7 @@ auto perframe(struct ncvisual* ncv, struct ncvisual_options* vopts, } if(!marsh->quiet){ stdn->printf(0, NCAlign::Left, "frame %06d\u2026 (%s)", marsh->framecount, - notcurses_str_blitter(marsh->blitter)); + notcurses_str_blitter(vopts->blitter)); } char* subtitle = ncvisual_subtitle(ncv); if(subtitle){