Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/mp3dmod/mp3dmod.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/mp3dmod/mp3dmod.c b/dlls/mp3dmod/mp3dmod.c index 0f1f069..9592280 100644 --- a/dlls/mp3dmod/mp3dmod.c +++ b/dlls/mp3dmod/mp3dmod.c @@ -127,7 +127,7 @@ static HRESULT WINAPI MediaObject_SetInputType(IMediaObject *iface, DWORD index, { FIXME("(%p)->(%d, %p, %#x) stub!\n", iface, index, type, flags);
- return E_NOTIMPL; + return S_OK; }
static HRESULT WINAPI MediaObject_SetOutputType(IMediaObject *iface, DWORD index, const DMO_MEDIA_TYPE *type, DWORD flags)
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/mp3dmod/Makefile.in | 2 +- dlls/mp3dmod/mp3dmod.c | 44 ++++++++++++++++++++++++++++++++++++++++++-- include/mediaobj.idl | 5 +++++ 3 files changed, 48 insertions(+), 3 deletions(-)
diff --git a/dlls/mp3dmod/Makefile.in b/dlls/mp3dmod/Makefile.in index 5bcef48..0ac6d96 100644 --- a/dlls/mp3dmod/Makefile.in +++ b/dlls/mp3dmod/Makefile.in @@ -1,5 +1,5 @@ MODULE = mp3dmod.dll -IMPORTS = dmoguids uuid wmcodecdspuuid +IMPORTS = dmoguids msdmo uuid wmcodecdspuuid EXTRAINCL = $(MPG123_CFLAGS) EXTRALIBS = $(MPG123_LIBS)
diff --git a/dlls/mp3dmod/mp3dmod.c b/dlls/mp3dmod/mp3dmod.c index 9592280..2922082 100644 --- a/dlls/mp3dmod/mp3dmod.c +++ b/dlls/mp3dmod/mp3dmod.c @@ -22,8 +22,11 @@ #include <mpg123.h> #include "windef.h" #include "winbase.h" +#include "wingdi.h" +#include "mmreg.h" #define COBJMACROS #include "objbase.h" +#include "dmo.h" #include "rpcproxy.h" #include "wmcodecdsp.h" #include "wine/debug.h" @@ -37,6 +40,7 @@ struct mp3_decoder { IMediaObject IMediaObject_iface; LONG ref; mpg123_handle *mh; + DMO_MEDIA_TYPE outtype; };
static inline struct mp3_decoder *impl_from_IMediaObject(IMediaObject *iface) @@ -132,9 +136,44 @@ static HRESULT WINAPI MediaObject_SetInputType(IMediaObject *iface, DWORD index,
static HRESULT WINAPI MediaObject_SetOutputType(IMediaObject *iface, DWORD index, const DMO_MEDIA_TYPE *type, DWORD flags) { - FIXME("(%p)->(%d, %p, %#x) stub!\n", iface, index, type, flags); + struct mp3_decoder *This = impl_from_IMediaObject(iface); + WAVEFORMATEX *format; + long enc; + int err;
- return E_NOTIMPL; + TRACE("(%p)->(%d, %p, %#x)\n", iface, index, type, flags); + + if (flags & DMO_SET_TYPEF_CLEAR) + { + MoFreeMediaType(&This->outtype); + return S_OK; + } + + format = (WAVEFORMATEX *)type->pbFormat; + + if (format->wBitsPerSample == 8) + enc = MPG123_ENC_UNSIGNED_8; + else if (format->wBitsPerSample == 16) + enc = MPG123_ENC_SIGNED_16; + else + { + ERR("Cannot decode to bit depth %u.\n", format->wBitsPerSample); + return DMO_E_TYPE_NOT_ACCEPTED; + } + + if (!(flags & DMO_SET_TYPEF_TEST_ONLY)) + { + err = mpg123_format(This->mh, format->nSamplesPerSec, format->nChannels, enc); + if (err != MPG123_OK) + { + ERR("Failed to set format: %u channels, %u samples/sec, %u bits/sample.\n", + format->nChannels, format->nSamplesPerSec, format->wBitsPerSample); + return DMO_E_TYPE_NOT_ACCEPTED; + } + MoCopyMediaType(&This->outtype, type); + } + + return S_OK; }
static HRESULT WINAPI MediaObject_GetInputCurrentType(IMediaObject *iface, DWORD index, DMO_MEDIA_TYPE *type) @@ -277,6 +316,7 @@ static HRESULT create_mp3_decoder(REFIID iid, void **obj)
mpg123_init(); This->mh = mpg123_new(NULL, &err); + mpg123_format_none(This->mh);
return IMediaObject_QueryInterface(&This->IMediaObject_iface, iid, obj); } diff --git a/include/mediaobj.idl b/include/mediaobj.idl index 3c426f7..b6ae236 100644 --- a/include/mediaobj.idl +++ b/include/mediaobj.idl @@ -102,6 +102,11 @@ enum _DMO_INPLACE_PROCESS_FLAGS { DMO_INPLACE_ZERO = 0x00000001 };
+enum _DMO_SET_TYPE_FLAGS { + DMO_SET_TYPEF_TEST_ONLY = 0x00000001, + DMO_SET_TYPEF_CLEAR = 0x00000002, +}; + /***************************************************************************** * IMediaObject interface */
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/mp3dmod/mp3dmod.c | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-)
diff --git a/dlls/mp3dmod/mp3dmod.c b/dlls/mp3dmod/mp3dmod.c index 2922082..ccba5c0 100644 --- a/dlls/mp3dmod/mp3dmod.c +++ b/dlls/mp3dmod/mp3dmod.c @@ -41,6 +41,7 @@ struct mp3_decoder { LONG ref; mpg123_handle *mh; DMO_MEDIA_TYPE outtype; + IMediaBuffer *buffer; };
static inline struct mp3_decoder *impl_from_IMediaObject(IMediaObject *iface) @@ -256,10 +257,36 @@ static HRESULT WINAPI MediaObject_GetInputStatus(IMediaObject *iface, DWORD inde static HRESULT WINAPI MediaObject_ProcessInput(IMediaObject *iface, DWORD index, IMediaBuffer *buffer, DWORD flags, REFERENCE_TIME timestamp, REFERENCE_TIME timelength) { - FIXME("(%p)->(%d, %p, %#x, %s, %s) stub!\n", iface, index, buffer, flags, + struct mp3_decoder *This = impl_from_IMediaObject(iface); + HRESULT hr; + BYTE *data; + DWORD len; + int err; + + TRACE("(%p)->(%d, %p, %#x, %s, %s)\n", iface, index, buffer, flags, wine_dbgstr_longlong(timestamp), wine_dbgstr_longlong(timelength));
- return E_NOTIMPL; + if (This->buffer) + { + ERR("Already have a buffer.\n"); + return DMO_E_NOTACCEPTING; + } + + IMediaBuffer_AddRef(buffer); + This->buffer = buffer; + + hr = IMediaBuffer_GetBufferAndLength(buffer, &data, &len); + if (FAILED(hr)) + return hr; + + err = mpg123_feed(This->mh, data, len); + if (err != MPG123_OK) + { + ERR("mpg123_feed() failed: %s\n", mpg123_strerror(This->mh)); + return E_FAIL; + } + + return S_OK; }
static HRESULT WINAPI MediaObject_ProcessOutput(IMediaObject *iface, DWORD flags, DWORD count, DMO_OUTPUT_DATA_BUFFER *buffers, DWORD *status) @@ -308,7 +335,7 @@ static HRESULT create_mp3_decoder(REFIID iid, void **obj) struct mp3_decoder *This; int err;
- if (!(This = heap_alloc(sizeof(*This)))) + if (!(This = heap_alloc_zero(sizeof(*This)))) return E_OUTOFMEMORY;
This->IMediaObject_iface.lpVtbl = &IMediaObject_vtbl; @@ -316,6 +343,7 @@ static HRESULT create_mp3_decoder(REFIID iid, void **obj)
mpg123_init(); This->mh = mpg123_new(NULL, &err); + mpg123_open_feed(This->mh); mpg123_format_none(This->mh);
return IMediaObject_QueryInterface(&This->IMediaObject_iface, iid, obj);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/mp3dmod/mp3dmod.c | 70 ++++++++++++++++++++++++++++++++++++++++++++++++-- include/mediaobj.idl | 7 +++++ 2 files changed, 75 insertions(+), 2 deletions(-)
diff --git a/dlls/mp3dmod/mp3dmod.c b/dlls/mp3dmod/mp3dmod.c index ccba5c0..0d97909 100644 --- a/dlls/mp3dmod/mp3dmod.c +++ b/dlls/mp3dmod/mp3dmod.c @@ -19,6 +19,7 @@ */
#include <stdarg.h> +#include <stdio.h> #include <mpg123.h> #include "windef.h" #include "winbase.h" @@ -289,11 +290,76 @@ static HRESULT WINAPI MediaObject_ProcessInput(IMediaObject *iface, DWORD index, return S_OK; }
+static DWORD get_framesize(DMO_MEDIA_TYPE *type) +{ + WAVEFORMATEX *format = (WAVEFORMATEX *)type->pbFormat; + return 1152 * format->nBlockAlign; +} + static HRESULT WINAPI MediaObject_ProcessOutput(IMediaObject *iface, DWORD flags, DWORD count, DMO_OUTPUT_DATA_BUFFER *buffers, DWORD *status) { - FIXME("(%p)->(%x, %d, %p, %p) stub!\n", iface, flags, count, buffers, status); + struct mp3_decoder *This = impl_from_IMediaObject(iface); + DWORD len, maxlen, framesize; + int got_data = 0; + size_t written; + HRESULT hr; + BYTE *data; + int err;
- return E_NOTIMPL; + TRACE("(%p)->(%#x, %d, %p, %p)\n", iface, flags, count, buffers, status); + + if (count > 1) + FIXME("Multiple buffers not handled.\n"); + + buffers[0].dwStatus = 0; + + if (!This->buffer) + return S_FALSE; + + buffers[0].dwStatus |= DMO_OUTPUT_DATA_BUFFERF_SYNCPOINT; + + hr = IMediaBuffer_GetBufferAndLength(buffers[0].pBuffer, &data, &len); + if (FAILED(hr)) return hr; + + hr = IMediaBuffer_GetMaxLength(buffers[0].pBuffer, &maxlen); + if (FAILED(hr)) return hr; + + framesize = get_framesize(&This->outtype); + + while (1) + { + if (maxlen - len < framesize) + { + buffers[0].dwStatus |= DMO_OUTPUT_DATA_BUFFERF_INCOMPLETE; + break; + } + + while ((err = mpg123_read(This->mh, data + len, framesize, &written)) == MPG123_NEW_FORMAT); + if (err == MPG123_NEED_MORE) + { + IMediaBuffer_Release(This->buffer); + This->buffer = NULL; + break; + } + else if (err == MPG123_ERR) + ERR("mpg123_read() failed: %s\n", mpg123_strerror(This->mh)); + else if (err != MPG123_OK) + ERR("mpg123_read() returned %d\n", err); + if (written < framesize) + ERR("short write: %zd/%u\n", written, framesize); + + got_data = 1; + + len += framesize; + hr = IMediaBuffer_SetLength(buffers[0].pBuffer, len); + if (FAILED(hr)) return hr; + } + + if (got_data) + { + return S_OK; + } + return S_FALSE; }
static HRESULT WINAPI MediaObject_Lock(IMediaObject *iface, LONG lock) diff --git a/include/mediaobj.idl b/include/mediaobj.idl index b6ae236..7759921 100644 --- a/include/mediaobj.idl +++ b/include/mediaobj.idl @@ -107,6 +107,13 @@ enum _DMO_SET_TYPE_FLAGS { DMO_SET_TYPEF_CLEAR = 0x00000002, };
+enum _DMO_OUTPUT_DATA_BUFFERF_FLAGS { + DMO_OUTPUT_DATA_BUFFERF_SYNCPOINT = 0x00000001, + DMO_OUTPUT_DATA_BUFFERF_TIME = 0x00000002, + DMO_OUTPUT_DATA_BUFFERF_TIMELENGTH = 0x00000004, + DMO_OUTPUT_DATA_BUFFERF_INCOMPLETE = 0x01000000, +}; + /***************************************************************************** * IMediaObject interface */
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- configure | 1 + configure.ac | 1 + dlls/mp3dmod/tests/Makefile.in | 5 + dlls/mp3dmod/tests/mp3dmod.c | 237 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 244 insertions(+) create mode 100644 dlls/mp3dmod/tests/Makefile.in create mode 100644 dlls/mp3dmod/tests/mp3dmod.c
diff --git a/configure b/configure index 64b710b..fdcfdb0 100755 --- a/configure +++ b/configure @@ -18806,6 +18806,7 @@ wine_fn_config_makefile dlls/monodebg.vxd enable_win16 wine_fn_config_makefile dlls/mountmgr.sys enable_mountmgr_sys wine_fn_config_makefile dlls/mouse.drv16 enable_win16 wine_fn_config_makefile dlls/mp3dmod enable_mp3dmod +wine_fn_config_makefile dlls/mp3dmod/tests enable_tests wine_fn_config_makefile dlls/mpr enable_mpr wine_fn_config_makefile dlls/mpr/tests enable_tests wine_fn_config_makefile dlls/mprapi enable_mprapi diff --git a/configure.ac b/configure.ac index 86b34bf..22c59ed 100644 --- a/configure.ac +++ b/configure.ac @@ -3401,6 +3401,7 @@ WINE_CONFIG_MAKEFILE(dlls/monodebg.vxd,enable_win16) WINE_CONFIG_MAKEFILE(dlls/mountmgr.sys) WINE_CONFIG_MAKEFILE(dlls/mouse.drv16,enable_win16) WINE_CONFIG_MAKEFILE(dlls/mp3dmod) +WINE_CONFIG_MAKEFILE(dlls/mp3dmod/tests) WINE_CONFIG_MAKEFILE(dlls/mpr) WINE_CONFIG_MAKEFILE(dlls/mpr/tests) WINE_CONFIG_MAKEFILE(dlls/mprapi) diff --git a/dlls/mp3dmod/tests/Makefile.in b/dlls/mp3dmod/tests/Makefile.in new file mode 100644 index 0000000..3cbe4fe --- /dev/null +++ b/dlls/mp3dmod/tests/Makefile.in @@ -0,0 +1,5 @@ +TESTDLL = mp3dmod.dll +IMPORTS = dmoguids ole32 strmiids uuid wmcodecdspuuid + +C_SRCS = \ + mp3dmod.c diff --git a/dlls/mp3dmod/tests/mp3dmod.c b/dlls/mp3dmod/tests/mp3dmod.c new file mode 100644 index 0000000..efa77de --- /dev/null +++ b/dlls/mp3dmod/tests/mp3dmod.c @@ -0,0 +1,237 @@ +/* + * Copyright 2018 Zebediah Figura + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS +#include "windef.h" +#include "wingdi.h" +#include "mmreg.h" +#include "mmsystem.h" +#include "mediaerr.h" +#include "wmcodecdsp.h" +#include "uuids.h" +#include "wine/test.h" + +#include "initguid.h" +DEFINE_GUID(WMMEDIASUBTYPE_MP3, 0x00000055, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71); + +/* shorter aliases for flags */ +#define O_SYNCPOINT DMO_OUTPUT_DATA_BUFFERF_SYNCPOINT +#define O_TIME DMO_OUTPUT_DATA_BUFFERF_TIME +#define O_TIMELENGTH DMO_OUTPUT_DATA_BUFFERF_TIMELENGTH +#define O_INCOMPLETE DMO_OUTPUT_DATA_BUFFERF_INCOMPLETE + +struct test_buffer { + IMediaBuffer IMediaBuffer_iface; + BYTE data[1152 * 2 * 3]; + DWORD len; + DWORD maxlen; +}; + +static inline struct test_buffer *impl_from_IMediaBuffer(IMediaBuffer *iface) +{ + return CONTAINING_RECORD(iface, struct test_buffer, IMediaBuffer_iface); +} + +static HRESULT WINAPI Buffer_QueryInterface(IMediaBuffer *iface, REFIID iid, void **obj) +{ + if (IsEqualIID(iid, &IID_IMediaBuffer) || IsEqualIID(iid, &IID_IUnknown)) + { + *obj = iface; + return S_OK; + } + ok(0, "Unexpected IID %s\n", wine_dbgstr_guid(iid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI Buffer_AddRef(IMediaBuffer *iface) +{ + return 2; +} + +static ULONG WINAPI Buffer_Release(IMediaBuffer *iface) +{ + return 1; +} + +static HRESULT WINAPI Buffer_SetLength(IMediaBuffer *iface, DWORD len) +{ + struct test_buffer *This = impl_from_IMediaBuffer(iface); + This->len = len; + return S_OK; +} + +static HRESULT WINAPI Buffer_GetMaxLength(IMediaBuffer *iface, DWORD *len) +{ + struct test_buffer *This = impl_from_IMediaBuffer(iface); + *len = This->maxlen; + return S_OK; +} + +static HRESULT WINAPI Buffer_GetBufferAndLength(IMediaBuffer *iface, BYTE **buf, DWORD *len) +{ + struct test_buffer *This = impl_from_IMediaBuffer(iface); + if (buf) *buf = This->data; + if (len) *len = This->len; + return S_OK; +} + +static IMediaBufferVtbl Buffer_vtbl = { + Buffer_QueryInterface, + Buffer_AddRef, + Buffer_Release, + Buffer_SetLength, + Buffer_GetMaxLength, + Buffer_GetBufferAndLength, +}; + +static void test_convert(void) +{ + static const BYTE mp3hdr[] = {0xff,0xfb,0x14,0xc4}; + struct test_buffer outbuf = {{&Buffer_vtbl}}; + struct test_buffer inbuf = {{&Buffer_vtbl}}; + DMO_MEDIA_TYPE in = {0}, out = {0}; + MPEGLAYER3WAVEFORMAT mp3fmt = {0}; + DMO_OUTPUT_DATA_BUFFER output; + WAVEFORMATEX wavfmt = {0}; + IMediaObject *dmo; + DWORD status; + HRESULT hr; + int i; + + hr = CoCreateInstance(&CLSID_CMP3DecMediaObject, NULL, CLSCTX_INPROC_SERVER, &IID_IMediaObject, (void **)&dmo); + ok(hr == S_OK, "got %#x\n", hr); + + mp3fmt.wfx.wFormatTag = WAVE_FORMAT_MPEGLAYER3; + mp3fmt.wfx.nChannels = 2; + mp3fmt.wfx.nSamplesPerSec = 48000; + in.majortype = MEDIATYPE_Audio; + in.subtype = WMMEDIASUBTYPE_MP3; + in.formattype = FORMAT_WaveFormatEx; + in.cbFormat = sizeof(mp3fmt); + in.pbFormat = (BYTE *)&mp3fmt; + + hr = IMediaObject_SetInputType(dmo, 0, &in, 0); + ok(hr == S_OK, "got %#x\n", hr); + + wavfmt.wFormatTag = WAVE_FORMAT_PCM; + wavfmt.nChannels = 2; + wavfmt.nSamplesPerSec = 48000; + wavfmt.nAvgBytesPerSec = 48000 * ((2 * 8) / 8); + wavfmt.nBlockAlign = (2 * 8) / 8; + wavfmt.wBitsPerSample = 8; + out.majortype = MEDIATYPE_Audio; + out.subtype = MEDIASUBTYPE_PCM; + out.formattype = FORMAT_WaveFormatEx; + out.cbFormat = sizeof(wavfmt); + out.pbFormat = (BYTE *)&wavfmt; + + hr = IMediaObject_SetOutputType(dmo, 0, &out, 0); + ok(hr == S_OK, "got %#x\n", hr); + + outbuf.len = 0; + outbuf.maxlen = sizeof(outbuf.data); + output.pBuffer = &outbuf.IMediaBuffer_iface; + output.dwStatus = 0xdeadbeef; + hr = IMediaObject_ProcessOutput(dmo, 0, 1, &output, &status); + ok(hr == S_FALSE, "got %#x\n", hr); + ok(outbuf.len == 0, "got %u\n", outbuf.len); + ok(output.dwStatus == 0, "got %#x\n", output.dwStatus); + + /* write several frames of mp3 data */ + for (i = 0; i < 5; i++) + memcpy(inbuf.data + 96 * i, mp3hdr, 4); + inbuf.len = 96 * 5; + hr = IMediaObject_ProcessInput(dmo, 0, &inbuf.IMediaBuffer_iface, 0, 0, 0); + ok(hr == S_OK, "got %#x\n", hr); + + hr = IMediaObject_ProcessInput(dmo, 0, &inbuf.IMediaBuffer_iface, 0, 0, 0); + ok(hr == DMO_E_NOTACCEPTING, "got %#x\n", hr); + + /* not enough space in buffer */ + outbuf.len = 0; + outbuf.maxlen = 1152 * 2 - 1; + hr = IMediaObject_ProcessOutput(dmo, 0, 1, &output, &status); + ok(hr == S_FALSE, "got %#x\n", hr); + ok(outbuf.len == 0, "got %u\n", outbuf.len); + ok(output.dwStatus == (O_SYNCPOINT | O_INCOMPLETE), "got %#x\n", output.dwStatus); + + outbuf.len = 1; + outbuf.maxlen = 1152 * 2; + hr = IMediaObject_ProcessOutput(dmo, 0, 1, &output, &status); + ok(hr == S_FALSE, "got %#x\n", hr); + ok(outbuf.len == 1, "got %u\n", outbuf.len); + ok(output.dwStatus == (O_SYNCPOINT | O_INCOMPLETE), "got %#x\n", output.dwStatus); + + outbuf.len = 0; + outbuf.maxlen = 1152 * 2; + hr = IMediaObject_ProcessOutput(dmo, 0, 1, &output, &status); + ok(hr == S_OK, "got %#x\n", hr); + ok(outbuf.len == 1152 * 2, "got %u\n", outbuf.len); +todo_wine + ok(output.dwStatus == (O_SYNCPOINT | O_TIME | O_TIMELENGTH | O_INCOMPLETE), "got %#x\n", output.dwStatus); + + hr = IMediaObject_ProcessOutput(dmo, 0, 1, &output, &status); + ok(hr == S_FALSE, "got %#x\n", hr); + ok(outbuf.len == 1152 * 2, "got %u\n", outbuf.len); + ok(output.dwStatus == (O_SYNCPOINT | O_INCOMPLETE), "got %#x\n", output.dwStatus); + + outbuf.maxlen = 1152 * 2 * 2; + hr = IMediaObject_ProcessOutput(dmo, 0, 1, &output, &status); + ok(hr == S_OK, "got %#x\n", hr); + ok(outbuf.len == 1152 * 2 * 2, "got %u\n", outbuf.len); +todo_wine + ok(output.dwStatus == (O_SYNCPOINT | O_TIME | O_TIMELENGTH | O_INCOMPLETE), "got %#x\n", output.dwStatus); + + outbuf.len = 0; + outbuf.maxlen = 1152 * 2 * 3; + hr = IMediaObject_ProcessOutput(dmo, 0, 1, &output, &status); + ok(hr == S_OK, "got %#x\n", hr); + ok(outbuf.len == 1152 * 2 * 3, "got %u\n", outbuf.len); +todo_wine + ok(output.dwStatus == (O_SYNCPOINT | O_TIME | O_TIMELENGTH | O_INCOMPLETE), "got %#x\n", output.dwStatus); + + hr = IMediaObject_ProcessOutput(dmo, 0, 1, &output, &status); + ok(hr == S_FALSE, "got %#x\n", hr); + ok(outbuf.len == 1152 * 2 * 3, "got %u\n", outbuf.len); + ok(output.dwStatus == (O_SYNCPOINT | O_INCOMPLETE), "got %#x\n", output.dwStatus); + + hr = IMediaObject_ProcessInput(dmo, 0, &inbuf.IMediaBuffer_iface, 0, 0, 0); + ok(hr == DMO_E_NOTACCEPTING, "got %#x\n", hr); + + /* native requires one more frame's worth of space before it'll finish processing input */ + outbuf.len = 0; + outbuf.maxlen = 1152 * 2; + hr = IMediaObject_ProcessOutput(dmo, 0, 1, &output, &status); + ok(hr == S_FALSE, "got %#x\n", hr); + ok(outbuf.len == 0, "got %u\n", outbuf.len); + ok(output.dwStatus == O_SYNCPOINT, "got %#x\n", output.dwStatus); + + hr = IMediaObject_ProcessInput(dmo, 0, &inbuf.IMediaBuffer_iface, 0, 0, 0); + ok(hr == S_OK, "got %#x\n", hr); + + IMediaObject_Release(dmo); +} + +START_TEST(mp3dmod) +{ + CoInitializeEx(NULL, COINIT_MULTITHREADED); + + test_convert(); + + CoUninitialize(); +}
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at https://testbot.winehq.org/JobDetails.pl?Key=38323
Your paranoid android.
=== wxppro (32 bit mp3dmod) === mp3dmod.c:117: Test failed: got 0x80040154 0b40:mp3dmod: unhandled exception c0000005 at 00401813
=== w2003std (32 bit mp3dmod) === mp3dmod.c:117: Test failed: got 0x80040154 06ac:mp3dmod: unhandled exception c0000005 at 00401813
=== wvistau64 (32 bit mp3dmod) === mp3dmod.c:184: Test failed: got 1152 mp3dmod.c:190: Test failed: got 1152 mp3dmod.c:196: Test failed: got 3456 mp3dmod.c:204: Test failed: got 2304 mp3dmod.c:206: Test failed: got 0x7 mp3dmod.c:210: Test failed: got 2304 mp3dmod.c:211: Test failed: got 0 mp3dmod.c:214: Test failed: got 0 mp3dmod.c:220: Test failed: got 0 mp3dmod.c:221: Test failed: got 1152 mp3dmod.c:222: Test failed: got 0x1000007 mp3dmod.c:225: Test failed: got 0x80040204
=== wvistau64_zh_CN (32 bit mp3dmod) === mp3dmod.c:184: Test failed: got 1152 mp3dmod.c:190: Test failed: got 1152 mp3dmod.c:196: Test failed: got 3456 mp3dmod.c:204: Test failed: got 2304 mp3dmod.c:206: Test failed: got 0x7 mp3dmod.c:210: Test failed: got 2304 mp3dmod.c:211: Test failed: got 0 mp3dmod.c:214: Test failed: got 0 mp3dmod.c:220: Test failed: got 0 mp3dmod.c:221: Test failed: got 1152 mp3dmod.c:222: Test failed: got 0x1000007 mp3dmod.c:225: Test failed: got 0x80040204
=== wvistau64_fr (32 bit mp3dmod) === mp3dmod.c:184: Test failed: got 1152 mp3dmod.c:190: Test failed: got 1152 mp3dmod.c:196: Test failed: got 3456 mp3dmod.c:204: Test failed: got 2304 mp3dmod.c:206: Test failed: got 0x7 mp3dmod.c:210: Test failed: got 2304 mp3dmod.c:211: Test failed: got 0 mp3dmod.c:214: Test failed: got 0 mp3dmod.c:220: Test failed: got 0 mp3dmod.c:221: Test failed: got 1152 mp3dmod.c:222: Test failed: got 0x1000007 mp3dmod.c:225: Test failed: got 0x80040204
=== wvistau64_he (32 bit mp3dmod) === mp3dmod.c:184: Test failed: got 1152 mp3dmod.c:190: Test failed: got 1152 mp3dmod.c:196: Test failed: got 3456 mp3dmod.c:204: Test failed: got 2304 mp3dmod.c:206: Test failed: got 0x7 mp3dmod.c:210: Test failed: got 2304 mp3dmod.c:211: Test failed: got 0 mp3dmod.c:214: Test failed: got 0 mp3dmod.c:220: Test failed: got 0 mp3dmod.c:221: Test failed: got 1152 mp3dmod.c:222: Test failed: got 0x1000007 mp3dmod.c:225: Test failed: got 0x80040204
=== w2008s64 (32 bit mp3dmod) === mp3dmod.c:117: Test failed: got 0x80040154 086c:mp3dmod: unhandled exception c0000005 at 00401813
=== w8 (32 bit mp3dmod) === mp3dmod.c:171: Test failed: got 0x1 mp3dmod.c:178: Test failed: got 0 mp3dmod.c:183: Test failed: got 0x1 mp3dmod.c:184: Test failed: got 0 mp3dmod.c:186: Test failed: got 0 mp3dmod.c:190: Test failed: got 0 mp3dmod.c:191: Test failed: got 0 mp3dmod.c:195: Test failed: got 0x1 mp3dmod.c:196: Test failed: got 0 mp3dmod.c:198: Test failed: got 0 mp3dmod.c:203: Test failed: got 0x1 mp3dmod.c:204: Test failed: got 0 mp3dmod.c:206: Test failed: got 0 mp3dmod.c:210: Test failed: got 0 mp3dmod.c:211: Test failed: got 0 mp3dmod.c:214: Test failed: got 0 mp3dmod.c:220: Test failed: got 0 mp3dmod.c:221: Test failed: got 2304 mp3dmod.c:222: Test failed: got 0x1000007 mp3dmod.c:225: Test failed: got 0x80040204
=== w864 (32 bit mp3dmod) === mp3dmod.c:171: Test failed: got 0x1 mp3dmod.c:178: Test failed: got 0 mp3dmod.c:183: Test failed: got 0x1 mp3dmod.c:184: Test failed: got 0 mp3dmod.c:186: Test failed: got 0 mp3dmod.c:190: Test failed: got 0 mp3dmod.c:191: Test failed: got 0 mp3dmod.c:195: Test failed: got 0x1 mp3dmod.c:196: Test failed: got 0 mp3dmod.c:198: Test failed: got 0 mp3dmod.c:203: Test failed: got 0x1 mp3dmod.c:204: Test failed: got 0 mp3dmod.c:206: Test failed: got 0 mp3dmod.c:210: Test failed: got 0 mp3dmod.c:211: Test failed: got 0 mp3dmod.c:214: Test failed: got 0 mp3dmod.c:220: Test failed: got 0 mp3dmod.c:221: Test failed: got 2304 mp3dmod.c:222: Test failed: got 0x1000007 mp3dmod.c:225: Test failed: got 0x80040204
=== w1064 (32 bit mp3dmod) === mp3dmod.c:169: Test failed: got 0 mp3dmod.c:170: Test failed: got 1248 mp3dmod.c:171: Test failed: got 0x1000007 mp3dmod.c:178: Test failed: got 0x1 mp3dmod.c:183: Test failed: got 0x1 mp3dmod.c:184: Test failed: got 0 mp3dmod.c:186: Test failed: got 0 mp3dmod.c:190: Test failed: got 0 mp3dmod.c:191: Test failed: got 0 mp3dmod.c:195: Test failed: got 0x1 mp3dmod.c:196: Test failed: got 0 mp3dmod.c:198: Test failed: got 0 mp3dmod.c:203: Test failed: got 0x1 mp3dmod.c:204: Test failed: got 0 mp3dmod.c:206: Test failed: got 0 mp3dmod.c:210: Test failed: got 0 mp3dmod.c:211: Test failed: got 0 mp3dmod.c:214: Test failed: got 0 mp3dmod.c:220: Test failed: got 0 mp3dmod.c:221: Test failed: got 2304 mp3dmod.c:222: Test failed: got 0x1000007 mp3dmod.c:225: Test failed: got 0x80040204
=== wvistau64 (64 bit mp3dmod) === mp3dmod.c:184: Test failed: got 1152 mp3dmod.c:190: Test failed: got 1152 mp3dmod.c:196: Test failed: got 3456 mp3dmod.c:204: Test failed: got 2304 mp3dmod.c:206: Test failed: got 0x7 mp3dmod.c:210: Test failed: got 2304 mp3dmod.c:211: Test failed: got 0 mp3dmod.c:214: Test failed: got 0 mp3dmod.c:220: Test failed: got 0 mp3dmod.c:221: Test failed: got 1152 mp3dmod.c:222: Test failed: got 0x1000007 mp3dmod.c:225: Test failed: got 0x80040204
=== w2008s64 (64 bit mp3dmod) === mp3dmod.c:117: Test failed: got 0x80040154 086c:mp3dmod: unhandled exception c0000005 at 0000000000401806
=== w864 (64 bit mp3dmod) === mp3dmod.c:171: Test failed: got 0x1 mp3dmod.c:178: Test failed: got 0 mp3dmod.c:183: Test failed: got 0x1 mp3dmod.c:184: Test failed: got 0 mp3dmod.c:186: Test failed: got 0 mp3dmod.c:190: Test failed: got 0 mp3dmod.c:191: Test failed: got 0 mp3dmod.c:195: Test failed: got 0x1 mp3dmod.c:196: Test failed: got 0 mp3dmod.c:198: Test failed: got 0 mp3dmod.c:203: Test failed: got 0x1 mp3dmod.c:204: Test failed: got 0 mp3dmod.c:206: Test failed: got 0 mp3dmod.c:210: Test failed: got 0 mp3dmod.c:211: Test failed: got 0 mp3dmod.c:214: Test failed: got 0 mp3dmod.c:220: Test failed: got 0 mp3dmod.c:221: Test failed: got 2304 mp3dmod.c:222: Test failed: got 0x1000007 mp3dmod.c:225: Test failed: got 0x80040204
=== w1064 (64 bit mp3dmod) === mp3dmod.c:169: Test failed: got 0 mp3dmod.c:170: Test failed: got 1248 mp3dmod.c:171: Test failed: got 0x1000007 mp3dmod.c:178: Test failed: got 0x1 mp3dmod.c:183: Test failed: got 0x1 mp3dmod.c:184: Test failed: got 0 mp3dmod.c:186: Test failed: got 0 mp3dmod.c:190: Test failed: got 0 mp3dmod.c:191: Test failed: got 0 mp3dmod.c:195: Test failed: got 0x1 mp3dmod.c:196: Test failed: got 0 mp3dmod.c:198: Test failed: got 0 mp3dmod.c:203: Test failed: got 0x1 mp3dmod.c:204: Test failed: got 0 mp3dmod.c:206: Test failed: got 0 mp3dmod.c:210: Test failed: got 0 mp3dmod.c:211: Test failed: got 0 mp3dmod.c:214: Test failed: got 0 mp3dmod.c:220: Test failed: got 0 mp3dmod.c:221: Test failed: got 2304 mp3dmod.c:222: Test failed: got 0x1000007 mp3dmod.c:225: Test failed: got 0x80040204
On 11/05/18 12:04, Marvin wrote:
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at https://testbot.winehq.org/JobDetails.pl?Key=38323
Your paranoid android.
=== wxppro (32 bit mp3dmod) === mp3dmod.c:117: Test failed: got 0x80040154 0b40:mp3dmod: unhandled exception c0000005 at 00401813
=== w2003std (32 bit mp3dmod) === mp3dmod.c:117: Test failed: got 0x80040154 06ac:mp3dmod: unhandled exception c0000005 at 00401813
=== wvistau64 (32 bit mp3dmod) === mp3dmod.c:184: Test failed: got 1152 mp3dmod.c:190: Test failed: got 1152 mp3dmod.c:196: Test failed: got 3456 mp3dmod.c:204: Test failed: got 2304 mp3dmod.c:206: Test failed: got 0x7 mp3dmod.c:210: Test failed: got 2304 mp3dmod.c:211: Test failed: got 0 mp3dmod.c:214: Test failed: got 0 mp3dmod.c:220: Test failed: got 0 mp3dmod.c:221: Test failed: got 1152 mp3dmod.c:222: Test failed: got 0x1000007 mp3dmod.c:225: Test failed: got 0x80040204
=== wvistau64_zh_CN (32 bit mp3dmod) === mp3dmod.c:184: Test failed: got 1152 mp3dmod.c:190: Test failed: got 1152 mp3dmod.c:196: Test failed: got 3456 mp3dmod.c:204: Test failed: got 2304 mp3dmod.c:206: Test failed: got 0x7 mp3dmod.c:210: Test failed: got 2304 mp3dmod.c:211: Test failed: got 0 mp3dmod.c:214: Test failed: got 0 mp3dmod.c:220: Test failed: got 0 mp3dmod.c:221: Test failed: got 1152 mp3dmod.c:222: Test failed: got 0x1000007 mp3dmod.c:225: Test failed: got 0x80040204
=== wvistau64_fr (32 bit mp3dmod) === mp3dmod.c:184: Test failed: got 1152 mp3dmod.c:190: Test failed: got 1152 mp3dmod.c:196: Test failed: got 3456 mp3dmod.c:204: Test failed: got 2304 mp3dmod.c:206: Test failed: got 0x7 mp3dmod.c:210: Test failed: got 2304 mp3dmod.c:211: Test failed: got 0 mp3dmod.c:214: Test failed: got 0 mp3dmod.c:220: Test failed: got 0 mp3dmod.c:221: Test failed: got 1152 mp3dmod.c:222: Test failed: got 0x1000007 mp3dmod.c:225: Test failed: got 0x80040204
=== wvistau64_he (32 bit mp3dmod) === mp3dmod.c:184: Test failed: got 1152 mp3dmod.c:190: Test failed: got 1152 mp3dmod.c:196: Test failed: got 3456 mp3dmod.c:204: Test failed: got 2304 mp3dmod.c:206: Test failed: got 0x7 mp3dmod.c:210: Test failed: got 2304 mp3dmod.c:211: Test failed: got 0 mp3dmod.c:214: Test failed: got 0 mp3dmod.c:220: Test failed: got 0 mp3dmod.c:221: Test failed: got 1152 mp3dmod.c:222: Test failed: got 0x1000007 mp3dmod.c:225: Test failed: got 0x80040204
=== w2008s64 (32 bit mp3dmod) === mp3dmod.c:117: Test failed: got 0x80040154 086c:mp3dmod: unhandled exception c0000005 at 00401813
=== w8 (32 bit mp3dmod) === mp3dmod.c:171: Test failed: got 0x1 mp3dmod.c:178: Test failed: got 0 mp3dmod.c:183: Test failed: got 0x1 mp3dmod.c:184: Test failed: got 0 mp3dmod.c:186: Test failed: got 0 mp3dmod.c:190: Test failed: got 0 mp3dmod.c:191: Test failed: got 0 mp3dmod.c:195: Test failed: got 0x1 mp3dmod.c:196: Test failed: got 0 mp3dmod.c:198: Test failed: got 0 mp3dmod.c:203: Test failed: got 0x1 mp3dmod.c:204: Test failed: got 0 mp3dmod.c:206: Test failed: got 0 mp3dmod.c:210: Test failed: got 0 mp3dmod.c:211: Test failed: got 0 mp3dmod.c:214: Test failed: got 0 mp3dmod.c:220: Test failed: got 0 mp3dmod.c:221: Test failed: got 2304 mp3dmod.c:222: Test failed: got 0x1000007 mp3dmod.c:225: Test failed: got 0x80040204
=== w864 (32 bit mp3dmod) === mp3dmod.c:171: Test failed: got 0x1 mp3dmod.c:178: Test failed: got 0 mp3dmod.c:183: Test failed: got 0x1 mp3dmod.c:184: Test failed: got 0 mp3dmod.c:186: Test failed: got 0 mp3dmod.c:190: Test failed: got 0 mp3dmod.c:191: Test failed: got 0 mp3dmod.c:195: Test failed: got 0x1 mp3dmod.c:196: Test failed: got 0 mp3dmod.c:198: Test failed: got 0 mp3dmod.c:203: Test failed: got 0x1 mp3dmod.c:204: Test failed: got 0 mp3dmod.c:206: Test failed: got 0 mp3dmod.c:210: Test failed: got 0 mp3dmod.c:211: Test failed: got 0 mp3dmod.c:214: Test failed: got 0 mp3dmod.c:220: Test failed: got 0 mp3dmod.c:221: Test failed: got 2304 mp3dmod.c:222: Test failed: got 0x1000007 mp3dmod.c:225: Test failed: got 0x80040204
=== w1064 (32 bit mp3dmod) === mp3dmod.c:169: Test failed: got 0 mp3dmod.c:170: Test failed: got 1248 mp3dmod.c:171: Test failed: got 0x1000007 mp3dmod.c:178: Test failed: got 0x1 mp3dmod.c:183: Test failed: got 0x1 mp3dmod.c:184: Test failed: got 0 mp3dmod.c:186: Test failed: got 0 mp3dmod.c:190: Test failed: got 0 mp3dmod.c:191: Test failed: got 0 mp3dmod.c:195: Test failed: got 0x1 mp3dmod.c:196: Test failed: got 0 mp3dmod.c:198: Test failed: got 0 mp3dmod.c:203: Test failed: got 0x1 mp3dmod.c:204: Test failed: got 0 mp3dmod.c:206: Test failed: got 0 mp3dmod.c:210: Test failed: got 0 mp3dmod.c:211: Test failed: got 0 mp3dmod.c:214: Test failed: got 0 mp3dmod.c:220: Test failed: got 0 mp3dmod.c:221: Test failed: got 2304 mp3dmod.c:222: Test failed: got 0x1000007 mp3dmod.c:225: Test failed: got 0x80040204
=== wvistau64 (64 bit mp3dmod) === mp3dmod.c:184: Test failed: got 1152 mp3dmod.c:190: Test failed: got 1152 mp3dmod.c:196: Test failed: got 3456 mp3dmod.c:204: Test failed: got 2304 mp3dmod.c:206: Test failed: got 0x7 mp3dmod.c:210: Test failed: got 2304 mp3dmod.c:211: Test failed: got 0 mp3dmod.c:214: Test failed: got 0 mp3dmod.c:220: Test failed: got 0 mp3dmod.c:221: Test failed: got 1152 mp3dmod.c:222: Test failed: got 0x1000007 mp3dmod.c:225: Test failed: got 0x80040204
=== w2008s64 (64 bit mp3dmod) === mp3dmod.c:117: Test failed: got 0x80040154 086c:mp3dmod: unhandled exception c0000005 at 0000000000401806
=== w864 (64 bit mp3dmod) === mp3dmod.c:171: Test failed: got 0x1 mp3dmod.c:178: Test failed: got 0 mp3dmod.c:183: Test failed: got 0x1 mp3dmod.c:184: Test failed: got 0 mp3dmod.c:186: Test failed: got 0 mp3dmod.c:190: Test failed: got 0 mp3dmod.c:191: Test failed: got 0 mp3dmod.c:195: Test failed: got 0x1 mp3dmod.c:196: Test failed: got 0 mp3dmod.c:198: Test failed: got 0 mp3dmod.c:203: Test failed: got 0x1 mp3dmod.c:204: Test failed: got 0 mp3dmod.c:206: Test failed: got 0 mp3dmod.c:210: Test failed: got 0 mp3dmod.c:211: Test failed: got 0 mp3dmod.c:214: Test failed: got 0 mp3dmod.c:220: Test failed: got 0 mp3dmod.c:221: Test failed: got 2304 mp3dmod.c:222: Test failed: got 0x1000007 mp3dmod.c:225: Test failed: got 0x80040204
=== w1064 (64 bit mp3dmod) === mp3dmod.c:169: Test failed: got 0 mp3dmod.c:170: Test failed: got 1248 mp3dmod.c:171: Test failed: got 0x1000007 mp3dmod.c:178: Test failed: got 0x1 mp3dmod.c:183: Test failed: got 0x1 mp3dmod.c:184: Test failed: got 0 mp3dmod.c:186: Test failed: got 0 mp3dmod.c:190: Test failed: got 0 mp3dmod.c:191: Test failed: got 0 mp3dmod.c:195: Test failed: got 0x1 mp3dmod.c:196: Test failed: got 0 mp3dmod.c:198: Test failed: got 0 mp3dmod.c:203: Test failed: got 0x1 mp3dmod.c:204: Test failed: got 0 mp3dmod.c:206: Test failed: got 0 mp3dmod.c:210: Test failed: got 0 mp3dmod.c:211: Test failed: got 0 mp3dmod.c:214: Test failed: got 0 mp3dmod.c:220: Test failed: got 0 mp3dmod.c:221: Test failed: got 2304 mp3dmod.c:222: Test failed: got 0x1000007 mp3dmod.c:225: Test failed: got 0x80040204
Evidently Windows is far more inconsistent than I assumed. I'll write some less restrictive tests.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/mp3dmod/mp3dmod.c | 15 +++++++++++++++ dlls/mp3dmod/tests/mp3dmod.c | 26 +++++++++++++++++++++++--- 2 files changed, 38 insertions(+), 3 deletions(-)
diff --git a/dlls/mp3dmod/mp3dmod.c b/dlls/mp3dmod/mp3dmod.c index 0d97909..cdc8fa3 100644 --- a/dlls/mp3dmod/mp3dmod.c +++ b/dlls/mp3dmod/mp3dmod.c @@ -43,6 +43,7 @@ struct mp3_decoder { mpg123_handle *mh; DMO_MEDIA_TYPE outtype; IMediaBuffer *buffer; + REFERENCE_TIME timestamp; };
static inline struct mp3_decoder *impl_from_IMediaObject(IMediaObject *iface) @@ -296,9 +297,16 @@ static DWORD get_framesize(DMO_MEDIA_TYPE *type) return 1152 * format->nBlockAlign; }
+static REFERENCE_TIME get_frametime(DMO_MEDIA_TYPE *type) +{ + WAVEFORMATEX *format = (WAVEFORMATEX *)type->pbFormat; + return (REFERENCE_TIME) 10000000 * 1152 / format->nSamplesPerSec; +} + static HRESULT WINAPI MediaObject_ProcessOutput(IMediaObject *iface, DWORD flags, DWORD count, DMO_OUTPUT_DATA_BUFFER *buffers, DWORD *status) { struct mp3_decoder *This = impl_from_IMediaObject(iface); + REFERENCE_TIME time = 0, frametime; DWORD len, maxlen, framesize; int got_data = 0; size_t written; @@ -325,6 +333,7 @@ static HRESULT WINAPI MediaObject_ProcessOutput(IMediaObject *iface, DWORD flags if (FAILED(hr)) return hr;
framesize = get_framesize(&This->outtype); + frametime = get_frametime(&This->outtype);
while (1) { @@ -353,10 +362,16 @@ static HRESULT WINAPI MediaObject_ProcessOutput(IMediaObject *iface, DWORD flags len += framesize; hr = IMediaBuffer_SetLength(buffers[0].pBuffer, len); if (FAILED(hr)) return hr; + + time += frametime; }
if (got_data) { + buffers[0].dwStatus |= (DMO_OUTPUT_DATA_BUFFERF_TIME | DMO_OUTPUT_DATA_BUFFERF_TIMELENGTH); + buffers[0].rtTimelength = time; + buffers[0].rtTimestamp = This->timestamp; + This->timestamp += time; return S_OK; } return S_FALSE; diff --git a/dlls/mp3dmod/tests/mp3dmod.c b/dlls/mp3dmod/tests/mp3dmod.c index efa77de..c0aa32f 100644 --- a/dlls/mp3dmod/tests/mp3dmod.c +++ b/dlls/mp3dmod/tests/mp3dmod.c @@ -35,6 +35,11 @@ DEFINE_GUID(WMMEDIASUBTYPE_MP3, 0x00000055, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0x #define O_TIMELENGTH DMO_OUTPUT_DATA_BUFFERF_TIMELENGTH #define O_INCOMPLETE DMO_OUTPUT_DATA_BUFFERF_INCOMPLETE
+static REFERENCE_TIME framelen(int frames, int rate) +{ + return (REFERENCE_TIME) frames * 10000000 * 1152 / rate; +} + struct test_buffer { IMediaBuffer IMediaBuffer_iface; BYTE data[1152 * 2 * 3]; @@ -147,10 +152,14 @@ static void test_convert(void) outbuf.maxlen = sizeof(outbuf.data); output.pBuffer = &outbuf.IMediaBuffer_iface; output.dwStatus = 0xdeadbeef; + output.rtTimestamp = 0xdeadbeef; + output.rtTimelength = 0xdeadbeef; hr = IMediaObject_ProcessOutput(dmo, 0, 1, &output, &status); ok(hr == S_FALSE, "got %#x\n", hr); ok(outbuf.len == 0, "got %u\n", outbuf.len); ok(output.dwStatus == 0, "got %#x\n", output.dwStatus); + ok(output.rtTimestamp == 0xdeadbeef, "got %s\n", wine_dbgstr_longlong(output.rtTimestamp)); + ok(output.rtTimelength == 0xdeadbeef, "got %s\n", wine_dbgstr_longlong(output.rtTimestamp));
/* write several frames of mp3 data */ for (i = 0; i < 5; i++) @@ -179,11 +188,14 @@ static void test_convert(void)
outbuf.len = 0; outbuf.maxlen = 1152 * 2; + output.rtTimestamp = 0xdeadbeef; + output.rtTimelength = 0xdeadbeef; hr = IMediaObject_ProcessOutput(dmo, 0, 1, &output, &status); ok(hr == S_OK, "got %#x\n", hr); ok(outbuf.len == 1152 * 2, "got %u\n", outbuf.len); -todo_wine ok(output.dwStatus == (O_SYNCPOINT | O_TIME | O_TIMELENGTH | O_INCOMPLETE), "got %#x\n", output.dwStatus); + ok(output.rtTimestamp == 0, "got %s\n", wine_dbgstr_longlong(output.rtTimestamp)); + ok(output.rtTimelength == framelen(1, 48000), "got %s\n", wine_dbgstr_longlong(output.rtTimelength));
hr = IMediaObject_ProcessOutput(dmo, 0, 1, &output, &status); ok(hr == S_FALSE, "got %#x\n", hr); @@ -194,16 +206,20 @@ todo_wine hr = IMediaObject_ProcessOutput(dmo, 0, 1, &output, &status); ok(hr == S_OK, "got %#x\n", hr); ok(outbuf.len == 1152 * 2 * 2, "got %u\n", outbuf.len); -todo_wine ok(output.dwStatus == (O_SYNCPOINT | O_TIME | O_TIMELENGTH | O_INCOMPLETE), "got %#x\n", output.dwStatus); + ok(output.rtTimestamp == framelen(1, 48000), "got %s\n", wine_dbgstr_longlong(output.rtTimestamp)); + ok(output.rtTimelength == framelen(1, 48000), "got %s\n", wine_dbgstr_longlong(output.rtTimelength));
outbuf.len = 0; outbuf.maxlen = 1152 * 2 * 3; + output.rtTimestamp = 0xdeadbeef; + output.rtTimelength = 0xdeadbeef; hr = IMediaObject_ProcessOutput(dmo, 0, 1, &output, &status); ok(hr == S_OK, "got %#x\n", hr); ok(outbuf.len == 1152 * 2 * 3, "got %u\n", outbuf.len); -todo_wine ok(output.dwStatus == (O_SYNCPOINT | O_TIME | O_TIMELENGTH | O_INCOMPLETE), "got %#x\n", output.dwStatus); + ok(output.rtTimestamp == framelen(2, 48000), "got %s\n", wine_dbgstr_longlong(output.rtTimestamp)); + ok(output.rtTimelength == framelen(3, 48000), "got %s\n", wine_dbgstr_longlong(output.rtTimelength));
hr = IMediaObject_ProcessOutput(dmo, 0, 1, &output, &status); ok(hr == S_FALSE, "got %#x\n", hr); @@ -216,10 +232,14 @@ todo_wine /* native requires one more frame's worth of space before it'll finish processing input */ outbuf.len = 0; outbuf.maxlen = 1152 * 2; + output.rtTimestamp = 0xdeadbeef; + output.rtTimelength = 0xdeadbeef; hr = IMediaObject_ProcessOutput(dmo, 0, 1, &output, &status); ok(hr == S_FALSE, "got %#x\n", hr); ok(outbuf.len == 0, "got %u\n", outbuf.len); ok(output.dwStatus == O_SYNCPOINT, "got %#x\n", output.dwStatus); + ok(output.rtTimestamp == 0xdeadbeef, "got %s\n", wine_dbgstr_longlong(output.rtTimestamp)); + ok(output.rtTimelength == 0xdeadbeef, "got %s\n", wine_dbgstr_longlong(output.rtTimelength));
hr = IMediaObject_ProcessInput(dmo, 0, &inbuf.IMediaBuffer_iface, 0, 0, 0); ok(hr == S_OK, "got %#x\n", hr);
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at https://testbot.winehq.org/JobDetails.pl?Key=38324
Your paranoid android.
=== wxppro (32 bit mp3dmod) === mp3dmod.c:122: Test failed: got 0x80040154 0b40:mp3dmod: unhandled exception c0000005 at 00401825
=== w2003std (32 bit mp3dmod) === mp3dmod.c:122: Test failed: got 0x80040154 06ac:mp3dmod: unhandled exception c0000005 at 00401825
=== wvistau64 (32 bit mp3dmod) === mp3dmod.c:195: Test failed: got 1152 mp3dmod.c:198: Test failed: got 1d4c0 mp3dmod.c:202: Test failed: got 1152 mp3dmod.c:208: Test failed: got 3456 mp3dmod.c:210: Test failed: got 1d4c0 mp3dmod.c:219: Test failed: got 2304 mp3dmod.c:220: Test failed: got 0x7 mp3dmod.c:221: Test failed: got 57e40 mp3dmod.c:222: Test failed: got 3a980 mp3dmod.c:226: Test failed: got 2304 mp3dmod.c:227: Test failed: got 0 mp3dmod.c:230: Test failed: got 0 mp3dmod.c:238: Test failed: got 0 mp3dmod.c:239: Test failed: got 1152 mp3dmod.c:240: Test failed: got 0x1000007 mp3dmod.c:241: Test failed: got 927c0 mp3dmod.c:242: Test failed: got 1d4c0 mp3dmod.c:245: Test failed: got 0x80040204
=== wvistau64_zh_CN (32 bit mp3dmod) === mp3dmod.c:195: Test failed: got 1152 mp3dmod.c:198: Test failed: got 1d4c0 mp3dmod.c:202: Test failed: got 1152 mp3dmod.c:208: Test failed: got 3456 mp3dmod.c:210: Test failed: got 1d4c0 mp3dmod.c:219: Test failed: got 2304 mp3dmod.c:220: Test failed: got 0x7 mp3dmod.c:221: Test failed: got 57e40 mp3dmod.c:222: Test failed: got 3a980 mp3dmod.c:226: Test failed: got 2304 mp3dmod.c:227: Test failed: got 0 mp3dmod.c:230: Test failed: got 0 mp3dmod.c:238: Test failed: got 0 mp3dmod.c:239: Test failed: got 1152 mp3dmod.c:240: Test failed: got 0x1000007 mp3dmod.c:241: Test failed: got 927c0 mp3dmod.c:242: Test failed: got 1d4c0 mp3dmod.c:245: Test failed: got 0x80040204
=== wvistau64_fr (32 bit mp3dmod) === mp3dmod.c:195: Test failed: got 1152 mp3dmod.c:198: Test failed: got 1d4c0 mp3dmod.c:202: Test failed: got 1152 mp3dmod.c:208: Test failed: got 3456 mp3dmod.c:210: Test failed: got 1d4c0 mp3dmod.c:219: Test failed: got 2304 mp3dmod.c:220: Test failed: got 0x7 mp3dmod.c:221: Test failed: got 57e40 mp3dmod.c:222: Test failed: got 3a980 mp3dmod.c:226: Test failed: got 2304 mp3dmod.c:227: Test failed: got 0 mp3dmod.c:230: Test failed: got 0 mp3dmod.c:238: Test failed: got 0 mp3dmod.c:239: Test failed: got 1152 mp3dmod.c:240: Test failed: got 0x1000007 mp3dmod.c:241: Test failed: got 927c0 mp3dmod.c:242: Test failed: got 1d4c0 mp3dmod.c:245: Test failed: got 0x80040204
=== wvistau64_he (32 bit mp3dmod) === mp3dmod.c:195: Test failed: got 1152 mp3dmod.c:198: Test failed: got 1d4c0 mp3dmod.c:202: Test failed: got 1152 mp3dmod.c:208: Test failed: got 3456 mp3dmod.c:210: Test failed: got 1d4c0 mp3dmod.c:219: Test failed: got 2304 mp3dmod.c:220: Test failed: got 0x7 mp3dmod.c:221: Test failed: got 57e40 mp3dmod.c:222: Test failed: got 3a980 mp3dmod.c:226: Test failed: got 2304 mp3dmod.c:227: Test failed: got 0 mp3dmod.c:230: Test failed: got 0 mp3dmod.c:238: Test failed: got 0 mp3dmod.c:239: Test failed: got 1152 mp3dmod.c:240: Test failed: got 0x1000007 mp3dmod.c:241: Test failed: got 927c0 mp3dmod.c:242: Test failed: got 1d4c0 mp3dmod.c:245: Test failed: got 0x80040204
=== w2008s64 (32 bit mp3dmod) === mp3dmod.c:122: Test failed: got 0x80040154 086c:mp3dmod: unhandled exception c0000005 at 00401825
=== w8 (32 bit mp3dmod) === mp3dmod.c:180: Test failed: got 0x1 mp3dmod.c:187: Test failed: got 0 mp3dmod.c:194: Test failed: got 0x1 mp3dmod.c:195: Test failed: got 0 mp3dmod.c:196: Test failed: got 0 mp3dmod.c:197: Test failed: got deadbeef mp3dmod.c:198: Test failed: got deadbeef mp3dmod.c:202: Test failed: got 0 mp3dmod.c:203: Test failed: got 0 mp3dmod.c:207: Test failed: got 0x1 mp3dmod.c:208: Test failed: got 0 mp3dmod.c:209: Test failed: got 0 mp3dmod.c:210: Test failed: got deadbeef mp3dmod.c:211: Test failed: got deadbeef mp3dmod.c:218: Test failed: got 0x1 mp3dmod.c:219: Test failed: got 0 mp3dmod.c:220: Test failed: got 0 mp3dmod.c:221: Test failed: got deadbeef mp3dmod.c:222: Test failed: got deadbeef mp3dmod.c:226: Test failed: got 0 mp3dmod.c:227: Test failed: got 0 mp3dmod.c:230: Test failed: got 0 mp3dmod.c:238: Test failed: got 0 mp3dmod.c:239: Test failed: got 2304 mp3dmod.c:240: Test failed: got 0x1000007 mp3dmod.c:241: Test failed: got 0 mp3dmod.c:242: Test failed: got 3a980 mp3dmod.c:245: Test failed: got 0x80040204
=== w864 (32 bit mp3dmod) === mp3dmod.c:180: Test failed: got 0x1 mp3dmod.c:187: Test failed: got 0 mp3dmod.c:194: Test failed: got 0x1 mp3dmod.c:195: Test failed: got 0 mp3dmod.c:196: Test failed: got 0 mp3dmod.c:197: Test failed: got deadbeef mp3dmod.c:198: Test failed: got deadbeef mp3dmod.c:202: Test failed: got 0 mp3dmod.c:203: Test failed: got 0 mp3dmod.c:207: Test failed: got 0x1 mp3dmod.c:208: Test failed: got 0 mp3dmod.c:209: Test failed: got 0 mp3dmod.c:210: Test failed: got deadbeef mp3dmod.c:211: Test failed: got deadbeef mp3dmod.c:218: Test failed: got 0x1 mp3dmod.c:219: Test failed: got 0 mp3dmod.c:220: Test failed: got 0 mp3dmod.c:221: Test failed: got deadbeef mp3dmod.c:222: Test failed: got deadbeef mp3dmod.c:226: Test failed: got 0 mp3dmod.c:227: Test failed: got 0 mp3dmod.c:230: Test failed: got 0 mp3dmod.c:238: Test failed: got 0 mp3dmod.c:239: Test failed: got 2304 mp3dmod.c:240: Test failed: got 0x1000007 mp3dmod.c:241: Test failed: got 0 mp3dmod.c:242: Test failed: got 3a980 mp3dmod.c:245: Test failed: got 0x80040204
=== w1064 (32 bit mp3dmod) === mp3dmod.c:178: Test failed: got 0 mp3dmod.c:179: Test failed: got 1248 mp3dmod.c:180: Test failed: got 0x1000007 mp3dmod.c:187: Test failed: got 0x1 mp3dmod.c:194: Test failed: got 0x1 mp3dmod.c:195: Test failed: got 0 mp3dmod.c:196: Test failed: got 0 mp3dmod.c:197: Test failed: got deadbeef mp3dmod.c:198: Test failed: got deadbeef mp3dmod.c:202: Test failed: got 0 mp3dmod.c:203: Test failed: got 0 mp3dmod.c:207: Test failed: got 0x1 mp3dmod.c:208: Test failed: got 0 mp3dmod.c:209: Test failed: got 0 mp3dmod.c:210: Test failed: got deadbeef mp3dmod.c:211: Test failed: got deadbeef mp3dmod.c:218: Test failed: got 0x1 mp3dmod.c:219: Test failed: got 0 mp3dmod.c:220: Test failed: got 0 mp3dmod.c:221: Test failed: got deadbeef mp3dmod.c:222: Test failed: got deadbeef mp3dmod.c:226: Test failed: got 0 mp3dmod.c:227: Test failed: got 0 mp3dmod.c:230: Test failed: got 0 mp3dmod.c:238: Test failed: got 0 mp3dmod.c:239: Test failed: got 2304 mp3dmod.c:240: Test failed: got 0x1000007 mp3dmod.c:241: Test failed: got 1fbd0 mp3dmod.c:242: Test failed: got 3a980 mp3dmod.c:245: Test failed: got 0x80040204
=== wvistau64 (64 bit mp3dmod) === mp3dmod.c:195: Test failed: got 1152 mp3dmod.c:198: Test failed: got 1d4c0 mp3dmod.c:202: Test failed: got 1152 mp3dmod.c:208: Test failed: got 3456 mp3dmod.c:210: Test failed: got 1d4c0 mp3dmod.c:219: Test failed: got 2304 mp3dmod.c:220: Test failed: got 0x7 mp3dmod.c:221: Test failed: got 57e40 mp3dmod.c:222: Test failed: got 3a980 mp3dmod.c:226: Test failed: got 2304 mp3dmod.c:227: Test failed: got 0 mp3dmod.c:230: Test failed: got 0 mp3dmod.c:238: Test failed: got 0 mp3dmod.c:239: Test failed: got 1152 mp3dmod.c:240: Test failed: got 0x1000007 mp3dmod.c:241: Test failed: got 927c0 mp3dmod.c:242: Test failed: got 1d4c0 mp3dmod.c:245: Test failed: got 0x80040204
=== w2008s64 (64 bit mp3dmod) === mp3dmod.c:122: Test failed: got 0x80040154 086c:mp3dmod: unhandled exception c0000005 at 0000000000401806
=== w864 (64 bit mp3dmod) === mp3dmod.c:180: Test failed: got 0x1 mp3dmod.c:187: Test failed: got 0 mp3dmod.c:194: Test failed: got 0x1 mp3dmod.c:195: Test failed: got 0 mp3dmod.c:196: Test failed: got 0 mp3dmod.c:197: Test failed: got deadbeef mp3dmod.c:198: Test failed: got deadbeef mp3dmod.c:202: Test failed: got 0 mp3dmod.c:203: Test failed: got 0 mp3dmod.c:207: Test failed: got 0x1 mp3dmod.c:208: Test failed: got 0 mp3dmod.c:209: Test failed: got 0 mp3dmod.c:210: Test failed: got deadbeef mp3dmod.c:211: Test failed: got deadbeef mp3dmod.c:218: Test failed: got 0x1 mp3dmod.c:219: Test failed: got 0 mp3dmod.c:220: Test failed: got 0 mp3dmod.c:221: Test failed: got deadbeef mp3dmod.c:222: Test failed: got deadbeef mp3dmod.c:226: Test failed: got 0 mp3dmod.c:227: Test failed: got 0 mp3dmod.c:230: Test failed: got 0 mp3dmod.c:238: Test failed: got 0 mp3dmod.c:239: Test failed: got 2304 mp3dmod.c:240: Test failed: got 0x1000007 mp3dmod.c:241: Test failed: got 0 mp3dmod.c:242: Test failed: got 3a980 mp3dmod.c:245: Test failed: got 0x80040204
=== w1064 (64 bit mp3dmod) === mp3dmod.c:178: Test failed: got 0 mp3dmod.c:179: Test failed: got 1248 mp3dmod.c:180: Test failed: got 0x1000007 mp3dmod.c:187: Test failed: got 0x1 mp3dmod.c:194: Test failed: got 0x1 mp3dmod.c:195: Test failed: got 0 mp3dmod.c:196: Test failed: got 0 mp3dmod.c:197: Test failed: got deadbeef mp3dmod.c:198: Test failed: got deadbeef mp3dmod.c:202: Test failed: got 0 mp3dmod.c:203: Test failed: got 0 mp3dmod.c:207: Test failed: got 0x1 mp3dmod.c:208: Test failed: got 0 mp3dmod.c:209: Test failed: got 0 mp3dmod.c:210: Test failed: got deadbeef mp3dmod.c:211: Test failed: got deadbeef mp3dmod.c:218: Test failed: got 0x1 mp3dmod.c:219: Test failed: got 0 mp3dmod.c:220: Test failed: got 0 mp3dmod.c:221: Test failed: got deadbeef mp3dmod.c:222: Test failed: got deadbeef mp3dmod.c:226: Test failed: got 0 mp3dmod.c:227: Test failed: got 0 mp3dmod.c:230: Test failed: got 0 mp3dmod.c:238: Test failed: got 0 mp3dmod.c:239: Test failed: got 2304 mp3dmod.c:240: Test failed: got 0x1000007 mp3dmod.c:241: Test failed: got 1fbd0 mp3dmod.c:242: Test failed: got 3a980 mp3dmod.c:245: Test failed: got 0x80040204