Edits to accomodate with abstracted semaphore class
This commit is contained in:
parent
ee93e80b8d
commit
10ce807f6f
5 changed files with 80 additions and 54 deletions
75
Doxyfile
75
Doxyfile
|
@ -1,4 +1,4 @@
|
||||||
# Doxyfile 1.8.6
|
# Doxyfile 1.8.7
|
||||||
|
|
||||||
# This file describes the settings to be used by the documentation system
|
# This file describes the settings to be used by the documentation system
|
||||||
# doxygen (www.doxygen.org) for a project.
|
# doxygen (www.doxygen.org) for a project.
|
||||||
|
@ -70,6 +70,14 @@ OUTPUT_DIRECTORY = ./docs
|
||||||
|
|
||||||
CREATE_SUBDIRS = NO
|
CREATE_SUBDIRS = NO
|
||||||
|
|
||||||
|
# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
|
||||||
|
# characters to appear in the names of generated files. If set to NO, non-ASCII
|
||||||
|
# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
|
||||||
|
# U+3044.
|
||||||
|
# The default value is: NO.
|
||||||
|
|
||||||
|
ALLOW_UNICODE_NAMES = NO
|
||||||
|
|
||||||
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
|
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
|
||||||
# documentation generated by doxygen is written. Doxygen will use this
|
# documentation generated by doxygen is written. Doxygen will use this
|
||||||
# information to generate all constant output in the proper language.
|
# information to generate all constant output in the proper language.
|
||||||
|
@ -261,9 +269,12 @@ OPTIMIZE_OUTPUT_VHDL = NO
|
||||||
# extension. Doxygen has a built-in mapping, but you can override or extend it
|
# extension. Doxygen has a built-in mapping, but you can override or extend it
|
||||||
# using this tag. The format is ext=language, where ext is a file extension, and
|
# using this tag. The format is ext=language, where ext is a file extension, and
|
||||||
# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
|
# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
|
||||||
# C#, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL. For instance to make
|
# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:
|
||||||
# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
|
# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:
|
||||||
# (default is Fortran), use: inc=Fortran f=C.
|
# Fortran. In the later case the parser tries to guess whether the code is fixed
|
||||||
|
# or free formatted code, this is the default for Fortran type files), VHDL. For
|
||||||
|
# instance to make doxygen treat .inc files as Fortran files (default is PHP),
|
||||||
|
# and .f files as C (default is Fortran), use: inc=Fortran f=C.
|
||||||
#
|
#
|
||||||
# Note For files without extension you can use no_extension as a placeholder.
|
# Note For files without extension you can use no_extension as a placeholder.
|
||||||
#
|
#
|
||||||
|
@ -778,7 +789,8 @@ RECURSIVE = YES
|
||||||
# Note that relative paths are relative to the directory from which doxygen is
|
# Note that relative paths are relative to the directory from which doxygen is
|
||||||
# run.
|
# run.
|
||||||
|
|
||||||
EXCLUDE = tinythread.cpp tinythread.h
|
EXCLUDE = tinythread.cpp \
|
||||||
|
tinythread.h
|
||||||
|
|
||||||
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
|
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
|
||||||
# directories that are symbolic links (a Unix file system feature) are excluded
|
# directories that are symbolic links (a Unix file system feature) are excluded
|
||||||
|
@ -794,7 +806,8 @@ EXCLUDE_SYMLINKS = NO
|
||||||
# Note that the wildcards are matched against the file with absolute path, so to
|
# Note that the wildcards are matched against the file with absolute path, so to
|
||||||
# exclude all test directories for example use the pattern */test/*
|
# exclude all test directories for example use the pattern */test/*
|
||||||
|
|
||||||
EXCLUDE_PATTERNS = */.git/* */tinythread.*
|
EXCLUDE_PATTERNS = */.git/* \
|
||||||
|
*/tinythread.*
|
||||||
|
|
||||||
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
|
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
|
||||||
# (namespaces, classes, functions, etc.) that should be excluded from the
|
# (namespaces, classes, functions, etc.) that should be excluded from the
|
||||||
|
@ -1230,7 +1243,8 @@ GENERATE_CHI = NO
|
||||||
CHM_INDEX_ENCODING =
|
CHM_INDEX_ENCODING =
|
||||||
|
|
||||||
# The BINARY_TOC flag controls whether a binary table of contents is generated (
|
# The BINARY_TOC flag controls whether a binary table of contents is generated (
|
||||||
# YES) or a normal table of contents ( NO) in the .chm file.
|
# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it
|
||||||
|
# enables the Previous and Next buttons.
|
||||||
# The default value is: NO.
|
# The default value is: NO.
|
||||||
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
|
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
|
||||||
|
|
||||||
|
@ -1470,11 +1484,11 @@ SEARCHENGINE = YES
|
||||||
|
|
||||||
# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
|
# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
|
||||||
# implemented using a web server instead of a web client using Javascript. There
|
# implemented using a web server instead of a web client using Javascript. There
|
||||||
# are two flavours of web server based searching depending on the
|
# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
|
||||||
# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for
|
# setting. When disabled, doxygen will generate a PHP script for searching and
|
||||||
# searching and an index file used by the script. When EXTERNAL_SEARCH is
|
# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
|
||||||
# enabled the indexing and searching needs to be provided by external tools. See
|
# and searching needs to be provided by external tools. See the section
|
||||||
# the section "External Indexing and Searching" for details.
|
# "External Indexing and Searching" for details.
|
||||||
# The default value is: NO.
|
# The default value is: NO.
|
||||||
# This tag requires that the tag SEARCHENGINE is set to YES.
|
# This tag requires that the tag SEARCHENGINE is set to YES.
|
||||||
|
|
||||||
|
@ -1762,6 +1776,13 @@ MAN_OUTPUT = man
|
||||||
|
|
||||||
MAN_EXTENSION = .3
|
MAN_EXTENSION = .3
|
||||||
|
|
||||||
|
# The MAN_SUBDIR tag determines the name of the directory created within
|
||||||
|
# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
|
||||||
|
# MAN_EXTENSION with the initial . removed.
|
||||||
|
# This tag requires that the tag GENERATE_MAN is set to YES.
|
||||||
|
|
||||||
|
MAN_SUBDIR =
|
||||||
|
|
||||||
# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
|
# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
|
||||||
# will generate one additional man file for each entity documented in the real
|
# will generate one additional man file for each entity documented in the real
|
||||||
# man page(s). These additional files only source the real man page, but without
|
# man page(s). These additional files only source the real man page, but without
|
||||||
|
@ -1789,18 +1810,6 @@ GENERATE_XML = NO
|
||||||
|
|
||||||
XML_OUTPUT = xml
|
XML_OUTPUT = xml
|
||||||
|
|
||||||
# The XML_SCHEMA tag can be used to specify a XML schema, which can be used by a
|
|
||||||
# validating XML parser to check the syntax of the XML files.
|
|
||||||
# This tag requires that the tag GENERATE_XML is set to YES.
|
|
||||||
|
|
||||||
XML_SCHEMA =
|
|
||||||
|
|
||||||
# The XML_DTD tag can be used to specify a XML DTD, which can be used by a
|
|
||||||
# validating XML parser to check the syntax of the XML files.
|
|
||||||
# This tag requires that the tag GENERATE_XML is set to YES.
|
|
||||||
|
|
||||||
XML_DTD =
|
|
||||||
|
|
||||||
# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program
|
# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program
|
||||||
# listings (including syntax highlighting and cross-referencing information) to
|
# listings (including syntax highlighting and cross-referencing information) to
|
||||||
# the XML output. Note that enabling this will significantly increase the size
|
# the XML output. Note that enabling this will significantly increase the size
|
||||||
|
@ -1947,9 +1956,9 @@ PREDEFINED =
|
||||||
EXPAND_AS_DEFINED =
|
EXPAND_AS_DEFINED =
|
||||||
|
|
||||||
# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
|
# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
|
||||||
# remove all refrences to function-like macros that are alone on a line, have an
|
# remove all references to function-like macros that are alone on a line, have
|
||||||
# all uppercase name, and do not end with a semicolon. Such function macros are
|
# an all uppercase name, and do not end with a semicolon. Such function macros
|
||||||
# typically used for boiler-plate code, and will confuse the parser if not
|
# are typically used for boiler-plate code, and will confuse the parser if not
|
||||||
# removed.
|
# removed.
|
||||||
# The default value is: YES.
|
# The default value is: YES.
|
||||||
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
|
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
|
||||||
|
@ -1969,7 +1978,7 @@ SKIP_FUNCTION_MACROS = YES
|
||||||
# where loc1 and loc2 can be relative or absolute paths or URLs. See the
|
# where loc1 and loc2 can be relative or absolute paths or URLs. See the
|
||||||
# section "Linking to external documentation" for more information about the use
|
# section "Linking to external documentation" for more information about the use
|
||||||
# of tag files.
|
# of tag files.
|
||||||
# Note: Each tag file must have an unique name (where the name does NOT include
|
# Note: Each tag file must have a unique name (where the name does NOT include
|
||||||
# the path). If a tag file is not located in the directory in which doxygen is
|
# the path). If a tag file is not located in the directory in which doxygen is
|
||||||
# run, you must also specify the path to the tagfile here.
|
# run, you must also specify the path to the tagfile here.
|
||||||
|
|
||||||
|
@ -2061,6 +2070,16 @@ HAVE_DOT = NO
|
||||||
|
|
||||||
DOT_NUM_THREADS = 0
|
DOT_NUM_THREADS = 0
|
||||||
|
|
||||||
|
# When you want a differently looking font n the dot files that doxygen
|
||||||
|
# generates you can specify the font name using DOT_FONTNAME. You need to make
|
||||||
|
# sure dot is able to find the font, which can be done by putting it in a
|
||||||
|
# standard location or by setting the DOTFONTPATH environment variable or by
|
||||||
|
# setting DOT_FONTPATH to the directory containing the font.
|
||||||
|
# The default value is: Helvetica.
|
||||||
|
# This tag requires that the tag HAVE_DOT is set to YES.
|
||||||
|
|
||||||
|
DOT_FONTNAME = Helvetica
|
||||||
|
|
||||||
# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
|
# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
|
||||||
# dot graphs.
|
# dot graphs.
|
||||||
# Minimum value: 4, maximum value: 24, default value: 10.
|
# Minimum value: 4, maximum value: 24, default value: 10.
|
||||||
|
|
|
@ -114,7 +114,11 @@ namespace Mist {
|
||||||
}else{
|
}else{
|
||||||
//after this player functionality
|
//after this player functionality
|
||||||
|
|
||||||
metaPage.init(config->getString("streamname"), (isBuffer ? 8388608 : myMeta.getSendLen()), true);
|
#ifdef __CYGWIN__
|
||||||
|
metaPage.init(config->getString("streamname"), 8 * 1024 * 1024, true);
|
||||||
|
#else
|
||||||
|
metaPage.init(config->getString("streamname"), (isBuffer ? 8 * 1024 * 1024 : myMeta.getSendLen()), true);
|
||||||
|
#endif
|
||||||
myMeta.writeTo(metaPage.mapped);
|
myMeta.writeTo(metaPage.mapped);
|
||||||
userPage.init(config->getString("streamname") + "_users", 30, true);
|
userPage.init(config->getString("streamname") + "_users", 30, true);
|
||||||
|
|
||||||
|
@ -125,13 +129,13 @@ namespace Mist {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sem_t * waiting = sem_open(std::string("/wait_" + config->getString("streamname")).c_str(), O_CREAT | O_RDWR, ACCESSPERMS, 0);
|
IPC::semaphore waiting(std::string("/wait_" + config->getString("streamname")).c_str(), O_CREAT | O_RDWR, ACCESSPERMS, 0);
|
||||||
if (waiting == SEM_FAILED){
|
if (!waiting){
|
||||||
DEBUG_MSG(DLVL_FAIL, "Failed to open semaphore - cancelling");
|
DEBUG_MSG(DLVL_FAIL, "Failed to open semaphore - cancelling");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
sem_post(waiting);
|
waiting.post();
|
||||||
sem_close(waiting);
|
waiting.close();
|
||||||
|
|
||||||
DEBUG_MSG(DLVL_HIGH,"Pre-While");
|
DEBUG_MSG(DLVL_HIGH,"Pre-While");
|
||||||
|
|
||||||
|
@ -213,10 +217,10 @@ namespace Mist {
|
||||||
|
|
||||||
char tmpId[20];
|
char tmpId[20];
|
||||||
sprintf(tmpId, "%d", tid);
|
sprintf(tmpId, "%d", tid);
|
||||||
indexPages[tid].init(config->getString("streamname") + tmpId, 8192, true);//Pages of 8kb in size, room for 512 parts.
|
indexPages[tid].init(config->getString("streamname") + tmpId, 8 * 1024, true);//Pages of 8kb in size, room for 512 parts.
|
||||||
}
|
}
|
||||||
if (myMeta.tracks[tid].keys[bookKeeping[tid].curKey].getParts() == curData[tid].partNum){
|
if (myMeta.tracks[tid].keys[bookKeeping[tid].curKey].getParts() == curData[tid].partNum){
|
||||||
if (curData[tid].dataSize > 8388608) {
|
if (curData[tid].dataSize > 8 * 1024 * 1024) {
|
||||||
pagesByTrack[tid][bookKeeping[tid].first] = curData[tid];
|
pagesByTrack[tid][bookKeeping[tid].first] = curData[tid];
|
||||||
bookKeeping[tid].first += curData[tid].keyNum;
|
bookKeeping[tid].first += curData[tid].keyNum;
|
||||||
curData[tid].keyNum = 0;
|
curData[tid].keyNum = 0;
|
||||||
|
@ -267,7 +271,11 @@ namespace Mist {
|
||||||
char pageId[100];
|
char pageId[100];
|
||||||
int pageIdLen = sprintf(pageId, "%s%d_%d", config->getString("streamname").c_str(), track, pageNum);
|
int pageIdLen = sprintf(pageId, "%s%d_%d", config->getString("streamname").c_str(), track, pageNum);
|
||||||
std::string tmpString(pageId, pageIdLen);
|
std::string tmpString(pageId, pageIdLen);
|
||||||
|
#ifdef __CYGWIN__
|
||||||
|
dataPages[track][pageNum].init(tmpString, 26 * 1024 * 1024, true);
|
||||||
|
#else
|
||||||
dataPages[track][pageNum].init(tmpString, it->second.dataSize, true);
|
dataPages[track][pageNum].init(tmpString, it->second.dataSize, true);
|
||||||
|
#endif
|
||||||
DEBUG_MSG(DLVL_DEVEL, "Buffering track %d page %d through %d", track, pageNum, pageNum-1 + it->second.keyNum);
|
DEBUG_MSG(DLVL_DEVEL, "Buffering track %d page %d through %d", track, pageNum, pageNum-1 + it->second.keyNum);
|
||||||
|
|
||||||
std::stringstream trackSpec;
|
std::stringstream trackSpec;
|
||||||
|
|
|
@ -14,8 +14,8 @@ int main(int argc, char * argv[]) {
|
||||||
Util::Config conf(argv[0], PACKAGE_VERSION);
|
Util::Config conf(argv[0], PACKAGE_VERSION);
|
||||||
mistIn conv(&conf);
|
mistIn conv(&conf);
|
||||||
if (conf.parseArgs(argc, argv)) {
|
if (conf.parseArgs(argc, argv)) {
|
||||||
sem_t * playerLock = sem_open(std::string("/lock_" + conf.getString("streamname")).c_str(), O_CREAT | O_RDWR, ACCESSPERMS, 1);
|
IPC::semaphore playerLock(std::string("/lock_" + conf.getString("streamname")).c_str(), O_CREAT | O_RDWR, ACCESSPERMS, 1);
|
||||||
if (sem_trywait(playerLock) == -1){
|
if (!playerLock.tryWait()){
|
||||||
DEBUG_MSG(DLVL_DEVEL, "A player for stream %s is already running", conf.getString("streamname").c_str());
|
DEBUG_MSG(DLVL_DEVEL, "A player for stream %s is already running", conf.getString("streamname").c_str());
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -23,30 +23,29 @@ int main(int argc, char * argv[]) {
|
||||||
while (conf.is_active){
|
while (conf.is_active){
|
||||||
int pid = fork();
|
int pid = fork();
|
||||||
if (pid == 0){
|
if (pid == 0){
|
||||||
sem_close(playerLock);
|
playerLock.close();
|
||||||
return conv.run();
|
return conv.run();
|
||||||
}
|
}
|
||||||
if (pid == -1){
|
if (pid == -1){
|
||||||
DEBUG_MSG(DLVL_FAIL, "Unable to spawn player process");
|
DEBUG_MSG(DLVL_FAIL, "Unable to spawn player process");
|
||||||
sem_post(playerLock);
|
playerLock.post();
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
//wait for the process to exit
|
//wait for the process to exit
|
||||||
int status;
|
int status;
|
||||||
while (waitpid(pid, &status, 0) != pid && errno == EINTR) continue;
|
while (waitpid(pid, &status, 0) != pid && errno == EINTR) continue;
|
||||||
//clean up the semaphore by waiting for it, if it's non-zero
|
//clean up the semaphore by waiting for it, if it's non-zero
|
||||||
sem_t * waiting = sem_open(std::string("/wait_" + conf.getString("streamname")).c_str(), O_CREAT | O_RDWR, ACCESSPERMS, 0);
|
IPC::semaphore waiting(std::string("/wait_" + conf.getString("streamname")).c_str(), O_CREAT | O_RDWR, ACCESSPERMS, 0);
|
||||||
if (waiting == SEM_FAILED){
|
if (!waiting){
|
||||||
DEBUG_MSG(DLVL_FAIL, "Failed to open semaphore - cancelling");
|
DEBUG_MSG(DLVL_FAIL, "Failed to open semaphore - cancelling");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
int sem_val = 0;
|
int sem_val = waiting.getVal();
|
||||||
sem_getvalue(waiting, &sem_val);
|
|
||||||
while (sem_val){
|
while (sem_val){
|
||||||
while (sem_wait(waiting) == -1 && errno == EINTR) continue;
|
waiting.wait();
|
||||||
sem_getvalue(waiting, &sem_val);
|
sem_val = waiting.getVal();
|
||||||
}
|
}
|
||||||
sem_close(waiting);
|
waiting.close();
|
||||||
//if the exit was clean, don't restart it
|
//if the exit was clean, don't restart it
|
||||||
if (WIFEXITED(status) && (WEXITSTATUS(status) == 0)){
|
if (WIFEXITED(status) && (WEXITSTATUS(status) == 0)){
|
||||||
DEBUG_MSG(DLVL_MEDIUM, "Finished player succesfully");
|
DEBUG_MSG(DLVL_MEDIUM, "Finished player succesfully");
|
||||||
|
@ -57,8 +56,8 @@ int main(int argc, char * argv[]) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sem_post(playerLock);
|
playerLock.post();
|
||||||
sem_close(playerLock);
|
playerLock.close();
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,7 @@ namespace Mist {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
isInitialized = true;
|
isInitialized = true;
|
||||||
streamIndex.init(streamName,0);
|
streamIndex.init(streamName,8 * 1024 * 1024);
|
||||||
if (!streamIndex.mapped){
|
if (!streamIndex.mapped){
|
||||||
DEBUG_MSG(DLVL_FAIL, "Could not connect to server for %s\n", streamName.c_str());
|
DEBUG_MSG(DLVL_FAIL, "Could not connect to server for %s\n", streamName.c_str());
|
||||||
onFail();
|
onFail();
|
||||||
|
@ -239,7 +239,7 @@ namespace Mist {
|
||||||
if (!indexPages.count(trackId)){
|
if (!indexPages.count(trackId)){
|
||||||
char id[100];
|
char id[100];
|
||||||
sprintf(id, "%s%lu", streamName.c_str(), trackId);
|
sprintf(id, "%s%lu", streamName.c_str(), trackId);
|
||||||
indexPages[trackId].init(id, 8192);
|
indexPages[trackId].init(id, 8 * 1024);
|
||||||
}
|
}
|
||||||
while (pageNum == -1 || keyAmount == -1){
|
while (pageNum == -1 || keyAmount == -1){
|
||||||
for (int i = 0; i < indexPages[trackId].len / 8; i++){
|
for (int i = 0; i < indexPages[trackId].len / 8; i++){
|
||||||
|
@ -285,7 +285,7 @@ namespace Mist {
|
||||||
}
|
}
|
||||||
char id[100];
|
char id[100];
|
||||||
sprintf(id, "%s%lu_%d", streamName.c_str(), trackId, pageNum);
|
sprintf(id, "%s%lu_%d", streamName.c_str(), trackId, pageNum);
|
||||||
curPages[trackId].init(std::string(id),0);
|
curPages[trackId].init(std::string(id),26 * 1024 * 1024);
|
||||||
if (!(curPages[trackId].mapped)){
|
if (!(curPages[trackId].mapped)){
|
||||||
DEBUG_MSG(DLVL_FAIL, "Initializing page %s failed", curPages[trackId].name.c_str());
|
DEBUG_MSG(DLVL_FAIL, "Initializing page %s failed", curPages[trackId].name.c_str());
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -609,7 +609,7 @@ namespace Mist {
|
||||||
//open new page
|
//open new page
|
||||||
char nextPage[100];
|
char nextPage[100];
|
||||||
sprintf(nextPage, "%s%llu_%d", streamName.c_str(), tNum, bookKeeping[tNum].pageNum + bookKeeping[tNum].keyNum);
|
sprintf(nextPage, "%s%llu_%d", streamName.c_str(), tNum, bookKeeping[tNum].pageNum + bookKeeping[tNum].keyNum);
|
||||||
curPages[tNum].init(nextPage, 0, false);
|
curPages[tNum].init(nextPage, 26 * 1024 * 1024);
|
||||||
bookKeeping[tNum].pageNum += bookKeeping[tNum].keyNum;
|
bookKeeping[tNum].pageNum += bookKeeping[tNum].keyNum;
|
||||||
bookKeeping[tNum].keyNum = 0;
|
bookKeeping[tNum].keyNum = 0;
|
||||||
bookKeeping[tNum].curOffset = 0;
|
bookKeeping[tNum].curOffset = 0;
|
||||||
|
@ -667,7 +667,7 @@ namespace Mist {
|
||||||
for (std::map<int, int>::iterator it = trackMap.begin(); it != trackMap.end(); it++){
|
for (std::map<int, int>::iterator it = trackMap.begin(); it != trackMap.end(); it++){
|
||||||
char tmp[100];
|
char tmp[100];
|
||||||
sprintf( tmp, "liveStream_%s%d", streamName.c_str(), it->second);
|
sprintf( tmp, "liveStream_%s%d", streamName.c_str(), it->second);
|
||||||
metaPages[it->second].init(std::string(tmp), 0, false);
|
metaPages[it->second].init(std::string(tmp), 8 * 1024 * 1024);
|
||||||
DTSC::Meta tmpMeta = meta_out;
|
DTSC::Meta tmpMeta = meta_out;
|
||||||
tmpMeta.tracks.clear();
|
tmpMeta.tracks.clear();
|
||||||
tmpMeta.tracks[it->second] = meta_out.tracks[it->first];
|
tmpMeta.tracks[it->second] = meta_out.tracks[it->first];
|
||||||
|
@ -719,7 +719,7 @@ namespace Mist {
|
||||||
}else{
|
}else{
|
||||||
char firstPage[100];
|
char firstPage[100];
|
||||||
sprintf(firstPage, "%s%lu_%d", streamName.c_str(), tNum, 0);
|
sprintf(firstPage, "%s%lu_%d", streamName.c_str(), tNum, 0);
|
||||||
curPages[tNum].init(firstPage, 0, false);
|
curPages[tNum].init(firstPage, 8 * 1024 * 1024);
|
||||||
bookKeeping[tNum] = DTSCPageData();
|
bookKeeping[tNum] = DTSCPageData();
|
||||||
DEBUG_MSG(DLVL_WARN, "Buffer accepted track %lu", tNum);
|
DEBUG_MSG(DLVL_WARN, "Buffer accepted track %lu", tNum);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue