From 1fda1e0b28462c1f4ccc334d8af783fd291a983d Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 26 Jun 2020 18:39:34 +0200 Subject: [PATCH] Revert "Cleanups" This reverts commit a9c8cf205d6e9a57d4dfdb0667fe981b33b017b4. --- gfx/video_filter.c | 53 +++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/gfx/video_filter.c b/gfx/video_filter.c index f587f3e63b..396a713cd6 100644 --- a/gfx/video_filter.c +++ b/gfx/video_filter.c @@ -43,27 +43,6 @@ struct rarch_soft_plug const struct softfilter_implementation *impl; }; -struct rarch_softfilter -{ - config_file_t *conf; - - const struct softfilter_implementation *impl; - void *impl_data; - - struct rarch_soft_plug *plugs; - unsigned num_plugs; - - unsigned max_width, max_height; - enum retro_pixel_format pix_fmt, out_pix_fmt; - - struct softfilter_work_packet *packets; - unsigned threads; - -#ifdef HAVE_THREADS - struct filter_thread_data *thread_data; -#endif -}; - #ifdef HAVE_THREADS #include @@ -105,6 +84,27 @@ static void filter_thread_loop(void *data) } #endif +struct rarch_softfilter +{ + config_file_t *conf; + + const struct softfilter_implementation *impl; + void *impl_data; + + struct rarch_soft_plug *plugs; + unsigned num_plugs; + + unsigned max_width, max_height; + enum retro_pixel_format pix_fmt, out_pix_fmt; + + struct softfilter_work_packet *packets; + unsigned threads; + +#ifdef HAVE_THREADS + struct filter_thread_data *thread_data; +#endif +}; + static const struct softfilter_implementation * softfilter_find_implementation(rarch_softfilter_t *filt, const char *ident) { @@ -537,8 +537,7 @@ void rarch_softfilter_process(rarch_softfilter_t *filt, output, output_stride, input, width, height, input_stride); #ifdef HAVE_THREADS - if (filt->threads > 1) - { + if(filt->threads>1){ /* Fire off workers */ for (i = 0; i < filt->threads; i++) { @@ -563,10 +562,12 @@ void rarch_softfilter_process(rarch_softfilter_t *filt, scond_wait(filt->thread_data[i].cond, filt->thread_data[i].lock); slock_unlock(filt->thread_data[i].lock); } - return; + } else { + for (i = 0; i < filt->threads; i++) + filt->packets[i].work(filt->impl_data, filt->packets[i].thread_data); } -#endif - +#else for (i = 0; i < filt->threads; i++) filt->packets[i].work(filt->impl_data, filt->packets[i].thread_data); +#endif }