alsa: snd_pcm_drain doesn't block in non-blocking mode
Use correct buffer pointer
alsa: fix drain behaviour

This fixes two issues when calling snd_pcm_drain.

1) snd_pcm_drain allows for non-blocking operation, so we need make sure either the pcm handle is in blocking mode or add our own blocking loop.

2) snd_pcm_drain doesn't work with frames, but rather with periods. It can't wait for partial filled periods, so we need to zero fill any unwritten frames in period to avoid any sound distortion (caused by uninitialized buffer data or previously written frames).
Add import option to override default text encoding for id3v1 tags.
Disable id3v1 encoding field if no tags are read
Merge branch 'feature-id3-custom-textcodec' into develop
add id3v1 codec support to sync as well
Fix memory leak for custom id3v1 codec
add meta data parsing to mp4
Escape & when displaying track info in FXLabel
gap reads meta data, so don't read tags from local source
change open meta data extraction a bit
[mp4] add some protection for non seekable streams
Fix tag saving to possibly write info to multiple tags in file
[mp3] make sure bitrate is valid to prevent incorrect syncs
Don't call reset_track_display in notify_playback_finished

When notify_playback_finished is called, we're technically still playing and calling reset_track_display before the track is finishedmay interfere with progress events that are still in the pipeline. Eventually the PLAYER_STATE_STOPPED event will come in and then we'll call reset_track_display.
[cleanup] remove unused "open audio device on startup" settings
Add menu option to schedule stop after track finishes
Fix compilation. Preferences Dialog still referencing old preferences key
Don't show minimize to tray if we don't have a tray icon