+ if( !b_trash )
+ {
+ i_shortcut_bonus = i_short * 10000;
+ break;
+ }
+
+ /* Go to the next shortcut... This is so lame! */
+ while( *psz_name )
+ {
+ psz_name++;
+ }
+ psz_name++;
+ i_short--;
+ }
+
+ if( b_trash )
+ {
+ continue;
+ }
+ }
+ /* If we didn't require a shortcut, trash zero-scored plugins */
+ else if( !p_module->i_score )
+ {
+ continue;
+ }
+
+ /* Special case: test if we requested a particular intf plugin */
+ if( p_module->psz_program
+ && !strcmp( p_module->psz_program,
+ p_this->p_vlc->psz_object_name ) )
+ {
+ if( !b_intf )
+ {
+ /* Remove previous non-matching plugins */
+ i_index = 0;
+ b_intf = VLC_TRUE;
+ }
+ }
+ else if( b_intf )
+ {
+ /* This one doesn't match */
+ continue;
+ }
+
+ /* Store this new module */
+ p_list[ i_index ].p_module = p_module;
+ p_list[ i_index ].i_score = p_module->i_score + i_shortcut_bonus;
+
+ /* Add it to the modules-to-probe list */
+ if( i_index == 0 )
+ {
+ p_list[ 0 ].p_next = NULL;
+ p_first = p_list;
+ }
+ else
+ {
+ /* Ok, so at school you learned that quicksort is quick, and
+ * bubble sort sucks raw eggs. But that's when dealing with
+ * thousands of items. Here we have barely 50. */
+ module_list_t *p_newlist = p_first;
+
+ if( p_first->i_score < p_list[ i_index ].i_score )
+ {
+ p_list[ i_index ].p_next = p_first;
+ p_first = &p_list[ i_index ];