Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/azatoth/minidlna.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Maggard <jmaggard@users.sourceforce.net>2011-07-12 00:01:42 +0400
committerJustin Maggard <jmaggard@users.sourceforce.net>2011-07-12 00:01:42 +0400
commitea30134419aca056ae3ed2d7f10f12f00d1a0ec5 (patch)
tree163498ea1ea93e2c3832985274eae9cf677b6331 /minissdp.c
parentbcf13de5593e561882f465681102f2e278442b67 (diff)
* Fix FF/REW of AVI files on Samsung Series B TV's.
Diffstat (limited to 'minissdp.c')
-rw-r--r--minissdp.c40
1 files changed, 29 insertions, 11 deletions
diff --git a/minissdp.c b/minissdp.c
index 5cfa35c..165f778 100644
--- a/minissdp.c
+++ b/minissdp.c
@@ -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] == '*' )