[pull] master from MusicPlayerDaemon:master - #97
Merged
Conversation
Break() only sets a flag without waking select(), so the console handler thread and service dispatcher thread can never actually stop the event loop. Use InjectBreak() instead, which writes to the wake pipe to interrupt select(). Without this, ^c in a console and "net stop mpd" both fail to shut down MPD gracefully - the process must be hard-killed, losing the state file.
Windows FILETIME has 100ns precision but the database stores mtimes as time_t (seconds). After restart, the comparison between the full-precision FILETIME value and the second-precision DB value always mismatches, forcing a full rescan on every startup. Truncate both sides of the comparison to seconds so this works whether song->mtime came from the filesystem (same session) or from a DB reload (restart).
…e_format() If the device has no stream with a matching linear PCM format, the function returned output_format.mSampleRate from an uninitialized struct - undefined behavior. With DSD enabled, this garbage value decided whether the DoP fallback to PCM was taken. Value-initialize output_format so the function deterministically returns 0 (kAudioStreamAnyRate) in that case, which the caller already interprets correctly as "the requested sample rate is not available". While at it, declare output_stream with its proper type AudioStreamID instead of int.
The best-score variable was declared inside the stream loop, so it was reset to zero for every output stream. On a device with more than one output stream, a worse-scoring format found in a later stream could overwrite a better-scoring format already selected from an earlier stream. Move the variable out of the loop so the selection considers all streams together.
GetVolume() truncated the scaled volume, so e.g. 89.99 became 89 and a SetVolume()/GetVolume() round trip could drift downwards. Round to the nearest integer instead, like the other mixer plugins (Alsa, Wasapi, Winmm, PipeWire).
Code is simpler now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )