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

module_need: give up if pf_activate returns VLC_ETIMEOUT (fixes: #2872)

A plugin can use this if it matched but detected a non-recoverable error
while inside the open callback. Help yourself if you want a "better"
error code.
parent bb5bc9b0
...@@ -580,17 +580,31 @@ found_shortcut: ...@@ -580,17 +580,31 @@ found_shortcut:
#endif #endif
p_this->b_force = p_list[i].b_force; p_this->b_force = p_list[i].b_force;
if( p_cand->pf_activate
&& p_cand->pf_activate( p_this ) == VLC_SUCCESS ) int ret = VLC_SUCCESS;
if( p_cand->pf_activate )
ret = p_cand->pf_activate( p_this );
switch( ret )
{ {
case VLC_SUCCESS:
/* good module! */
p_module = p_cand; p_module = p_cand;
break;
case VLC_ETIMEOUT:
/* good module, but aborted */
module_release( p_cand );
break;
default: /* bad module */
module_release( p_cand );
continue;
}
/* Release the remaining modules */ /* Release the remaining modules */
while (++i < count) while (++i < count)
module_release (p_list[i].p_module); module_release (p_list[i].p_module);
} }
else
module_release( p_cand );
}
free( p_list ); free( p_list );
p_this->b_force = b_force_backup; p_this->b_force = b_force_backup;
......
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