With short tracks reading ends before playback starts, so event_read_eof comes
before event_play_start, which causes playing_now to point to a null
reading_now.
With this change it will point to a non-null reading_prev, but note that in the
hopefully rare case of multiple short tracks, the playing_now pointer will
still be incorrect.
ffmpeg changed the behaviour of avcodec_default_get_format() so that it picks
AV_PIX_FMT_MONOBLACK instead of AV_PIX_FMT_RGB24 for the png encoder. That
makes the function of no use to us, so now the pix formats are just hardcoded
in the settings instead.
This change is preparation to use ffmpeg's resampling capabilities to keep local
audio in sync (by up/downsampling slightly). This requires that sample rates are
not fixed for a transcode profile.
Added benefit of this is that we don't need quite as many xcode profiles.
Previously input_metadata_get() would retrieve artwork from the source being
read currently, which might not be the one that triggered the FLAG_METADATA
event. So to fix this the metadata is now read by the input module itself when
the METADATA event happens, and the result is stored with the marker.
The commit also includes a timer so that the input thread does loop forever
if the player never starts reading.
Also some refactoring of metadata + abolish input_metadata_get and
input_quality_get. The latter in an attempt to treat the two in the same way.
In the output implementations playback_stop() was somewhat redundant,
since device_stop() does the same.
The timer should make sure that we always close outputs (previously
they were in some cases kept open).
The commit also includes some renaming.
After an underrun the player doesn't read, so that meant input_wait would
wait a second before allowing the input to write, even though the input_buffer
was not full
+ remember to flush in source_start(), since the input won't do it if
input_now_reading has already been closed (e.g. if starting a new track
while playback is at the end of another track)
Player now stops 10 secs after stop command and 10 mins after pause. At
that time the outputs have probably cut the connection themselves, but
that might be ok (needs testing).