* Add flag to force downscaled thumbnails rather than using embedded ones.

* Add DirecTV client detection.
This commit is contained in:
Justin Maggard
2012-05-31 18:37:22 +00:00
parent bca5a24a57
commit ba162fc082
4 changed files with 28 additions and 22 deletions

View File

@ -926,7 +926,7 @@ callback(void *args, int argc, char **argv, char **azColName)
ret = strcatf(str, "<upnp:album>%s</upnp:album>", "[No Keywords]");
/* EVA2000 doesn't seem to handle embedded thumbnails */
if( passed_args->client != ENetgearEVA2000 && tn && atoi(tn) ) {
if( !(passed_args->flags & FLAG_RESIZE_THUMBS) && tn && atoi(tn) ) {
ret = strcatf(str, "<upnp:albumArtURI>"
"http://%s:%d/Thumbnails/%s.jpg"
"</upnp:albumArtURI>",
@ -940,31 +940,28 @@ callback(void *args, int argc, char **argv, char **azColName)
}
if( passed_args->filter & FILTER_RES ) {
mime_to_ext(mime, ext);
if( (passed_args->client == EFreeBox) && tn && atoi(tn) ) {
ret = strcatf(str, "<res protocolInfo=\"http-get:*:%s:%s\">"
"http://%s:%d/Thumbnails/%s.jpg"
"</res>",
mime, "DLNA.ORG_PN=JPEG_TN", lan_addr[passed_args->iface].str,
runtime_vars.port, detailID);
}
add_res(size, duration, bitrate, sampleFrequency, nrAudioChannels,
resolution, dlna_buf, mime, detailID, ext, passed_args);
if( (*mime == 'i') && (passed_args->client != EFreeBox) ) {
int srcw = atoi(strsep(&resolution, "x"));
int srch = atoi(resolution);
if( !dlna_pn ) {
add_resized_res(srcw, srch, 4096, 4096, "JPEG_LRG", detailID, passed_args);
if( *mime == 'i' ) {
int srcw, srch;
if( resolution && (sscanf(resolution, "%dx%d", &srcw, &srch) == 2) )
{
if( srcw > 4096 || srch > 4096 )
add_resized_res(srcw, srch, 4096, 4096, "JPEG_LRG", detailID, passed_args);
if( srcw > 1024 || srch > 768 )
add_resized_res(srcw, srch, 1024, 768, "JPEG_MED", detailID, passed_args);
if( srcw > 640 || srch > 480 )
add_resized_res(srcw, srch, 640, 480, "JPEG_SM", detailID, passed_args);
}
if( !dlna_pn || !strncmp(dlna_pn, "JPEG_L", 6) || !strncmp(dlna_pn, "JPEG_M", 6) ) {
add_resized_res(srcw, srch, 640, 480, "JPEG_SM", detailID, passed_args);
}
if( tn && atoi(tn) ) {
if( !(passed_args->flags & FLAG_RESIZE_THUMBS) && tn && atoi(tn) ) {
ret = strcatf(str, "<res protocolInfo=\"http-get:*:%s:%s\">"
"http://%s:%d/Thumbnails/%s.jpg"
"</res>",
mime, "DLNA.ORG_PN=JPEG_TN;DLNA.ORG_CI=1", lan_addr[passed_args->iface].str,
runtime_vars.port, detailID);
}
else
add_resized_res(srcw, srch, 160, 160, "JPEG_TN", detailID, passed_args);
}
else if( *mime == 'v' ) {
switch( passed_args->client ) {