Fixed reconnect() sometimes segfaulting for live streams on first attempt.
This commit is contained in:
parent
4f5004e2f7
commit
254fb94b62
1 changed files with 8 additions and 3 deletions
|
@ -75,11 +75,16 @@ namespace Mist {
|
||||||
//read metadata from page to myMeta variable
|
//read metadata from page to myMeta variable
|
||||||
if (nProxy.metaPages[0].mapped){
|
if (nProxy.metaPages[0].mapped){
|
||||||
IPC::semaphore * liveSem = 0;
|
IPC::semaphore * liveSem = 0;
|
||||||
if (myMeta.live){
|
if (!myMeta.vod){
|
||||||
static char liveSemName[NAME_BUFFER_SIZE];
|
static char liveSemName[NAME_BUFFER_SIZE];
|
||||||
snprintf(liveSemName, NAME_BUFFER_SIZE, SEM_LIVE, streamName.c_str());
|
snprintf(liveSemName, NAME_BUFFER_SIZE, SEM_LIVE, streamName.c_str());
|
||||||
liveSem = new IPC::semaphore(liveSemName, O_CREAT | O_RDWR, ACCESSPERMS, 1);
|
liveSem = new IPC::semaphore(liveSemName, O_RDWR, ACCESSPERMS, 1);
|
||||||
|
if (*liveSem){
|
||||||
liveSem->wait();
|
liveSem->wait();
|
||||||
|
}else{
|
||||||
|
delete liveSem;
|
||||||
|
liveSem = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
DTSC::Packet tmpMeta(nProxy.metaPages[0].mapped, nProxy.metaPages[0].len, true);
|
DTSC::Packet tmpMeta(nProxy.metaPages[0].mapped, nProxy.metaPages[0].len, true);
|
||||||
if (tmpMeta.getVersion()){
|
if (tmpMeta.getVersion()){
|
||||||
|
|
Loading…
Add table
Reference in a new issue