Commit 53c3e79c authored by Damien Lucas's avatar Damien Lucas

optims

parent af0df274
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* filereader.cpp: file reader * filereader.cpp: file reader
*------------------------------------------------------------------------------- *-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN * (c)1999-2001 VideoLAN
* $Id: filereader.cpp,v 1.7 2003/07/31 14:46:36 nitrox Exp $ * $Id: filereader.cpp,v 1.8 2003/08/08 15:57:50 nitrox Exp $
* *
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr> * Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
* *
...@@ -153,8 +153,7 @@ s64 C_FileMpegReader::Seek(s64 iOffset, s64 bStartPos) ...@@ -153,8 +153,7 @@ s64 C_FileMpegReader::Seek(s64 iOffset, s64 bStartPos)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
s64 C_FileMpegReader::Size() s64 C_FileMpegReader::Size()
{ {
ASSERT(false); return m_cFile.Size();
return 0;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* admin.cpp: * admin.cpp:
*------------------------------------------------------------------------------- *-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN * (c)1999-2001 VideoLAN
* $Id: admin.cpp,v 1.27 2003/08/05 12:28:46 nitrox Exp $ * $Id: admin.cpp,v 1.28 2003/08/08 15:57:50 nitrox Exp $
* *
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr> * Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
* *
...@@ -419,7 +419,7 @@ int C_Admin::Init() ...@@ -419,7 +419,7 @@ int C_Admin::Init()
pCmdDesc->BuildUsage(); pCmdDesc->BuildUsage();
m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc); m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc);
// -- resume <channel> // -- resume <channel>
pCmdDesc = new C_CommandDesc("resume", pCmdDesc = new C_CommandDesc("broadcast_resume",
"resumes streaming.", "resumes streaming.",
"\"resume\" resumes the specified broadcast."); "\"resume\" resumes the specified broadcast.");
pStr = new C_String("broadcast"); pStr = new C_String("broadcast");
...@@ -427,7 +427,7 @@ int C_Admin::Init() ...@@ -427,7 +427,7 @@ int C_Admin::Init()
pCmdDesc->BuildUsage(); pCmdDesc->BuildUsage();
m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc); m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc);
// -- suspend <channel> // -- suspend <channel>
pCmdDesc = new C_CommandDesc("suspend", pCmdDesc = new C_CommandDesc("broadcast_suspend",
"suspends streaming.", "suspends streaming.",
"\"suspend\" suspends the specified broadcast."); "\"suspend\" suspends the specified broadcast.");
pStr = new C_String("broadcast"); pStr = new C_String("broadcast");
...@@ -435,7 +435,7 @@ int C_Admin::Init() ...@@ -435,7 +435,7 @@ int C_Admin::Init()
pCmdDesc->BuildUsage(); pCmdDesc->BuildUsage();
m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc); m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc);
// -- forward <channel> <speed> // -- forward <channel> <speed>
pCmdDesc = new C_CommandDesc("forward", pCmdDesc = new C_CommandDesc("broadcast_forward",
"forwards streaming.", "forwards streaming.",
"\"forward\" forward the specified broadcast with the" "\"forward\" forward the specified broadcast with the"
" desired speed [0..N]."); " desired speed [0..N].");
...@@ -446,7 +446,7 @@ int C_Admin::Init() ...@@ -446,7 +446,7 @@ int C_Admin::Init()
pCmdDesc->BuildUsage(); pCmdDesc->BuildUsage();
m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc); m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc);
// -- rewind <channel> <speed> // -- rewind <channel> <speed>
pCmdDesc = new C_CommandDesc("rewind", pCmdDesc = new C_CommandDesc("broadcast_rewind",
"rewinds streaming.", "rewinds streaming.",
"\"rewind\" rewind the specified broadcast with the" "\"rewind\" rewind the specified broadcast with the"
" desired speed [0..N]."); " desired speed [0..N].");
...@@ -457,13 +457,13 @@ int C_Admin::Init() ...@@ -457,13 +457,13 @@ int C_Admin::Init()
pCmdDesc->BuildUsage(); pCmdDesc->BuildUsage();
m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc); m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc);
// -- stop <channel> // -- stop <channel>
// pCmdDesc = new C_CommandDesc("stop", pCmdDesc = new C_CommandDesc("broadcast_stop",
// "stops a program.", "stops a program.",
// "\"stop\" ends the specified broadcast."); "\"stop\" ends the specified broadcast.");
// pStr = new C_String("broadcast"); pStr = new C_String("broadcast");
// pCmdDesc->m_vMandatoryArgs.Add(pStr); pCmdDesc->m_vMandatoryArgs.Add(pStr);
// pCmdDesc->BuildUsage(); pCmdDesc->BuildUsage();
// m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc); m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc);
// -- shutdown // -- shutdown
pCmdDesc = new C_CommandDesc("shutdown", pCmdDesc = new C_CommandDesc("shutdown",
"stops the server.", "stops the server.",
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* manager.cpp: Vls manager * manager.cpp: Vls manager
*------------------------------------------------------------------------------- *-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN * (c)1999-2001 VideoLAN
* $Id: manager.cpp,v 1.37 2003/08/05 23:18:19 nitrox Exp $ * $Id: manager.cpp,v 1.38 2003/08/08 15:57:50 nitrox Exp $
* *
* Authors: Benoit Steiner <benny@via.ecp.fr> * Authors: Benoit Steiner <benny@via.ecp.fr>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr> * Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
...@@ -475,9 +475,12 @@ void C_Manager::StopPrograms() ...@@ -475,9 +475,12 @@ void C_Manager::StopPrograms()
while(cIterator1.HasNextItem()) while(cIterator1.HasNextItem())
{ {
C_Broadcast* pBroadcast = cIterator1.GetNextItem(); C_Broadcast* pBroadcast = cIterator1.GetNextItem();
C_Request* pRequest = new C_Request("broadcast_stop"); if(pBroadcast->GetStatus()!=BROADCAST_WAITING)
pRequest->SetArg("broadcast", pBroadcast->GetChannel()->GetName()); {
cRequests.Add(pRequest); C_Request* pRequest = new C_Request("broadcast_stop");
pRequest->SetArg("broadcast", pBroadcast->GetChannel()->GetName());
cRequests.Add(pRequest);
}
} }
m_cBroadcastsList.UnLock(); m_cBroadcastsList.UnLock();
...@@ -489,7 +492,7 @@ void C_Manager::StopPrograms() ...@@ -489,7 +492,7 @@ void C_Manager::StopPrograms()
HandleRequest(cRequest); HandleRequest(cRequest);
LogDbg(m_hLog, "Remove the broadcast"); LogDbg(m_hLog, "Remove the broadcast");
m_cBroadcastsList.Lock(); m_cBroadcastsList.Lock();
#ifdef DEBUG #ifdef DEBUG
int iRc = m_cBroadcastsList.Remove(cRequest.GetArg("program") + ":" + int iRc = m_cBroadcastsList.Remove(cRequest.GetArg("program") + ":" +
cRequest.GetArg("input")); cRequest.GetArg("input"));
#else #else
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* manager.h: Manager class definition * manager.h: Manager class definition
*------------------------------------------------------------------------------- *-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN * (c)1999-2001 VideoLAN
* $Id: manager.h,v 1.8 2003/08/05 12:28:46 nitrox Exp $ * $Id: manager.h,v 1.9 2003/08/08 15:57:50 nitrox Exp $
* *
* Authors: Benoit Steiner <benny@via.ecp.fr> * Authors: Benoit Steiner <benny@via.ecp.fr>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr> * Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
...@@ -105,19 +105,20 @@ private: ...@@ -105,19 +105,20 @@ private:
C_Semaphore m_cEventQueued; C_Semaphore m_cEventQueued;
C_Vector<C_Event> m_cEventFifo; C_Vector<C_Event> m_cEventFifo;
// Running broadcasts
C_Repository<C_String, C_Broadcast> m_cBroadcastsList;
// Ressources // Ressources
C_Repository<C_String, C_Input> m_cInputList; C_Repository<C_String, C_Input> m_cInputList;
C_Repository<C_String, C_Channel> m_cChannelList; C_Repository<C_String, C_Channel> m_cChannelList;
//Functions //Functions
// C_Answer (C_Manager::**m_cFunctionsTable)(const C_Request&); //C_Answer (C_Manager::**m_cFunctionsTable)(const C_Request&);
C_HashTable<C_String, C_Answer (C_Manager::*)(const C_Request&)> m_cFunctions; C_HashTable<C_String, C_Answer (C_Manager::*)(const C_Request&)> m_cFunctions;
// Programs // Programs
C_PgrmDirectory m_cProgramList; C_PgrmDirectory m_cProgramList;
// Running broadcasts
C_Repository<C_String, C_Broadcast> m_cBroadcastsList;
}; };
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* manager_broadcast.cpp: Brodacast mtehods for Vls manager * manager_broadcast.cpp: Brodacast mtehods for Vls manager
*------------------------------------------------------------------------------- *-------------------------------------------------------------------------------
* (c)1999-2003 VideoLAN * (c)1999-2003 VideoLAN
* $Id: manager_broadcast.cpp,v 1.2 2003/08/05 12:28:46 nitrox Exp $ * $Id: manager_broadcast.cpp,v 1.3 2003/08/08 15:57:50 nitrox Exp $
* *
* Authors: Damien Lucas <damien.lucas@anevia.com> * Authors: Damien Lucas <damien.lucas@anevia.com>
* Benoit Steiner <benny@via.ecp.fr> * Benoit Steiner <benny@via.ecp.fr>
...@@ -74,10 +74,10 @@ C_Broadcast* C_Manager::CreateBroadcast(C_String& strName, ...@@ -74,10 +74,10 @@ C_Broadcast* C_Manager::CreateBroadcast(C_String& strName,
m_cBroadcastsList.Add(strName, pBroadcast); m_cBroadcastsList.Add(strName, pBroadcast);
m_cBroadcastsList.UnLock(); m_cBroadcastsList.UnLock();
} }
else if(pInput) if ( pInput ) m_cInputList.Release(strInput);
{ if ( pChannel ) m_cChannelList.Release(strChannel);
m_cInputList.Release(strInput); if ( pPgrm ) m_cProgramList.ReleasePgrm(strPgrm);
}
return pBroadcast; return pBroadcast;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* repository.h: Repository class definition * repository.h: Repository class definition
*------------------------------------------------------------------------------- *-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN * (c)1999-2001 VideoLAN
* $Id: repository.h,v 1.4 2003/08/05 23:18:19 nitrox Exp $ * $Id: repository.h,v 1.5 2003/08/08 15:57:50 nitrox Exp $
* *
* Authors: Benoit Steiner <benny@via.ecp.fr> * Authors: Benoit Steiner <benny@via.ecp.fr>
* *
...@@ -53,7 +53,6 @@ template <class T> class C_RepositoryItem ...@@ -53,7 +53,6 @@ template <class T> class C_RepositoryItem
~C_RepositoryItem() ~C_RepositoryItem()
{ {
//printf("<item> m_iRefCounter: %d\n", m_iRefCounter);
ASSERT(m_iRefCounter == 0); ASSERT(m_iRefCounter == 0);
delete m_pItem; delete m_pItem;
} }
......
...@@ -17,7 +17,7 @@ BEGIN "Groups" ...@@ -17,7 +17,7 @@ BEGIN "Groups"
# groupname = "cmd1|cmd2|..." # groupname = "cmd1|cmd2|..."
# --- Example: # --- Example:
monitor = "help|browse|logout" monitor = "help|browse|logout"
master = "help|browse|start|resume|suspend|stop|shutdown|logout|config|program|input|channel|show|broadcast_ls|broadcast_add|broadcast_del" master = "cd|ls|help|browse|start|broadcast_resume|broadcast_suspend|broadcast_stop|shutdown|logout|config|program|input|channel|show|broadcast_ls|broadcast_add|broadcast_del|channel_add|broadcast_start"
END END
# The section "Users" describes each user # The section "Users" describes each user
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment