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:
authorCarl Fürstenberg <azatoth@gmail.com>2011-07-13 22:28:21 +0400
committerCarl Fürstenberg <azatoth@gmail.com>2011-07-13 22:28:21 +0400
commit39a60e8111d4163de28b3e3c9dda621485975bc5 (patch)
tree4f58c74fe712c07a6005f2a8ec800f4ece11e6a3
parent2cf2ffe15efd3e123c41a2971baf27ce266407cb (diff)
parentea30134419aca056ae3ed2d7f10f12f00d1a0ec5 (diff)
Merge branch 'cvs'
Conflicts: src/minissdp.c
-rw-r--r--NEWS1
-rw-r--r--linux/minidlna.init.d.script40
-rw-r--r--src/minidlnatypes.h1
-rw-r--r--src/minissdp.c40
-rw-r--r--src/upnpglobalvars.h2
-rw-r--r--src/upnphttp.c15
-rw-r--r--src/upnpsoap.c2
7 files changed, 57 insertions, 44 deletions
diff --git a/NEWS b/NEWS
index c23fc4d..1911719 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,6 @@
1.0.21 - Released 00-MONTH-2011
--------------------------------
+- Fix FF/REW of AVI files on Samsung Series B TV's.
- Fix a crash bug when playing music on TiVo.
- Add the ability to change the root media container.
- Add WAV/RIFF INFO tag parsing support for the most common tags.
diff --git a/linux/minidlna.init.d.script b/linux/minidlna.init.d.script
index 69edd90..55647d7 100644
--- a/linux/minidlna.init.d.script
+++ b/linux/minidlna.init.d.script
@@ -3,35 +3,19 @@
# chkconfig: 345 99 10
# description: Startup/shutdown script for MiniDLNA daemon
#
-# $Id$
-# MiniUPnP project
-# author: Thomas Bernard
-# website: http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
+# Based on the MiniUPnPd script by Thomas Bernard
+# Modified for MiniDLNA by Justin Maggard <jmaggard@users.sourceforge.net>
#
-# Copyright (c) 2006-2008, Thomas Bernard
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# * The name of the author may not be used to endorse or promote products
-# derived from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
+### BEGIN INIT INFO
+# Provides: minidlna
+# Required-Start: $network $local_fs $remote_fs
+# Required-Stop:: $network $local_fs $remote_fs
+# Should-Start: $all
+# Should-Stop: $all
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: DLNA/UPnP-AV media server
+### END INIT INFO
MINIDLNA=/usr/sbin/minidlna
ARGS='-f /etc/minidlna.conf'
diff --git a/src/minidlnatypes.h b/src/minidlnatypes.h
index b76f350..9cf9105 100644
--- a/src/minidlnatypes.h
+++ b/src/minidlnatypes.h
@@ -82,6 +82,7 @@ enum client_types {
ELGDevice,
ENetgearEVA2000,
ESamsungSeriesA,
+ ESamsungSeriesB,
EStandardDLNA150 = 100
};
diff --git a/src/minissdp.c b/src/minissdp.c
index 5a35dfb..70a9eb1 100644
--- a/src/minissdp.c
+++ b/src/minissdp.c
@@ -48,6 +48,7 @@
#include "getifaddr.h"
#include "minissdp.h"
#include "codelength.h"
+#include "utils.h"
#include "log.h"
/* SSDP ip/port */
@@ -363,9 +364,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;
@@ -448,17 +449,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. */
@@ -548,18 +561,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);
}
@@ -568,7 +586,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] == '*' )
diff --git a/src/upnpglobalvars.h b/src/upnpglobalvars.h
index 175ad73..3e871d8 100644
--- a/src/upnpglobalvars.h
+++ b/src/upnpglobalvars.h
@@ -58,7 +58,7 @@
#include <sqlite3.h>
-#define MINIDLNA_VERSION "1.0.20.2"
+#define MINIDLNA_VERSION "1.0.20.3"
#ifdef NETGEAR
# define SERVER_NAME "ReadyDLNA"
diff --git a/src/upnphttp.c b/src/upnphttp.c
index b0ccd66..97e8d2c 100644
--- a/src/upnphttp.c
+++ b/src/upnphttp.c
@@ -494,9 +494,11 @@ next_header:
break;
}
}
- else if( (clients[n].type < EStandardDLNA150) && (h->req_client == EStandardDLNA150) )
+ else if( (clients[n].type < EStandardDLNA150 && h->req_client == EStandardDLNA150) ||
+ (clients[n].type == ESamsungSeriesB && h->req_client == ESamsungSeriesA) )
{
/* If we know the client and our new detection is generic, use our cached info */
+ /* If we detected a Samsung Series B earlier, don't overwrite it with Series A info */
h->reqflags |= clients[n].flags;
h->req_client = clients[n].type;
return;
@@ -1702,13 +1704,18 @@ SendResp_dlnafile(struct upnphttp * h, char * object)
off_t total, offset, size;
sqlite_int64 id;
int sendfh;
- static struct { sqlite_int64 id; char path[PATH_MAX]; char mime[32]; char dlna[96]; } last_file = { 0 };
+ static struct { sqlite_int64 id;
+ enum client_types client;
+ char path[PATH_MAX];
+ char mime[32];
+ char dlna[96];
+ } last_file = { 0, 0 };
#if USE_FORK
pid_t newpid = 0;
#endif
id = strtoll(object, NULL, 10);
- if( id != last_file.id )
+ if( id != last_file.id || h->req_client != last_file.client )
{
sprintf(sql_buf, "SELECT PATH, MIME, DLNA_PN from DETAILS where ID = '%lld'", id);
ret = sql_get_table(db, sql_buf, &result, &rows, NULL);
@@ -1727,6 +1734,7 @@ SendResp_dlnafile(struct upnphttp * h, char * object)
}
/* Cache the result */
last_file.id = id;
+ last_file.client = h->req_client;
strncpy(last_file.path, result[3], sizeof(last_file.path)-1);
if( result[4] )
{
@@ -1894,6 +1902,7 @@ SendResp_dlnafile(struct upnphttp * h, char * object)
"Server: " MINIDLNA_SERVER_STRING "\r\n\r\n",
date, last_file.dlna);
+ //DEBUG DPRINTF(E_DEBUG, L_HTTP, "RESPONSE: %s\n", str.data);
if( send_data(h, str.data, str.off, MSG_MORE) == 0 )
{
if( h->req_command != EHead )
diff --git a/src/upnpsoap.c b/src/upnpsoap.c
index f143d6a..1af0f0c 100644
--- a/src/upnpsoap.c
+++ b/src/upnpsoap.c
@@ -692,7 +692,7 @@ callback(void *args, int argc, char **argv, char **azColName)
strcpy(mime+6, "avi");
}
}
- else if( passed_args->client == EFreeBox )
+ else if( passed_args->client == EFreeBox && dlna_pn )
{
if( strncmp(dlna_pn, "AVC_TS", 6) == 0 ||
strncmp(dlna_pn, "MPEG_TS", 7) == 0 )