mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-26 14:13:18 -05:00
Add support for metadata handling in player
This commit is contained in:
parent
e3b756c730
commit
d208ca79d4
50
src/player.c
50
src/player.c
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2010 Julien BLACHE <jb@jblache.org>
|
||||
* Copyright (C) 2010-2011 Julien BLACHE <jb@jblache.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -512,6 +512,54 @@ player_laudio_status_cb(enum laudio_state status)
|
||||
}
|
||||
|
||||
|
||||
/* Metadata */
|
||||
static void
|
||||
metadata_prune(uint64_t pos)
|
||||
{
|
||||
raop_metadata_prune(pos);
|
||||
}
|
||||
|
||||
static void
|
||||
metadata_purge(void)
|
||||
{
|
||||
raop_metadata_purge();
|
||||
}
|
||||
|
||||
static void
|
||||
metadata_send(struct player_source *ps, int startup)
|
||||
{
|
||||
uint64_t offset;
|
||||
uint64_t rtptime;
|
||||
|
||||
offset = 0;
|
||||
|
||||
/* Determine song boundaries, dependent on context */
|
||||
|
||||
/* Restart after pause/seek */
|
||||
if (ps->stream_start)
|
||||
{
|
||||
offset = ps->output_start - ps->stream_start;
|
||||
rtptime = ps->stream_start;
|
||||
}
|
||||
else if (startup)
|
||||
{
|
||||
rtptime = last_rtptime + AIRTUNES_V2_PACKET_SAMPLES;
|
||||
}
|
||||
/* Generic case */
|
||||
else if (cur_streaming && (cur_streaming->end))
|
||||
{
|
||||
rtptime = cur_streaming->end + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
rtptime = 0;
|
||||
DPRINTF(E_LOG, L_PLAYER, "PTOH! Unhandled song boundary case in metadata_send()\n");
|
||||
}
|
||||
|
||||
raop_metadata_send(ps->id, rtptime, offset, startup);
|
||||
}
|
||||
|
||||
|
||||
/* Audio sources */
|
||||
/* Thread: httpd (DACP) */
|
||||
static struct player_source *
|
||||
|
Loading…
x
Reference in New Issue
Block a user