* Add the ability to change the root media container. (Thanks to Ivan Mironov)

This commit is contained in:
Justin Maggard
2011-06-25 00:39:45 +00:00
parent f6e3e0e8c1
commit 108fda1e84
8 changed files with 76 additions and 12 deletions

View File

@ -376,6 +376,7 @@ init(int argc, char * * argv)
runtime_vars.port = -1;
runtime_vars.notify_interval = 895; /* seconds between SSDP announces */
runtime_vars.root_container = NULL;
/* read options file first since
* command line arguments have final say */
@ -559,6 +560,34 @@ init(int argc, char * * argv)
if( (strcmp(ary_options[i].value, "yes") == 0) || atoi(ary_options[i].value) )
SETFLAG(DLNA_STRICT_MASK);
break;
case ROOT_CONTAINER:
switch( ary_options[i].value[0] )
{
case '.':
runtime_vars.root_container = NULL;
break;
case 'B':
case 'b':
runtime_vars.root_container = BROWSEDIR_ID;
break;
case 'M':
case 'm':
runtime_vars.root_container = MUSIC_ID;
break;
case 'V':
case 'v':
runtime_vars.root_container = VIDEO_ID;
break;
case 'P':
case 'p':
runtime_vars.root_container = IMAGE_ID;
break;
default:
fprintf(stderr, "Invalid root container! [%s]\n",
ary_options[i].value);
break;
}
break;
default:
fprintf(stderr, "Unknown option in file %s\n",
optionsfile);