microsoft-ui-xaml
microsoft-ui-xaml copied to clipboard
[MediaEngine] Wrong Slider's thumb position
Describe the bug
I have an application in which part of the funtionality behaves like a music player.
I have a Slider control whose value is updated along with the music (as the user would expect). That part of the application works fine.
The problem is after you make "a seek operation", which is clicking any part of the Slider control to go to a part that you want to listen to in a song.
The seek functionality works fine, because the audio corresponds to the part of the song that the value of the slider corresponds to. The problem is the thumb of the Slider, it moves 7 seconds ahead of the position that it should be. You can see what I mean in this video I recorded: https://1drv.ms/v/s!Amb20j9mfkXDgWQZNAhLu5a0LRy0?e=7jl9YS
The good thing is that (as I said) it does seek to the correct part of the song (second 134.223), so it doesn't break anything for the time being in my app, it is just aesthetical (wrong slider's thumb position).
You can see in the image the values differ when you seek in the song.
I thought the problem was my code and I just could not find what was wrong, but I made a key discovery yesterday: the problem does not occur with .mp3 files (I had been testing the program with a .flac file).
So the problem maybe is either WinIU 2 or the way the MediaPlayer class (or related classes) handle the .flac format on the inside.
Steps to reproduce the bug
The files to reproduce this are in here: https://1drv.ms/u/s!Amb20j9mfkXDgWWqWLmt-DWLFPSv?e=CksDnR It has 6 files: App.xaml, MainPage.xaml and the respectives code-behind .cs files. Plus 2 audio files, 1 .flac file and 1 .mp3 file, so you can test. Also, in the code-behind of MainPage erase any reference to the OsuParser class, it is not important, you can also ignore all the fields that start with "m_" and the fields of type Windows.UI.Color. The project depends on WinUI 2 and Win2D, the lastest version of both at the time of writing this. My windows version is Windows 10 Home version 22H2
Expected behavior
No response
Screenshots
No response
NuGet package version
None
Windows version
No response
Additional context
No response
I tested your .flac file with the MediaEngine test I had uploaded (https://github.com/castorix/WinUI3_MediaEngine) and I can see a similar bug (silence for a few seconds after seeking) but I don't have this problem with other .flac files, like https://helpguide.sony.net/high-res/sample1/v1/data/Sample_BeeMoved_96kHz24bit.flac.zip I also tested your .flac file with WMP and the bug is the same as in your test. But no bug when played with VLC...
And I just realized it also happens with Groove Music, along with other .flac files I have.
@Miryunku, thank you for opening the issue. Per comment from @castorix above this issue is in the MF/MediaEngine layer - I forwarded the bug internally to that team for investigation.
Not sure what the bot did here. This is still external and assigned.