* Work around Freebox's bad behavior of only using the first <res> element for images.
This commit is contained in:
parent
27696edf6f
commit
efefcde150
@ -32,6 +32,7 @@ enum client_types {
|
|||||||
EXbox = 1,
|
EXbox = 1,
|
||||||
EPS3,
|
EPS3,
|
||||||
ESamsungTV,
|
ESamsungTV,
|
||||||
|
EFreeBox,
|
||||||
EStandardDLNA150 = 100
|
EStandardDLNA150 = 100
|
||||||
};
|
};
|
||||||
|
|
||||||
|
10
upnphttp.c
10
upnphttp.c
@ -242,6 +242,10 @@ intervening space) by either an integer or the keyword "infinite". */
|
|||||||
h->req_client = EStandardDLNA150;
|
h->req_client = EStandardDLNA150;
|
||||||
h->reqflags |= FLAG_DLNA;
|
h->reqflags |= FLAG_DLNA;
|
||||||
}
|
}
|
||||||
|
else if(strstr(p, "fbxupnpav/"))
|
||||||
|
{
|
||||||
|
h->req_client = EFreeBox;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(strncasecmp(line, "X-AV-Client-Info", 16)==0)
|
else if(strncasecmp(line, "X-AV-Client-Info", 16)==0)
|
||||||
{
|
{
|
||||||
@ -1076,6 +1080,7 @@ SendResp_albumArt(struct upnphttp * h, char * object)
|
|||||||
char **result;
|
char **result;
|
||||||
int rows = 0;
|
int rows = 0;
|
||||||
char *path;
|
char *path;
|
||||||
|
char *dash;
|
||||||
char date[30];
|
char date[30];
|
||||||
time_t curtime = time(NULL);
|
time_t curtime = time(NULL);
|
||||||
off_t offset = 0, size;
|
off_t offset = 0, size;
|
||||||
@ -1090,8 +1095,11 @@ SendResp_albumArt(struct upnphttp * h, char * object)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
strip_ext(object);
|
dash = strchr(object, '-');
|
||||||
|
if( dash )
|
||||||
|
*dash = '\0';
|
||||||
sprintf(sql_buf, "SELECT PATH from ALBUM_ART where ID = %s", object);
|
sprintf(sql_buf, "SELECT PATH from ALBUM_ART where ID = %s", object);
|
||||||
|
printf("sql: %s\n", sql_buf);
|
||||||
sql_get_table(db, sql_buf, &result, &rows, NULL);
|
sql_get_table(db, sql_buf, &result, &rows, NULL);
|
||||||
if( !rows )
|
if( !rows )
|
||||||
{
|
{
|
||||||
|
22
upnpsoap.c
22
upnpsoap.c
@ -606,9 +606,9 @@ callback(void *args, int argc, char **argv, char **azColName)
|
|||||||
/* Video and audio album art is handled differently */
|
/* Video and audio album art is handled differently */
|
||||||
if( *mime == 'v' && (passed_args->filter & FILTER_RES) ) {
|
if( *mime == 'v' && (passed_args->filter & FILTER_RES) ) {
|
||||||
ret = sprintf(str_buf, "<res protocolInfo=\"http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_TN\">"
|
ret = sprintf(str_buf, "<res protocolInfo=\"http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_TN\">"
|
||||||
"http://%s:%d/AlbumArt/%s.jpg"
|
"http://%s:%d/AlbumArt/%s-%s.jpg"
|
||||||
"</res>",
|
"</res>",
|
||||||
lan_addr[0].str, runtime_vars.port, album_art);
|
lan_addr[0].str, runtime_vars.port, album_art, detailID);
|
||||||
memcpy(passed_args->resp+passed_args->size, &str_buf, ret+1);
|
memcpy(passed_args->resp+passed_args->size, &str_buf, ret+1);
|
||||||
passed_args->size += ret;
|
passed_args->size += ret;
|
||||||
}
|
}
|
||||||
@ -621,15 +621,15 @@ callback(void *args, int argc, char **argv, char **azColName)
|
|||||||
memcpy(passed_args->resp+passed_args->size, &str_buf, ret+1);
|
memcpy(passed_args->resp+passed_args->size, &str_buf, ret+1);
|
||||||
passed_args->size += ret;
|
passed_args->size += ret;
|
||||||
}
|
}
|
||||||
ret = sprintf(str_buf, ">http://%s:%d/AlbumArt/%s.jpg</upnp:albumArtURI>",
|
ret = sprintf(str_buf, ">http://%s:%d/AlbumArt/%s-%s.jpg</upnp:albumArtURI>",
|
||||||
lan_addr[0].str, runtime_vars.port, album_art);
|
lan_addr[0].str, runtime_vars.port, album_art, detailID);
|
||||||
memcpy(passed_args->resp+passed_args->size, &str_buf, ret+1);
|
memcpy(passed_args->resp+passed_args->size, &str_buf, ret+1);
|
||||||
passed_args->size += ret;
|
passed_args->size += ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( passed_args->filter & FILTER_RES ) {
|
if( passed_args->filter & FILTER_RES ) {
|
||||||
mime_to_ext(mime, ext);
|
mime_to_ext(mime, ext);
|
||||||
if( tn && atoi(tn) && dlna_pn ) {
|
if( tn && atoi(tn) && (passed_args->client == EFreeBox) && dlna_pn ) {
|
||||||
ret = sprintf(str_buf, "<res protocolInfo=\"http-get:*:%s:%s\">"
|
ret = sprintf(str_buf, "<res protocolInfo=\"http-get:*:%s:%s\">"
|
||||||
"http://%s:%d/Thumbnails/%s.jpg"
|
"http://%s:%d/Thumbnails/%s.jpg"
|
||||||
"</res>",
|
"</res>",
|
||||||
@ -690,6 +690,14 @@ callback(void *args, int argc, char **argv, char **azColName)
|
|||||||
#endif
|
#endif
|
||||||
memcpy(passed_args->resp+passed_args->size, &str_buf, ret+1);
|
memcpy(passed_args->resp+passed_args->size, &str_buf, ret+1);
|
||||||
passed_args->size += ret;
|
passed_args->size += ret;
|
||||||
|
if( tn && atoi(tn) && (passed_args->client != EFreeBox) && dlna_pn ) {
|
||||||
|
ret = sprintf(str_buf, "<res protocolInfo=\"http-get:*:%s:%s\">"
|
||||||
|
"http://%s:%d/Thumbnails/%s.jpg"
|
||||||
|
"</res>",
|
||||||
|
mime, "DLNA.ORG_PN=JPEG_TN", lan_addr[0].str, runtime_vars.port, detailID);
|
||||||
|
memcpy(passed_args->resp+passed_args->size, &str_buf, ret+1);
|
||||||
|
passed_args->size += ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ret = sprintf(str_buf, "</item>");
|
ret = sprintf(str_buf, "</item>");
|
||||||
}
|
}
|
||||||
@ -756,8 +764,8 @@ callback(void *args, int argc, char **argv, char **azColName)
|
|||||||
memcpy(passed_args->resp+passed_args->size, &str_buf, ret+1);
|
memcpy(passed_args->resp+passed_args->size, &str_buf, ret+1);
|
||||||
passed_args->size += ret;
|
passed_args->size += ret;
|
||||||
}
|
}
|
||||||
ret = sprintf(str_buf, ">http://%s:%d/AlbumArt/%s.jpg</upnp:albumArtURI>",
|
ret = sprintf(str_buf, ">http://%s:%d/AlbumArt/%s-%s.jpg</upnp:albumArtURI>",
|
||||||
lan_addr[0].str, runtime_vars.port, album_art);
|
lan_addr[0].str, runtime_vars.port, album_art, detailID);
|
||||||
memcpy(passed_args->resp+passed_args->size, &str_buf, ret+1);
|
memcpy(passed_args->resp+passed_args->size, &str_buf, ret+1);
|
||||||
passed_args->size += ret;
|
passed_args->size += ret;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user