MusicPlayerDaemon / MPD

Music Player Daemon
https://www.musicpd.org/
GNU General Public License v2.0
2.17k stars 351 forks source link

MPD won't start playing again after being paused (WASAPI output plugin) #1451

Closed RichardSchorrig closed 2 years ago

RichardSchorrig commented 2 years ago

Bug report

Describe the bug

If MPD is paused and then started again, it won't play (no music can be heard). This only happens with the WASAPI output plugin.

Expected Behavior

Pause and play should work, stopping and starting the music

Actual Behavior

Pause and play do not work, after playing again no music can be heard

Version

D:\Programme\MPD>mpd.exe --version Music Player Daemon 0.23.5 (v0.23.5) Copyright 2003-2007 Warren Dukes warren.dukes@gmail.com Copyright 2008-2021 Max Kellermann max.kellermann@gmail.com This is free software; see the source for copying conditions. There is NO warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Database plugins: simple proxy

Storage plugins: local nfs curl

Decoders plugins: [vorbis] ogg oga [oggflac] ogg oga [flac] flac [opus] opus ogg oga [dsdiff] dff [dsf] dsf [hybrid_dsd] m4a [openmpt] mptm mod s3m xm it 669 amf ams c67 dbm digi dmf dsm dtm far imf ice j2b m15 mdl med mms mt2 mtm nst okt plm psm pt36 ptm sfx sfx2 st26 stk stm stp ult wow gdm mo3 oxm umx xpk ppm mmcmp [modplug] 669 amf ams dbm dfm dsm far it med mdl mod mtm mt2 okt s3m stm ult umx xm [wildmidi] mid [ffmpeg] 16sv 3g2 3gp 4xm 8svx aa3 aac ac3 adx afc aif aifc aiff al alaw amr anim apc ape asf atrac au aud avi avm2 avs bap bfi c93 cak cin cmv cpk daud dct divx dts dv dvd dxa eac3 film flac flc fli fll flx flv g726 gsm gxf iss m1v m2v m2t m2ts m4a m4b m4v mad mj2 mjpeg mjpg mka mkv mlp mm mmf mov mp+ mp1 mp2 mp3 mp4 mpc mpeg mpg mpga mpp mpu mve mvi mxf nc nsv nut nuv oga ogm ogv ogx oma ogg omg opus psp pva qcp qt r3d ra ram rl2 rm rmvb roq rpl rvc shn smk snd sol son spx str swf tak tgi tgq tgv thp ts tsp tta xa xvid uv uv2 vb vid vob voc vp6 vmd wav webm wma wmv wsaud wsvga wv wve [gme] ay gbs gym hes kss nsf nsfe rsn sap spc vgm vgz [pcm]

Filters:

Tag plugins:

Output plugins: null jack httpd snapcast recorder winmm wasapi

Encoder plugins: null vorbis opus lame wave flac

Input plugins: file curl ffmpeg nfs

Playlist plugins: extm3u m3u pls xspf asx rss flac cue embcue

Protocols: http:// https:// nfs://

Other features: ipv6 tcp

Log

n.a.

RichardSchorrig commented 2 years ago

I already identified the issue, but I have trouble submitting the fix. It seems like I don't have write access to the MPD repository (fatal: unable to access 'https://github.com/MusicPlayerDaemon/MPD.git/': The requested URL returned error: 403)

Fix: In src/output/plugins/WasapiOutputPlugin.cxx, function WasapiOutputThread::Work(), the scope guard of the while (true) loop must be moved above the "if (!is_exclusive)" condition, because if this condition and the following condition (if (data_in_frames >= buffer_size_in_frames)) is met, it will continue without actually releasing the buffer to the audio client.