Commit 190e37e was wrong, we can't just update revision number every time, we
should not do it when we are called with 0 or 1 as revision-number. In those
cases we must return the revision number the client should use, which should
either be the current pending (if other clients are waiting) or the number
following what was used last time we were called with > 1 rev num.
Hopefully this fixes Hyperfine issues.
In preparation for the new endpoints the following refactorings where
done in lastfm.c:
- Initialize lastfm.c in main.c instead of on first scrobble attempt
(necessary to retrieve the correct lastfm status)
- Return error messages if login attempt failed
- Add api function for status and logout
- Notify about Last.fm status changes
Unrelated changes in lastfm.c are:
- Refactoring of request_post
- Add request parameters sorted alphabetically and remove calling the
sort method in request_post
Artwork in embedded files not showing up in non-legacy mode if the artwork does
not require rescaling. The bug is that we are by mistake sending a chunk of the
embedded file, not the artwork in it.
The bug affected Hyperfine Remote, which would not call back with a playstatusupdate
when it got a cmsr which had the same value as the previous (a value of 2)
Align with other scanners to use 1-query db_file_ping_bypath(). Also refactor to
reduce indent level and fix memleak of mfi->album + mfi->album_artist.
Thanks to Denis Denisov and cppcheck for notifying about the below. The leaks
are edge cases, but the warning of dereference of avail in alsa.c points at
a bug that could probably cause actual crashes.
[src/evrtsp/rtsp.c:1352]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
[src/httpd_daap.c:228]: (error) Memory leak: s
[src/library.c:280]: (warning) %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'.
[src/library.c:284]: (warning) %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'.
[src/library/filescanner_playlist.c:251]: (error) Resource leak: fp
[src/library/filescanner_playlist.c:273]: (error) Resource leak: fp
[src/outputs/alsa.c:143]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
[src/outputs/alsa.c:657]: (warning) Possible null pointer dereference: avail
[src/outputs/dummy.c:75]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
[src/outputs/fifo.c:245]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
[src/outputs/raop.c:1806]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
[src/outputs/raop.c:1371]: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'signed int'.
[src/outputs/raop.c:1471]: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'signed int'.
[src/outputs/raop_verification.c:705] -> [src/outputs/raop_verification.c:667]: (warning) Either the condition 'if(len_M)' is redundant or there is possible null pointer dereference: len_M.