diff --git a/campcaster/src/modules/storageClient/src/WebStorageClient.cxx b/campcaster/src/modules/storageClient/src/WebStorageClient.cxx index 092a0a929..63a1b03af 100644 --- a/campcaster/src/modules/storageClient/src/WebStorageClient.cxx +++ b/campcaster/src/modules/storageClient/src/WebStorageClient.cxx @@ -1302,11 +1302,13 @@ WebStorageClient :: getPlaylist(Ptr::Ref sessionId, playlist->configure(*root); } catch (std::invalid_argument &e) { - throw XmlRpcInvalidDataException( - "semantic error in playlist metafile"); + std::string eMsg = "semantic error in playlist metafile: "; + eMsg += e.what(); + throw XmlRpcInvalidDataException(eMsg); } catch (xmlpp::exception &e) { - throw XmlRpcInvalidDataException( - "error parsing playlist metafile"); + std::string eMsg = "error parsing playlist metafile: "; + eMsg += e.what(); + throw XmlRpcInvalidDataException(eMsg); } playlist->setToken(token); @@ -1344,11 +1346,13 @@ WebStorageClient :: editPlaylist(Ptr::Ref sessionId, playlist->configure(*root); } catch (std::invalid_argument &e) { - throw XmlRpcMethodResponseException( - "semantic error in playlist metafile"); + std::string eMsg = "semantic error in playlist metafile: "; + eMsg += e.what(); + throw XmlRpcInvalidDataException(eMsg); } catch (xmlpp::exception &e) { - throw XmlRpcMethodResponseException( - "error parsing playlist metafile"); + std::string eMsg = "error parsing playlist metafile: "; + eMsg += e.what(); + throw XmlRpcInvalidDataException(eMsg); } playlist->setEditToken(editToken); @@ -1541,11 +1545,13 @@ WebStorageClient :: acquirePlaylist(Ptr::Ref id, playlist->configure(*root); } catch (std::invalid_argument &e) { - throw XmlRpcInvalidDataException( - "semantic error in playlist metafile"); + std::string eMsg = "semantic error in playlist metafile: "; + eMsg += e.what(); + throw XmlRpcInvalidDataException(eMsg); } catch (xmlpp::exception &e) { - throw XmlRpcInvalidDataException( - "error parsing playlist metafile"); + std::string eMsg = "error parsing playlist metafile: "; + eMsg += e.what(); + throw XmlRpcInvalidDataException(eMsg); } // read the content array corresponding to the playlist @@ -1885,11 +1891,11 @@ WebStorageClient :: getAudioClip(Ptr::Ref sessionId, audioClip->configure(*root); } catch (std::invalid_argument &e) { - std::string eMsg = "semantic error in audio clip metafile:\n"; + std::string eMsg = "semantic error in audio clip metafile: "; eMsg += e.what(); throw XmlRpcInvalidDataException(eMsg); } catch (xmlpp::exception &e) { - std::string eMsg = "error parsing audio clip metafile"; + std::string eMsg = "error parsing audio clip metafile: "; eMsg += e.what(); throw XmlRpcInvalidDataException(eMsg); } diff --git a/campcaster/src/products/gLiveSupport/src/GLiveSupport.cxx b/campcaster/src/products/gLiveSupport/src/GLiveSupport.cxx index eeb9d79c6..734ca9a2b 100644 --- a/campcaster/src/products/gLiveSupport/src/GLiveSupport.cxx +++ b/campcaster/src/products/gLiveSupport/src/GLiveSupport.cxx @@ -736,8 +736,12 @@ GLiveSupport :: getAudioClip(Ptr::Ref id) { Ptr::Ref clip; - clip = (*openedAudioClips)[id->getId()]; - if (!clip.get()) { + AudioClipMap::iterator it = openedAudioClips->find(id->getId()); + if (it != openedAudioClips->end()) { + clip = it->second; + } + + if (!clip || !clip->getToken()) { clip = storage->getAudioClip(sessionId, id); (*openedAudioClips)[id->getId()] = clip; } @@ -757,8 +761,10 @@ GLiveSupport :: acquireAudioClip(Ptr::Ref id) { Ptr::Ref clip; - clip = (*openedAudioClips)[id->getId()]; - if (!clip.get() || !clip->getToken().get()) { + AudioClipMap::iterator it = openedAudioClips->find(id->getId()); + if (it != openedAudioClips->end()) { + clip = it->second; + } else { clip = storage->acquireAudioClip(sessionId, id); (*openedAudioClips)[id->getId()] = clip; } @@ -778,8 +784,10 @@ GLiveSupport :: getPlaylist(Ptr::Ref id) { Ptr::Ref playlist; - playlist = (*openedPlaylists)[id->getId()]; - if (!playlist.get()) { + PlaylistMap::iterator it = openedPlaylists->find(id->getId()); + if (it != openedPlaylists->end()) { + playlist = it->second; + } else { playlist = storage->getPlaylist(sessionId, id); (*openedPlaylists)[id->getId()] = playlist; } @@ -799,8 +807,12 @@ GLiveSupport :: acquirePlaylist(Ptr::Ref id) { Ptr::Ref playlist; - playlist = (*openedPlaylists)[id->getId()]; - if (!playlist.get() || !playlist->getUri().get()) { + PlaylistMap::iterator it = openedPlaylists->find(id->getId()); + if (it != openedPlaylists->end()) { + playlist = it->second; + } + + if (!playlist || !playlist->getUri()) { playlist = storage->acquirePlaylist(sessionId, id); (*openedPlaylists)[id->getId()] = playlist; } @@ -827,7 +839,7 @@ GLiveSupport :: getPlayable(Ptr::Ref id) } else { throw XmlRpcInvalidArgumentException( - "invalid ID in GLiveSupport::acquirePlayable"); + "invalid ID in GLiveSupport::getPlayable"); } return playable; @@ -873,7 +885,7 @@ GLiveSupport :: uncachePlaylist(Ptr::Ref id) if ((it = openedPlaylists->find(id->getId())) != end) { playlist = (*openedPlaylists)[id->getId()]; - if (playlist->getUri().get()) { + if (playlist->getUri()) { storage->releasePlaylist(playlist); } @@ -893,7 +905,7 @@ GLiveSupport :: releaseOpenedAudioClips(void) throw (XmlRpcException) AudioClipMap::iterator end = openedAudioClips->end(); while (it != end) { - Ptr::Ref clip = (*it).second; + Ptr::Ref clip = it->second; if (clip->getToken().get()) { storage->releaseAudioClip(clip); @@ -917,9 +929,9 @@ GLiveSupport :: releaseOpenedPlaylists(void) throw (XmlRpcException) PlaylistMap::iterator end = openedPlaylists->end(); while (it != end) { - Ptr::Ref playlist = (*it).second; + Ptr::Ref playlist = it->second; - if (playlist->getUri().get()) { + if (playlist->getUri()) { storage->releasePlaylist(playlist); }