[player] added some source code comments

This commit is contained in:
chme 2015-04-25 07:43:55 +02:00
parent e156181121
commit 36499f4997

View File

@ -1644,6 +1644,10 @@ source_count()
return ret; return ret;
} }
/*
* Updates cur_playing and notifies remotes and raop devices about
* changes.
*/
static uint64_t static uint64_t
source_check(void) source_check(void)
{ {
@ -1667,6 +1671,7 @@ source_check(void)
return 0; return 0;
} }
/* If cur_playing is NULL, we are still in the first two seconds after starting the stream */
if (!cur_playing) if (!cur_playing)
{ {
if (pos >= cur_streaming->output_start) if (pos >= cur_streaming->output_start)
@ -1680,9 +1685,13 @@ source_check(void)
return pos; return pos;
} }
/* Check if we are still in the middle of the current playing song */
if ((cur_playing->end == 0) || (pos < cur_playing->end)) if ((cur_playing->end == 0) || (pos < cur_playing->end))
return pos; return pos;
/* We have reached the end of the current playing song, update cur_playing to the next song in the queue
and initialize stream_start and output_start values. */
r_mode = repeat; r_mode = repeat;
/* Playlist has only one file, treat REPEAT_ALL as REPEAT_SONG */ /* Playlist has only one file, treat REPEAT_ALL as REPEAT_SONG */
if ((r_mode == REPEAT_ALL) && (source_head == source_head->pl_next)) if ((r_mode == REPEAT_ALL) && (source_head == source_head->pl_next))