From c4170af521be28149c0c8442db19c559ec0c6b3d Mon Sep 17 00:00:00 2001 From: Justin Maggard Date: Tue, 10 Nov 2009 00:00:09 +0000 Subject: [PATCH] * Add a no-resize flag, which tells us to to advertise downscaled images. Useful for clients like Samsung TVs, which can use large images well, but will use downscaled small images when given a choice. --- upnpglobalvars.h | 2 +- upnphttp.c | 3 ++- upnphttp.h | 1 + upnpsoap.c | 6 ++++++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/upnpglobalvars.h b/upnpglobalvars.h index f65c5a0..39b3dde 100644 --- a/upnpglobalvars.h +++ b/upnpglobalvars.h @@ -21,7 +21,7 @@ #include -#define MINIDLNA_VERSION "1.0.16" +#define MINIDLNA_VERSION "1.0.16.1" #define CLIENT_CACHE_SLOTS 20 #define USE_FORK 1 diff --git a/upnphttp.c b/upnphttp.c index ab8011e..86e0f76 100644 --- a/upnphttp.c +++ b/upnphttp.c @@ -251,6 +251,7 @@ intervening space) by either an integer or the keyword "infinite". */ { h->req_client = ESamsungTV; h->reqflags |= FLAG_DLNA; + h->reqflags |= FLAG_NO_RESIZE; //h->reqflags |= FLAG_MIME_AVI_DIVX; } else if(strstr(p, "bridgeCo-DMP/3")) @@ -1492,7 +1493,7 @@ SendResp_resizedimg(struct upnphttp * h, char * object) "Connection: close\r\n" "Date: %s\r\n" "EXT:\r\n" - "contentFeatures.dlna.org: DLNA.ORG_PN=JPEG_%s\r\n" + "contentFeatures.dlna.org: DLNA.ORG_PN=JPEG_%s;DLNA.ORG_CI=1\r\n" "Server: " MINIDLNA_SERVER_STRING "\r\n", size, date, dlna_pn); diff --git a/upnphttp.h b/upnphttp.h index 1b42ce5..1d0ff91 100644 --- a/upnphttp.h +++ b/upnphttp.h @@ -86,6 +86,7 @@ struct upnphttp { #define FLAG_MIME_AVI_DIVX 0x00200000 #define FLAG_MIME_AVI_AVI 0x00400000 #define FLAG_MIME_FLAC_FLAC 0x00800000 +#define FLAG_NO_RESIZE 0x01000000 /* New_upnphttp() */ struct upnphttp * diff --git a/upnpsoap.c b/upnpsoap.c index 979f8cb..6fa5fc0 100644 --- a/upnpsoap.c +++ b/upnpsoap.c @@ -493,6 +493,12 @@ static void add_resized_res(int srcw, int srch, int reqw, int reqh, char *dlna_p int dsth = reqh; char str_buf[256]; + + if( passed_args->flags & FLAG_NO_RESIZE ) + { + return; + } + ret = sprintf(str_buf, "<res "); memcpy(passed_args->resp+passed_args->size, &str_buf, ret+1); passed_args->size += ret;