* Add version number.

This commit is contained in:
Justin Maggard 2009-05-05 02:39:40 +00:00
parent 392654a234
commit 1a26bfba7a
4 changed files with 17 additions and 5 deletions

View File

@ -489,6 +489,10 @@ init(int argc, char * * argv)
case 'f': case 'f':
i++; /* discarding, the config file is already read */ i++; /* discarding, the config file is already read */
break; break;
case 'V':
printf("Version " MINIDLNA_VERSION "\n");
exit(0);
break;
default: default:
fprintf(stderr, "Unknown option: %s\n", argv[i]); fprintf(stderr, "Unknown option: %s\n", argv[i]);
} }
@ -512,6 +516,7 @@ init(int argc, char * * argv)
"of daemon uptime.\n" "of daemon uptime.\n"
"\t-B sets bitrates reported by daemon in bits per second.\n" "\t-B sets bitrates reported by daemon in bits per second.\n"
"\t-w sets the presentation url. Default is http address on port 80\n" "\t-w sets the presentation url. Default is http address on port 80\n"
"\t-V print the version number\n"
"", argv[0], pidfilename); "", argv[0], pidfilename);
return 1; return 1;
} }
@ -554,8 +559,13 @@ init(int argc, char * * argv)
} }
else else
{ {
#ifdef READYNAS
snprintf(presentationurl, PRESENTATIONURL_MAX_LEN,
"https://%s/admin/", lan_addr[0].str);
#else
snprintf(presentationurl, PRESENTATIONURL_MAX_LEN, snprintf(presentationurl, PRESENTATIONURL_MAX_LEN,
"http://%s/", lan_addr[0].str); "http://%s/", lan_addr[0].str);
#endif
} }
/* set signal handler */ /* set signal handler */
@ -609,10 +619,10 @@ main(int argc, char * * argv)
return 1; return 1;
#ifdef READYNAS #ifdef READYNAS
DPRINTF(E_WARN, L_GENERAL, "Starting ReadyDLNA...\n"); DPRINTF(E_WARN, L_GENERAL, "Starting ReadyDLNA version " MINIDLNA_VERSION ".\n");
unlink("/ramfs/.upnp-av_scan"); unlink("/ramfs/.upnp-av_scan");
#else #else
DPRINTF(E_WARN, L_GENERAL, "Starting MiniDLNA...\n"); DPRINTF(E_WARN, L_GENERAL, "Starting MiniDLNA version " MINIDLNA_VERSION ".\n");
#endif #endif
LIST_INIT(&upnphttphead); LIST_INIT(&upnphttphead);

View File

@ -32,7 +32,7 @@ enum client_types {
EXbox = 1, EXbox = 1,
EPS3, EPS3,
ESamsungTV, ESamsungTV,
EUnknownClient EStandardDLNA150 = 100
}; };
struct media_dir_s { struct media_dir_s {

View File

@ -15,6 +15,8 @@
#include <sqlite3.h> #include <sqlite3.h>
#define MINIDLNA_VERSION "1.0.8"
#define CLIENT_CACHE_SLOTS 20 #define CLIENT_CACHE_SLOTS 20
#define USE_FORK 1 #define USE_FORK 1
#define DB_VERSION 1 #define DB_VERSION 1

View File

@ -227,7 +227,7 @@ intervening space) by either an integer or the keyword "infinite". */
} }
else if(strcasestr(p, "DLNADOC/1.50")) else if(strcasestr(p, "DLNADOC/1.50"))
{ {
h->req_client = EUnknownClient; h->req_client = EStandardDLNA150;
h->reqflags |= FLAG_DLNA; h->reqflags |= FLAG_DLNA;
} }
} }
@ -335,7 +335,7 @@ next_header:
break; break;
} }
} }
else if( (n < EUnknownClient) && (h->req_client == EUnknownClient) ) else if( (n < EStandardDLNA150) && (h->req_client == EStandardDLNA150) )
{ {
/* If we know the client, but our new detection is generic, use our cached info */ /* If we know the client, but our new detection is generic, use our cached info */
h->reqflags |= clients[n].flags; h->reqflags |= clients[n].flags;