upnpsoap: fix some clients playing artwork instead of movie
While playback on an Samsung E Series TV is ok, other clients such as VLC and vplayer (android) attempt to play the artwork rather than the movie. The issue was traced to minidlna serving the artwork res before the movie res. Other dlna server's were observed and found to the send the movie first then the artwork. Swapping the order seems to keep all tested clients happy. Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
This commit is contained in:
parent
2c33d4149d
commit
b0c1dea56b
68
upnpsoap.c
68
upnpsoap.c
@ -846,40 +846,6 @@ callback(void *args, int argc, char **argv, char **azColName)
|
||||
if( track && atoi(track) && (passed_args->filter & FILTER_UPNP_ORIGINALTRACKNUMBER) ) {
|
||||
ret = strcatf(str, "<upnp:originalTrackNumber>%s</upnp:originalTrackNumber>", track);
|
||||
}
|
||||
if( album_art && atoi(album_art) )
|
||||
{
|
||||
/* Video and audio album art is handled differently */
|
||||
if( *mime == 'v' && (passed_args->filter & FILTER_RES) && !(passed_args->flags & FLAG_MS_PFS) ) {
|
||||
ret = strcatf(str, "<res protocolInfo=\"http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_TN\">"
|
||||
"http://%s:%d/AlbumArt/%s-%s.jpg"
|
||||
"</res>",
|
||||
lan_addr[passed_args->iface].str, runtime_vars.port, album_art, detailID);
|
||||
} else if( passed_args->filter & FILTER_UPNP_ALBUMARTURI ) {
|
||||
ret = strcatf(str, "<upnp:albumArtURI");
|
||||
if( passed_args->filter & FILTER_UPNP_ALBUMARTURI_DLNA_PROFILEID ) {
|
||||
ret = strcatf(str, " dlna:profileID=\"JPEG_TN\" xmlns:dlna=\"urn:schemas-dlna-org:metadata-1-0/\"");
|
||||
}
|
||||
ret = strcatf(str, ">http://%s:%d/AlbumArt/%s-%s.jpg</upnp:albumArtURI>",
|
||||
lan_addr[passed_args->iface].str, runtime_vars.port, album_art, detailID);
|
||||
}
|
||||
}
|
||||
if( (passed_args->flags & FLAG_MS_PFS) && *mime == 'i' ) {
|
||||
if( passed_args->client == EMediaRoom && !album )
|
||||
ret = strcatf(str, "<upnp:album>%s</upnp:album>", "[No Keywords]");
|
||||
|
||||
/* EVA2000 doesn't seem to handle embedded thumbnails */
|
||||
if( !(passed_args->flags & FLAG_RESIZE_THUMBS) && tn && atoi(tn) ) {
|
||||
ret = strcatf(str, "<upnp:albumArtURI>"
|
||||
"http://%s:%d/Thumbnails/%s.jpg"
|
||||
"</upnp:albumArtURI>",
|
||||
lan_addr[passed_args->iface].str, runtime_vars.port, detailID);
|
||||
} else {
|
||||
ret = strcatf(str, "<upnp:albumArtURI>"
|
||||
"http://%s:%d/Resized/%s.jpg?width=160,height=160"
|
||||
"</upnp:albumArtURI>",
|
||||
lan_addr[passed_args->iface].str, runtime_vars.port, detailID);
|
||||
}
|
||||
}
|
||||
if( passed_args->filter & FILTER_RES ) {
|
||||
ext = mime_to_ext(mime);
|
||||
add_res(size, duration, bitrate, sampleFrequency, nrAudioChannels,
|
||||
@ -998,6 +964,40 @@ callback(void *args, int argc, char **argv, char **azColName)
|
||||
}
|
||||
}
|
||||
}
|
||||
if( album_art && atoi(album_art) )
|
||||
{
|
||||
/* Video and audio album art is handled differently */
|
||||
if( *mime == 'v' && (passed_args->filter & FILTER_RES) && !(passed_args->flags & FLAG_MS_PFS) ) {
|
||||
ret = strcatf(str, "<res protocolInfo=\"http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_TN\">"
|
||||
"http://%s:%d/AlbumArt/%s-%s.jpg"
|
||||
"</res>",
|
||||
lan_addr[passed_args->iface].str, runtime_vars.port, album_art, detailID);
|
||||
} else if( passed_args->filter & FILTER_UPNP_ALBUMARTURI ) {
|
||||
ret = strcatf(str, "<upnp:albumArtURI");
|
||||
if( passed_args->filter & FILTER_UPNP_ALBUMARTURI_DLNA_PROFILEID ) {
|
||||
ret = strcatf(str, " dlna:profileID=\"JPEG_TN\" xmlns:dlna=\"urn:schemas-dlna-org:metadata-1-0/\"");
|
||||
}
|
||||
ret = strcatf(str, ">http://%s:%d/AlbumArt/%s-%s.jpg</upnp:albumArtURI>",
|
||||
lan_addr[passed_args->iface].str, runtime_vars.port, album_art, detailID);
|
||||
}
|
||||
}
|
||||
if( (passed_args->flags & FLAG_MS_PFS) && *mime == 'i' ) {
|
||||
if( passed_args->client == EMediaRoom && !album )
|
||||
ret = strcatf(str, "<upnp:album>%s</upnp:album>", "[No Keywords]");
|
||||
|
||||
/* EVA2000 doesn't seem to handle embedded thumbnails */
|
||||
if( !(passed_args->flags & FLAG_RESIZE_THUMBS) && tn && atoi(tn) ) {
|
||||
ret = strcatf(str, "<upnp:albumArtURI>"
|
||||
"http://%s:%d/Thumbnails/%s.jpg"
|
||||
"</upnp:albumArtURI>",
|
||||
lan_addr[passed_args->iface].str, runtime_vars.port, detailID);
|
||||
} else {
|
||||
ret = strcatf(str, "<upnp:albumArtURI>"
|
||||
"http://%s:%d/Resized/%s.jpg?width=160,height=160"
|
||||
"</upnp:albumArtURI>",
|
||||
lan_addr[passed_args->iface].str, runtime_vars.port, detailID);
|
||||
}
|
||||
}
|
||||
ret = strcatf(str, "</item>");
|
||||
}
|
||||
else if( strncmp(class, "container", 9) == 0 )
|
||||
|
Loading…
x
Reference in New Issue
Block a user