decoder: moved code to decoder_try_decode()
This commit is contained in:
parent
5183d85886
commit
395aa4e847
@ -28,6 +28,16 @@
|
|||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "ls.h"
|
#include "ls.h"
|
||||||
|
|
||||||
|
static bool
|
||||||
|
decoder_try_decode(const struct decoder_plugin *plugin,
|
||||||
|
struct input_stream *input_stream)
|
||||||
|
{
|
||||||
|
if (plugin->try_decode == NULL)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return plugin->try_decode(input_stream);
|
||||||
|
}
|
||||||
|
|
||||||
static void decodeStart(void)
|
static void decodeStart(void)
|
||||||
{
|
{
|
||||||
struct song *song = dc.next_song;
|
struct song *song = dc.next_song;
|
||||||
@ -91,8 +101,7 @@ static void decodeStart(void)
|
|||||||
continue;
|
continue;
|
||||||
if (!(plugin->stream_types & INPUT_PLUGIN_STREAM_URL))
|
if (!(plugin->stream_types & INPUT_PLUGIN_STREAM_URL))
|
||||||
continue;
|
continue;
|
||||||
if (plugin->try_decode != NULL
|
if (!decoder_try_decode(plugin, &inStream))
|
||||||
&& !plugin->try_decode(&inStream))
|
|
||||||
continue;
|
continue;
|
||||||
ret = plugin->stream_decode(&decoder, &inStream);
|
ret = plugin->stream_decode(&decoder, &inStream);
|
||||||
break;
|
break;
|
||||||
@ -108,8 +117,7 @@ static void decodeStart(void)
|
|||||||
if (!(plugin->stream_types &
|
if (!(plugin->stream_types &
|
||||||
INPUT_PLUGIN_STREAM_URL))
|
INPUT_PLUGIN_STREAM_URL))
|
||||||
continue;
|
continue;
|
||||||
if (plugin->try_decode != NULL &&
|
if (!decoder_try_decode(plugin, &inStream))
|
||||||
!plugin->try_decode(&inStream))
|
|
||||||
continue;
|
continue;
|
||||||
decoder.plugin = plugin;
|
decoder.plugin = plugin;
|
||||||
ret = plugin->stream_decode(&decoder,
|
ret = plugin->stream_decode(&decoder,
|
||||||
@ -136,8 +144,7 @@ static void decodeStart(void)
|
|||||||
if (!plugin->stream_types & INPUT_PLUGIN_STREAM_FILE)
|
if (!plugin->stream_types & INPUT_PLUGIN_STREAM_FILE)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (plugin->try_decode != NULL &&
|
if (!decoder_try_decode(plugin, &inStream))
|
||||||
!plugin->try_decode(&inStream))
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (plugin->file_decode != NULL) {
|
if (plugin->file_decode != NULL) {
|
||||||
|
Loading…
Reference in New Issue
Block a user