Commit d4a0c69d authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

amem: fix conditionally unitialized cleanup callback

parent 9b904a74
...@@ -56,12 +56,12 @@ struct aout_sys_t ...@@ -56,12 +56,12 @@ struct aout_sys_t
{ {
void *opaque; void *opaque;
int (*setup) (void **, char *, unsigned *, unsigned *); int (*setup) (void **, char *, unsigned *, unsigned *);
void (*cleanup) (void *opaque);
union union
{ {
struct struct
{ {
void *setup_opaque; void *setup_opaque;
void (*cleanup) (void *opaque);
}; };
struct struct
{ {
...@@ -243,11 +243,12 @@ static int Open (vlc_object_t *obj) ...@@ -243,11 +243,12 @@ static int Open (vlc_object_t *obj)
sys->setup = var_InheritAddress (obj, "amem-setup"); sys->setup = var_InheritAddress (obj, "amem-setup");
if (sys->setup != NULL) if (sys->setup != NULL)
{ {
sys->setup_opaque = opaque;
sys->cleanup = var_InheritAddress (obj, "amem-cleanup"); sys->cleanup = var_InheritAddress (obj, "amem-cleanup");
sys->setup_opaque = opaque;
} }
else else
{ {
sys->cleanup = NULL;
sys->opaque = opaque; sys->opaque = opaque;
sys->rate = var_InheritInteger (obj, "amem-rate"); sys->rate = var_InheritInteger (obj, "amem-rate");
sys->channels = var_InheritInteger (obj, "amem-channels"); sys->channels = var_InheritInteger (obj, "amem-channels");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment