Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
10eea9d9
Commit
10eea9d9
authored
Nov 10, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder: fall back to next plugin
When a plugin is unable to decode a song, try the other plugins.
parent
cad37b2e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
decoder_thread.c
src/decoder_thread.c
+16
-4
No files found.
src/decoder_thread.c
View file @
10eea9d9
...
...
@@ -60,6 +60,9 @@ decoder_stream_decode(const struct decoder_plugin *plugin,
assert
(
input_stream
->
ready
);
assert
(
dc
.
state
==
DECODE_STATE_START
);
/* rewind the stream, so each plugin gets a fresh start */
input_stream_seek
(
input_stream
,
0
,
SEEK_SET
);
ret
=
plugin
->
stream_decode
(
decoder
,
input_stream
);
if
(
ret
)
{
...
...
@@ -173,7 +176,10 @@ static void decoder_run(void)
continue
;
ret
=
decoder_stream_decode
(
plugin
,
&
decoder
,
&
input_stream
);
break
;
if
(
ret
)
break
;
plugin
=
NULL
;
}
/* if that fails, try suffix matching the URL: */
...
...
@@ -187,7 +193,11 @@ static void decoder_run(void)
continue
;
ret
=
decoder_stream_decode
(
plugin
,
&
decoder
,
&
input_stream
);
break
;
if
(
ret
)
break
;
assert
(
dc
.
state
==
DECODE_STATE_START
);
plugin
=
NULL
;
}
}
/* fallback to mp3: */
...
...
@@ -213,11 +223,13 @@ static void decoder_run(void)
close_instream
=
false
;
ret
=
decoder_file_decode
(
plugin
,
&
decoder
,
uri
);
break
;
if
(
ret
)
break
;
}
else
if
(
plugin
->
stream_decode
!=
NULL
)
{
ret
=
decoder_stream_decode
(
plugin
,
&
decoder
,
&
input_stream
);
break
;
if
(
ret
)
break
;
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment