diff --git a/src/MediaServer/MediaServer.cpp b/src/MediaServer/MediaServer.cpp index 186bd59..0c74132 100644 --- a/src/MediaServer/MediaServer.cpp +++ b/src/MediaServer/MediaServer.cpp @@ -204,17 +204,23 @@ void MediaServer::unloadVideo(string & path){ } // Reference count 0 or less, let's unload the video ofLogNotice("MediaServer") << "Removing video " << path; + // Distroy video source if(loadedSources.count(path)){ - ofLogNotice("MediaServer") << "Source count before video removal: " << loadedSources.size() << endl; + ofLogNotice("MediaServer") + << "Source count before video removal: " + << loadedSources.size() << endl; videoSource->clear(); map ::iterator it = loadedSources.find(path); delete it->second; loadedSources.erase(it); - ofLogNotice("MediaServer") << "Source count after video removal: " << loadedSources.size() << endl; + ofLogNotice("MediaServer") + << "Source count after video removal: " + << loadedSources.size() << endl; ofNotifyEvent(onVideoUnloaded, path, this); return; } + // Something wrong here, we should be out of the routine by now stringstream failss; failss << "Failed to remove video source: " << path;