https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8ebb0aa438c0a2f3405c3…
commit 8ebb0aa438c0a2f3405c3cff3154926f6a45a9ee
Author: Amine Khaldi <amine.khaldi(a)reactos.org>
AuthorDate: Sat Mar 24 13:14:19 2018 +0100
Commit: Amine Khaldi <amine.khaldi(a)reactos.org>
CommitDate: Sat Mar 24 13:14:19 2018 +0100
[WINEMP3.ACM] Sync with Wine Staging 3.3. CORE-14434
---
dll/win32/winemp3.acm/mpegl3.c | 41 +++++++++++++++++++++++++++--------------
media/doc/README.WINE | 2 +-
2 files changed, 28 insertions(+), 15 deletions(-)
diff --git a/dll/win32/winemp3.acm/mpegl3.c b/dll/win32/winemp3.acm/mpegl3.c
index 15acdeaad5..b28519f835 100644
--- a/dll/win32/winemp3.acm/mpegl3.c
+++ b/dll/win32/winemp3.acm/mpegl3.c
@@ -21,12 +21,12 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include <config.h>
-//#include "wine/port.h"
+#include "config.h"
+#include "wine/port.h"
#include <assert.h>
#include <stdarg.h>
-//#include <string.h>
+#include <string.h>
#ifdef HAVE_MPG123_H
# include <mpg123.h>
@@ -40,16 +40,16 @@
# endif
#endif
-#include <windef.h>
-#include <winbase.h>
-#include <wingdi.h>
-#include <winuser.h>
-#include <winnls.h>
-//#include "mmsystem.h"
-//#include "mmreg.h"
-//#include "msacm.h"
-#include <msacmdrv.h>
-#include <wine/debug.h>
+#include "windef.h"
+#include "winbase.h"
+#include "wingdi.h"
+#include "winuser.h"
+#include "winnls.h"
+#include "mmsystem.h"
+#include "mmreg.h"
+#include "msacm.h"
+#include "msacmdrv.h"
+#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(mpeg3);
@@ -215,6 +215,7 @@ static void MPEG3_Reset(PACMDRVSTREAMINSTANCE adsi, AcmMpeg3Data*
aad)
*/
static LRESULT MPEG3_StreamOpen(PACMDRVSTREAMINSTANCE adsi)
{
+ LRESULT error = MMSYSERR_NOTSUPPORTED;
AcmMpeg3Data* aad;
int err;
@@ -238,6 +239,18 @@ static LRESULT MPEG3_StreamOpen(PACMDRVSTREAMINSTANCE adsi)
adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_MPEG) &&
adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM)
{
+ if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_MPEGLAYER3)
+ {
+ MPEGLAYER3WAVEFORMAT *formatmp3 = (MPEGLAYER3WAVEFORMAT *)adsi->pwfxSrc;
+
+ if (adsi->pwfxSrc->cbSize < MPEGLAYER3_WFX_EXTRA_BYTES ||
+ formatmp3->wID != MPEGLAYER3_ID_MPEG)
+ {
+ error = ACMERR_NOTPOSSIBLE;
+ goto theEnd;
+ }
+ }
+
/* resampling or mono <=> stereo not available
* MPEG3 algo only define 16 bit per sample output
*/
@@ -273,7 +286,7 @@ static LRESULT MPEG3_StreamOpen(PACMDRVSTREAMINSTANCE adsi)
theEnd:
HeapFree(GetProcessHeap(), 0, aad);
adsi->dwDriver = 0L;
- return MMSYSERR_NOTSUPPORTED;
+ return error;
}
/***********************************************************************
diff --git a/media/doc/README.WINE b/media/doc/README.WINE
index b4bd2a8c39..41db149705 100644
--- a/media/doc/README.WINE
+++ b/media/doc/README.WINE
@@ -198,7 +198,7 @@ reactos/dll/win32/wbemdisp # Synced to WineStaging-3.3
reactos/dll/win32/wbemprox # Synced to WineStaging-3.3
reactos/dll/win32/windowscodecs # Synced to WineStaging-3.3
reactos/dll/win32/windowscodecsext # Synced to WineStaging-2.9
-reactos/dll/win32/winemp3.acm # Synced to Wine-3.0
+reactos/dll/win32/winemp3.acm # Synced to WineStaging-3.3
reactos/dll/win32/wing32 # Synced to WineStaging-2.9
reactos/dll/win32/winhttp # Synced to Wine-3.0
reactos/dll/win32/wininet # Synced to Wine-3.0