From 7811bbf9accc83d9efda6e01237db9cf0bb354c5 Mon Sep 17 00:00:00 2001 From: j-b-m Date: Mon, 22 Sep 2008 20:39:51 +0000 Subject: [PATCH] producer_pixbuf.c, qimage_wrapper.c: Add "force_reload" option to force image reloading in the image producers git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@1182 d19143bc-622f-0410-bfdd-b5b2a6649095 --- src/modules/gtk2/producer_pixbuf.c | 8 ++++++++ src/modules/qimage/qimage_wrapper.cpp | 8 ++++++++ 2 files changed, 16 insertions(+), 0 deletions(-) diff --git a/src/modules/gtk2/producer_pixbuf.c b/src/modules/gtk2/producer_pixbuf.c index 4e27d65..d24c920 100644 --- a/src/modules/gtk2/producer_pixbuf.c +++ b/src/modules/gtk2/producer_pixbuf.c @@ -98,6 +98,14 @@ static void refresh_image( mlt_frame frame, int width, int height ) // Obtain properties of producer mlt_properties producer_props = MLT_PRODUCER_PROPERTIES( producer ); + // Check if user wants us to reload the image + if ( mlt_properties_get_int( producer_props, "force_reload" ) ) + { + pixbuf = NULL; + this->image = NULL; + mlt_properties_set_int( producer_props, "force_reload", 0 ); + } + // Obtain the cache flag and structure int use_cache = mlt_properties_get_int( producer_props, "cache" ); mlt_properties cache = mlt_properties_get_data( producer_props, "_cache", NULL ); diff --git a/src/modules/qimage/qimage_wrapper.cpp b/src/modules/qimage/qimage_wrapper.cpp index 780fb92..2856324 100644 --- a/src/modules/qimage/qimage_wrapper.cpp +++ b/src/modules/qimage/qimage_wrapper.cpp @@ -92,6 +92,14 @@ void refresh_qimage( mlt_frame frame, int width, int height ) // Obtain properties of producer mlt_properties producer_props = MLT_PRODUCER_PROPERTIES( producer ); + // Check if user wants us to reload the image + if ( mlt_properties_get_int( producer_props, "force_reload" ) ) + { + qimage = NULL; + self->current_image = NULL; + mlt_properties_set_int( producer_props, "force_reload", 0 ); + } + // Obtain the cache flag and structure int use_cache = mlt_properties_get_int( producer_props, "cache" ); mlt_properties cache = ( mlt_properties )mlt_properties_get_data( producer_props, "_cache", NULL ); -- 1.7.4.4