decoder_thread: don't fall back to "mad" unless no plugin matches

When all plugins have failed, MPD used to fall back to the "mad"
decoder plugin, to handle those radio streams without a Content-Type
response header.  This however leads to unexpected results (garbage
being played) when the stream isn't really mp3.  Since we care little
about "bad" streams, we shouldn't have hacks which have bad side
effects.

Let's get rid of this hack now!  Only try to "mad" plugin if there was
no match at all (Content-Type, path suffix) and no other plugin has
been tried.
This commit is contained in:
Max Kellermann 2010-01-17 17:08:56 +01:00
parent 8ac776c58b
commit 9d4b7ab113
2 changed files with 3 additions and 1 deletions

1
NEWS
View File

@ -20,6 +20,7 @@ ver 0.16 (20??/??/??)
- id3: revised "performer" tag support - id3: revised "performer" tag support
* decoders: * decoders:
- don't try a plugin twice (MIME type & suffix) - don't try a plugin twice (MIME type & suffix)
- don't fall back to "mad" unless no plugin matches
- ffmpeg: support multiple tags - ffmpeg: support multiple tags
- ffmpeg: convert metadata to generic format - ffmpeg: convert metadata to generic format
- sndfile: new decoder plugin based on libsndfile - sndfile: new decoder plugin based on libsndfile

View File

@ -282,7 +282,8 @@ decoder_run_stream(struct decoder *decoder, const char *uri)
&tried) || &tried) ||
/* fallback to mp3: this is needed for bastard streams /* fallback to mp3: this is needed for bastard streams
that don't have a suffix or set the mimeType */ that don't have a suffix or set the mimeType */
decoder_run_stream_fallback(decoder, input_stream); (tried == NULL &&
decoder_run_stream_fallback(decoder, input_stream));
g_slist_free(tried); g_slist_free(tried);