summaryrefslogtreecommitdiffstats
path: root/sound/mpd/patches/210-support_raw_pcm_streams.patch
blob: 280082b3213f01c239cf10753951f4fdea30caaa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--- a/src/decoder/ffmpeg_decoder_plugin.c
+++ b/src/decoder/ffmpeg_decoder_plugin.c
@@ -387,6 +387,13 @@ ffmpeg_probe(struct decoder *decoder, st
 
 	unsigned char *buffer = g_malloc(BUFFER_SIZE);
 	size_t nbytes = decoder_read(decoder, is, buffer, BUFFER_SIZE);
+
+	if ((nbytes > 0) && (nbytes < 1024))
+	{
+		// Gobble some more data if header is small
+		nbytes += decoder_read(decoder, is, buffer + nbytes, BUFFER_SIZE - nbytes);
+	}
+
 	if (nbytes <= PADDING ||
 	    !input_stream_lock_seek(is, 0, SEEK_SET, NULL)) {
 		g_free(buffer);
@@ -683,6 +690,7 @@ static const char *const ffmpeg_mime_typ
 	"audio/qcelp",
 	"audio/vorbis",
 	"audio/vorbis+ogg",
+	"audio/wav",
 	"audio/x-8svx",
 	"audio/x-16sv",
 	"audio/x-aac",