[PATCH] winegstreamer: Use WAVE_FORMAT_PCM when possible for demux

Maarten Lankhorst m.b.lankhorst at gmail.com
Tue Sep 13 08:32:31 CDT 2011


Fixes bug 28337, caused by using WAVE_FORMAT_EXTENSIBLE.

I should probably allow more formats, but that's a separate patch. :)

Signed-off-by: Maarten Lankhorst <m.b.lankhorst at gmail.com>

---
 dlls/winegstreamer/gstdemux.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c
index 6670d6b..655a9f2 100644
--- a/dlls/winegstreamer/gstdemux.c
+++ b/dlls/winegstreamer/gstdemux.c
@@ -147,8 +147,13 @@ static int amt_from_gst_caps_audio(GstCaps *caps, AM_MEDIA_TYPE *amt) {
     if (!strcmp(typename, "audio/x-raw-float")) {
         wfe->SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT;
         wfx->wBitsPerSample = wfe->Samples.wValidBitsPerSample = 32;
-    } else
+    } else {
         wfe->SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
+        if (wfx->nChannels <= 2 && bpp <= 16 && depth == bpp)  {
+            wfx->wFormatTag = WAVE_FORMAT_PCM;
+            wfx->cbSize = 0;
+        }
+    }
     wfx->nBlockAlign = wfx->nChannels * wfx->wBitsPerSample/8;
     wfx->nAvgBytesPerSec = wfx->nSamplesPerSec * wfx->nBlockAlign;
     return 1;
-- 
1.7.6




More information about the wine-patches mailing list