I'd like this more with tests, showing what the application was doing and how Wine failed its expectations but now meets them.
Andrew
On Fri, Jun 09, 2017 at 06:08:28PM -0500, Zebediah Figura wrote:
On both of the Windows boxes I tested, the driver didn't list any MPEG formats from acmFormatEnum(), acmFormatDetails(), or acmFormatSuggest(), and listed a count of 0 for acmFormatTag() and acmFormatTagEnum(). sndrec32.exe therefore disallows converting or recording to mp3, and doesn't even show it in the list of options brought up by acmFormatChoose, hence the third patch in this series.
I had written some tests to corroborate this, but these tests didn't give consistent output [1], since presumably the drivers that exist on Windows vary, so I removed them. A better course of action would be to check if the format is decode-only, presumably via ACM_STREAMOPENF_QUERY, and then test if the above functions corroborate this.
Since I'd like to put some more tests on the PCM converter, and adding tests here would depend on those there, I'll hold off on resending this patch.
[1] https://source.winehq.org/patches/data/134748.testfail
On 06/12/2017 10:06 AM, Andrew Eikum wrote:
Looking at this again I don't think there's really any way to test this; that is, there is no function that these "match" the output of. acmStreamConvert() with the QUERY option would be the obvious choice, and is basically the test case relevant to the application in question, but it requires a source format, and I'm not sure we can assume any given source format will work for all/any given MPEG destination format, even if converting to that MPEG format is possible in general. (waveInOpen() doesn't work either, and probably shouldn't be expected to.)
The goal of this patch is ultimately that MPEG doesn't show up in the list of formats brought up by acmFormatChoose, because we can't convert to it. If there's a better/more testable way to achieve this, please don't hesitate to suggest.
On 06/12/2017 02:10 PM, Zebediah Figura wrote:
On Tue, Jun 20, 2017 at 06:04:45PM -0500, Zebediah Figura wrote:
What does the application do? My understanding was it used cStandardFormats to determine whether an encoding is available, and then tried to open the ACM stream with that conversion, which would then fail in Wine and cause the problem. Your patch fixed that by changing cStandardFormats to 0, so the application never tried to open the stream. Is that about right?
If so, you could add a test showing that if cStandardFormats > 0, then the stream should open. If cStandardFormats == 0, then the stream should fail to open. Wine would fail that test without your patch, but pass it with your patch. It's fine to limit the test case to the specific source and destination formats in question here, there's no need to be exhaustive.
Andrew
On 06/21/2017 07:18 AM, Andrew Eikum wrote:
Not directly, no. It calls acmFormatChoose, which brings up a system-defined dialog box allowing the user to choose from available formats to convert to. Then it tries to convert from whatever format it has open into whatever format acmFormatChoose returns; if this is MPEG, the latter will fail.