lib/nfs/FileReader: use the thread-safe InjectEvent

.. instead of DeferEvent, which is not thread-safe.  This caused
various playback problems, which was initially caused by the
DeferEvent/InjectEvent split in commit 774b4313f2

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1298
This commit is contained in:
Max Kellermann 2021-10-20 09:24:45 +02:00
parent f31920e092
commit 5fab107fd3
2 changed files with 8 additions and 3 deletions

2
NEWS
View File

@ -1,4 +1,6 @@
ver 0.23.2 (not yet released)
* input
- nfs: fix playback bug
* output
- pipewire: send artist and title to PipeWire
* neighbor

View File

@ -22,7 +22,7 @@
#include "Lease.hxx"
#include "Callback.hxx"
#include "event/DeferEvent.hxx"
#include "event/InjectEvent.hxx"
#include "util/Compiler.h"
#include <cstddef>
@ -63,7 +63,10 @@ class NfsFileReader : NfsLease, NfsCallback {
nfsfh *fh;
DeferEvent defer_open;
/**
* To inject the Open() call into the I/O thread.
*/
InjectEvent defer_open;
public:
NfsFileReader() noexcept;
@ -150,7 +153,7 @@ private:
void OnNfsCallback(unsigned status, void *data) noexcept final;
void OnNfsError(std::exception_ptr &&e) noexcept final;
/* DeferEvent callback */
/* InjectEvent callback */
void OnDeferredOpen() noexcept;
};