I have created a project that utilizes original libFLAC.dll code to play FLAC files on Windows Phone 8.0. It used to work both in MediaElement and in background on WP 8.0, but after updating the project to Windows Phone 8.1, the sound became flickering and the components began "stack overflow"-ing.
I have updated the project to Windows Phone 8.1 Runtime project since Silverlight 8.1 doesn't support Background Audio. Though the problems were when using both Background Audio and MediaElement in Windows Phone Runtime app.
As it seems unclear, I want to clarify: I have created a MediaStreamSource adapter that hooks Windows.Media.Core.MediaStreamSource events and does all the work. I don't use Silverlight's MediaStreamSource implementation of course.
I have created a thread on MSDN forums where one can find more details, and open-sourced the project on CodePlex so everyone can just take the source code for both WP 8.0 and WP 8.1 and see what's gone wrong.
I really hope someone could find workaround or at least make Microsoft aknowledge the problem.