mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-28 16:15:57 -05:00
Add missing DMAP types and correct existing types
Most of the unsigned DMAP types were missing and assignments were incorrect between signed and unsigned types. Fix all of this, and add (preliminary) support for the new types.
This commit is contained in:
parent
d4fb2091c8
commit
0607e82a42
@ -6,11 +6,14 @@
|
||||
|
||||
enum dmap_type
|
||||
{
|
||||
DMAP_TYPE_BYTE = 0x01,
|
||||
DMAP_TYPE_UBYTE = 0x02,
|
||||
DMAP_TYPE_SHORT = 0x03,
|
||||
DMAP_TYPE_INT = 0x05,
|
||||
DMAP_TYPE_LONG = 0x07,
|
||||
DMAP_TYPE_UBYTE = 0x01,
|
||||
DMAP_TYPE_BYTE = 0x02,
|
||||
DMAP_TYPE_USHORT = 0x03,
|
||||
DMAP_TYPE_SHORT = 0x04,
|
||||
DMAP_TYPE_UINT = 0x05,
|
||||
DMAP_TYPE_INT = 0x06,
|
||||
DMAP_TYPE_ULONG = 0x07,
|
||||
DMAP_TYPE_LONG = 0x08,
|
||||
DMAP_TYPE_STRING = 0x09,
|
||||
DMAP_TYPE_DATE = 0x0a,
|
||||
DMAP_TYPE_VERSION = 0x0b,
|
||||
|
@ -519,23 +519,26 @@ dmap_add_field(struct evbuffer *evbuf, struct dmap_field_map *dfm, char *strval,
|
||||
|
||||
switch (dfm->type)
|
||||
{
|
||||
case DMAP_TYPE_BYTE:
|
||||
case DMAP_TYPE_UBYTE:
|
||||
case DMAP_TYPE_BYTE:
|
||||
if (val)
|
||||
dmap_add_char(evbuf, dfm->tag, val);
|
||||
break;
|
||||
|
||||
case DMAP_TYPE_USHORT:
|
||||
case DMAP_TYPE_SHORT:
|
||||
if (val)
|
||||
dmap_add_short(evbuf, dfm->tag, val);
|
||||
break;
|
||||
|
||||
case DMAP_TYPE_UINT:
|
||||
case DMAP_TYPE_INT:
|
||||
case DMAP_TYPE_DATE:
|
||||
if (val)
|
||||
dmap_add_int(evbuf, dfm->tag, val);
|
||||
break;
|
||||
|
||||
case DMAP_TYPE_ULONG:
|
||||
case DMAP_TYPE_LONG:
|
||||
if (val64)
|
||||
dmap_add_long(evbuf, dfm->tag, val64);
|
||||
@ -546,6 +549,7 @@ dmap_add_field(struct evbuffer *evbuf, struct dmap_field_map *dfm, char *strval,
|
||||
dmap_add_string(evbuf, dfm->tag, strval);
|
||||
break;
|
||||
|
||||
/* DMAP_TYPE_VERSION & DMAP_TYPE_LIST not handled here */
|
||||
default:
|
||||
DPRINTF(E_LOG, L_DAAP, "Unsupported DMAP type %d for DMAP field %s\n", dfm->type, dfm->desc);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user