ejurgensen/forked-daapd — pull request #28 by chme (2014-05-17 12:28:09+00:00)
Title: Fix crash when calling add-next and cur_playing/cur_streaming are NULL

In my addition of "queue_add_next" i introduced a crash if cur_playing and cur_streaming are NULL and source_head is not. I can produce this situation by pressing skip next, while the last song of the queue is playing. Playback stops and cur_streaming/cur_playing are NULL while source_head is still set.

As i understand the code now, the new songs should be added after cur_streaming. Adding them after cur_playing may introduce issues if cur_streaming already points to the next song of the queue and therefor data packets were already send to the speakers (this should be the case in the last two seconds of the playing song).