(video_filter.c) Cleanups
This commit is contained in:
parent
ef51ef1fb1
commit
e58f91406f
|
@ -237,7 +237,8 @@ static bool create_softfilter_graph(rarch_softfilter_t *filt,
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_THREADS
|
#ifdef HAVE_THREADS
|
||||||
if(filt->threads>1){
|
if (filt->threads > 1)
|
||||||
|
{
|
||||||
filt->thread_data = (struct filter_thread_data*)
|
filt->thread_data = (struct filter_thread_data*)
|
||||||
calloc(threads, sizeof(*filt->thread_data));
|
calloc(threads, sizeof(*filt->thread_data));
|
||||||
if (!filt->thread_data)
|
if (!filt->thread_data)
|
||||||
|
@ -246,15 +247,15 @@ static bool create_softfilter_graph(rarch_softfilter_t *filt,
|
||||||
for (i = 0; i < threads; i++)
|
for (i = 0; i < threads; i++)
|
||||||
{
|
{
|
||||||
filt->thread_data[i].userdata = filt->impl_data;
|
filt->thread_data[i].userdata = filt->impl_data;
|
||||||
filt->thread_data[i].done = true;
|
filt->thread_data[i].done = true;
|
||||||
|
|
||||||
filt->thread_data[i].lock = slock_new();
|
filt->thread_data[i].lock = slock_new();
|
||||||
if (!filt->thread_data[i].lock)
|
if (!filt->thread_data[i].lock)
|
||||||
return false;
|
return false;
|
||||||
filt->thread_data[i].cond = scond_new();
|
filt->thread_data[i].cond = scond_new();
|
||||||
if (!filt->thread_data[i].cond)
|
if (!filt->thread_data[i].cond)
|
||||||
return false;
|
return false;
|
||||||
filt->thread_data[i].thread = sthread_create(
|
filt->thread_data[i].thread = sthread_create(
|
||||||
filter_thread_loop, &filt->thread_data[i]);
|
filter_thread_loop, &filt->thread_data[i]);
|
||||||
if (!filt->thread_data[i].thread)
|
if (!filt->thread_data[i].thread)
|
||||||
return false;
|
return false;
|
||||||
|
@ -276,8 +277,9 @@ static bool append_softfilter_plugs(rarch_softfilter_t *filt,
|
||||||
{
|
{
|
||||||
softfilter_get_implementation_t cb;
|
softfilter_get_implementation_t cb;
|
||||||
const struct softfilter_implementation *impl = NULL;
|
const struct softfilter_implementation *impl = NULL;
|
||||||
struct rarch_soft_plug *new_plugs = NULL;
|
struct rarch_soft_plug *new_plugs = NULL;
|
||||||
dylib_t lib = dylib_load(list->elems[i].data);
|
dylib_t lib =
|
||||||
|
dylib_load(list->elems[i].data);
|
||||||
|
|
||||||
if (!lib)
|
if (!lib)
|
||||||
continue;
|
continue;
|
||||||
|
@ -315,8 +317,8 @@ static bool append_softfilter_plugs(rarch_softfilter_t *filt,
|
||||||
RARCH_LOG("[SoftFilter]: Found plug: %s (%s).\n",
|
RARCH_LOG("[SoftFilter]: Found plug: %s (%s).\n",
|
||||||
impl->ident, impl->short_ident);
|
impl->ident, impl->short_ident);
|
||||||
|
|
||||||
filt->plugs = new_plugs;
|
filt->plugs = new_plugs;
|
||||||
filt->plugs[filt->num_plugs].lib = lib;
|
filt->plugs[filt->num_plugs].lib = lib;
|
||||||
filt->plugs[filt->num_plugs].impl = impl;
|
filt->plugs[filt->num_plugs].impl = impl;
|
||||||
filt->num_plugs++;
|
filt->num_plugs++;
|
||||||
}
|
}
|
||||||
|
@ -400,11 +402,8 @@ rarch_softfilter_t *rarch_softfilter_new(const char *filter_config,
|
||||||
char ext_name[PATH_MAX_LENGTH];
|
char ext_name[PATH_MAX_LENGTH];
|
||||||
#endif
|
#endif
|
||||||
struct string_list *plugs = NULL;
|
struct string_list *plugs = NULL;
|
||||||
rarch_softfilter_t *filt = NULL;
|
rarch_softfilter_t *filt = (rarch_softfilter_t*)
|
||||||
|
calloc(1, sizeof(*filt));
|
||||||
(void)basedir;
|
|
||||||
|
|
||||||
filt = (rarch_softfilter_t*)calloc(1, sizeof(*filt));
|
|
||||||
if (!filt)
|
if (!filt)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -477,7 +476,8 @@ void rarch_softfilter_free(rarch_softfilter_t *filt)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_THREADS
|
#ifdef HAVE_THREADS
|
||||||
if(filt->threads>1){
|
if (filt->threads > 1)
|
||||||
|
{
|
||||||
for (i = 0; i < filt->threads; i++)
|
for (i = 0; i < filt->threads; i++)
|
||||||
{
|
{
|
||||||
if (!filt->thread_data[i].thread)
|
if (!filt->thread_data[i].thread)
|
||||||
|
|
Loading…
Reference in New Issue