input/demux: introduce DemuxNameFromExtension
input/demux: introduce DemuxNameFromExtension

This helper function implements the same logic as was previously
written directly inside demux_NewAdvanced. As its implementation is
rather long it was decided to move it to a function of its own.

Given that there are many strings to compare, we take advantage of
bsearch in order to do lookup in O(log N) instead of O(N).

Signed-off-by: Jean-Baptiste Kempf <7b85a41a628204b76aba4326273a3ccc74bd009a@videolan.org>

xkfz007/vlc,xkfz007/vlc,xkfz007/vlc,xkfz007/vlc,xkfz007/vlc,xkfz007/vlc,xkfz007/vlc