diff options
author | Justin Maggard <jmaggard@users.sourceforce.net> | 2011-07-12 00:01:42 +0400 |
---|---|---|
committer | Justin Maggard <jmaggard@users.sourceforce.net> | 2011-07-12 00:01:42 +0400 |
commit | ea30134419aca056ae3ed2d7f10f12f00d1a0ec5 (patch) | |
tree | 163498ea1ea93e2c3832985274eae9cf677b6331 /minissdp.c | |
parent | bcf13de5593e561882f465681102f2e278442b67 (diff) |
* Fix FF/REW of AVI files on Samsung Series B TV's.
Diffstat (limited to 'minissdp.c')
-rw-r--r-- | minissdp.c | 40 |
1 files changed, 29 insertions, 11 deletions
@@ -44,6 +44,7 @@ #include "upnpreplyparse.h" #include "getifaddr.h" #include "minissdp.h" +#include "utils.h" #include "log.h" /* SSDP ip/port */ @@ -357,9 +358,9 @@ ParseUPnPClient(char *location) int content_len = sizeof(buf); struct NameValueParserData xml; int client; - enum client_types type = -1; + enum client_types type = 0; uint32_t flags = 0; - char *model; + char *model, *serial; if (strncmp(location, "http://", 7) != 0) return; @@ -442,17 +443,29 @@ close: nread -= off - buf; ParseNameValue(off, nread, &xml); model = GetValueFromNameValueList(&xml, "modelName"); + serial = GetValueFromNameValueList(&xml, "serialNumber"); if( model ) { DPRINTF(E_DEBUG, L_SSDP, "Model: %s\n", model); - if (strstr(model, "Roku SoundBridge")) + if( strstr(model, "Roku SoundBridge") ) { type = ERokuSoundBridge; flags |= FLAG_AUDIO_ONLY; } + else if( strcmp(model, "Samsung DTV DMR") == 0 && serial ) + { + DPRINTF(E_DEBUG, L_SSDP, "Serial: %s\n", serial); + /* The Series B I saw was 20081224DMR. Series A should be older than that. */ + if( atoi(serial) > 20081200 ) + { + type = ESamsungSeriesB; + flags |= FLAG_SAMSUNG; + flags |= FLAG_DLNA; + flags |= FLAG_NO_RESIZE; + } + } } - - if( type < 0 ) + if( !type ) return; client = SearchClientCache(dest.sin_addr, 1); /* Add this client to the cache if it's not there already. */ @@ -542,18 +555,23 @@ ProcessSSDPRequest(int s, unsigned short port) while(man[man_len]!='\r' && man[man_len]!='\n') man_len++; } } - if (!loc || !srv || !man || (strncmp(man, "ssdp:alive", man_len) != 0)) + if( !loc || !srv || !man || (strncmp(man, "ssdp:alive", man_len) != 0) ) { return; } - if (strncmp(srv, "Allegro-Software-RomPlug", 24) == 0) + if( strncmp(srv, "Allegro-Software-RomPlug", 24) == 0 || + strstr(loc, "SamsungMRDesc.xml") ) { /* Check if the client is already in cache */ i = SearchClientCache(sendername.sin_addr, 1); - if( i >= 0 && clients[i].type < EStandardDLNA150 ) + if( i >= 0 ) { - clients[i].age = time(NULL); - return; + if( clients[i].type < EStandardDLNA150 && + clients[i].type != ESamsungSeriesA ) + { + clients[i].age = time(NULL); + return; + } } ParseUPnPClient(loc); } @@ -562,7 +580,7 @@ ProcessSSDPRequest(int s, unsigned short port) else if(memcmp(bufr, "M-SEARCH", 8) == 0) { int st_len = 0, mx_len = 0, mx_val = 0; - //DPRINTF(E_DEBUG, L_SSDP, "Received SSDP request:\n%.*s", n, bufr); + //DPRINTF(E_DEBUG, L_SSDP, "Received SSDP request:\n%.*s\n", n, bufr); for(i=0; i < n; i++) { if( bufr[i] == '*' ) |