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

optims

parent af0df274
......@@ -2,7 +2,7 @@
* filereader.cpp: file reader
*-------------------------------------------------------------------------------
* (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>
*
......@@ -153,8 +153,7 @@ s64 C_FileMpegReader::Seek(s64 iOffset, s64 bStartPos)
//------------------------------------------------------------------------------
s64 C_FileMpegReader::Size()
{
ASSERT(false);
return 0;
return m_cFile.Size();
}
......
......@@ -2,7 +2,7 @@
* admin.cpp:
*-------------------------------------------------------------------------------
* (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>
*
......@@ -419,7 +419,7 @@ int C_Admin::Init()
pCmdDesc->BuildUsage();
m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc);
// -- resume <channel>
pCmdDesc = new C_CommandDesc("resume",
pCmdDesc = new C_CommandDesc("broadcast_resume",
"resumes streaming.",
"\"resume\" resumes the specified broadcast.");
pStr = new C_String("broadcast");
......@@ -427,7 +427,7 @@ int C_Admin::Init()
pCmdDesc->BuildUsage();
m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc);
// -- suspend <channel>
pCmdDesc = new C_CommandDesc("suspend",
pCmdDesc = new C_CommandDesc("broadcast_suspend",
"suspends streaming.",
"\"suspend\" suspends the specified broadcast.");
pStr = new C_String("broadcast");
......@@ -435,7 +435,7 @@ int C_Admin::Init()
pCmdDesc->BuildUsage();
m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc);
// -- forward <channel> <speed>
pCmdDesc = new C_CommandDesc("forward",
pCmdDesc = new C_CommandDesc("broadcast_forward",
"forwards streaming.",
"\"forward\" forward the specified broadcast with the"
" desired speed [0..N].");
......@@ -446,7 +446,7 @@ int C_Admin::Init()
pCmdDesc->BuildUsage();
m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc);
// -- rewind <channel> <speed>
pCmdDesc = new C_CommandDesc("rewind",
pCmdDesc = new C_CommandDesc("broadcast_rewind",
"rewinds streaming.",
"\"rewind\" rewind the specified broadcast with the"
" desired speed [0..N].");
......@@ -457,13 +457,13 @@ int C_Admin::Init()
pCmdDesc->BuildUsage();
m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc);
// -- stop <channel>
// pCmdDesc = new C_CommandDesc("stop",
// "stops a program.",
// "\"stop\" ends the specified broadcast.");
// pStr = new C_String("broadcast");
// pCmdDesc->m_vMandatoryArgs.Add(pStr);
// pCmdDesc->BuildUsage();
// m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc);
pCmdDesc = new C_CommandDesc("broadcast_stop",
"stops a program.",
"\"stop\" ends the specified broadcast.");
pStr = new C_String("broadcast");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pCmdDesc->BuildUsage();
m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc);
// -- shutdown
pCmdDesc = new C_CommandDesc("shutdown",
"stops the server.",
......
......@@ -2,7 +2,7 @@
* manager.cpp: Vls manager
*-------------------------------------------------------------------------------
* (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>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
......@@ -475,9 +475,12 @@ void C_Manager::StopPrograms()
while(cIterator1.HasNextItem())
{
C_Broadcast* pBroadcast = cIterator1.GetNextItem();
C_Request* pRequest = new C_Request("broadcast_stop");
pRequest->SetArg("broadcast", pBroadcast->GetChannel()->GetName());
cRequests.Add(pRequest);
if(pBroadcast->GetStatus()!=BROADCAST_WAITING)
{
C_Request* pRequest = new C_Request("broadcast_stop");
pRequest->SetArg("broadcast", pBroadcast->GetChannel()->GetName());
cRequests.Add(pRequest);
}
}
m_cBroadcastsList.UnLock();
......@@ -489,7 +492,7 @@ void C_Manager::StopPrograms()
HandleRequest(cRequest);
LogDbg(m_hLog, "Remove the broadcast");
m_cBroadcastsList.Lock();
#ifdef DEBUG
#ifdef DEBUG
int iRc = m_cBroadcastsList.Remove(cRequest.GetArg("program") + ":" +
cRequest.GetArg("input"));
#else
......
......@@ -2,7 +2,7 @@
* manager.h: Manager class definition
*-------------------------------------------------------------------------------
* (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>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
......@@ -105,19 +105,20 @@ private:
C_Semaphore m_cEventQueued;
C_Vector<C_Event> m_cEventFifo;
// Running broadcasts
C_Repository<C_String, C_Broadcast> m_cBroadcastsList;
// Ressources
C_Repository<C_String, C_Input> m_cInputList;
C_Repository<C_String, C_Channel> m_cChannelList;
//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;
// Programs
C_PgrmDirectory m_cProgramList;
// Running broadcasts
C_Repository<C_String, C_Broadcast> m_cBroadcastsList;
};
......
......@@ -2,7 +2,7 @@
* manager_broadcast.cpp: Brodacast mtehods for Vls manager
*-------------------------------------------------------------------------------
* (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>
* Benoit Steiner <benny@via.ecp.fr>
......@@ -74,10 +74,10 @@ C_Broadcast* C_Manager::CreateBroadcast(C_String& strName,
m_cBroadcastsList.Add(strName, pBroadcast);
m_cBroadcastsList.UnLock();
}
else if(pInput)
{
m_cInputList.Release(strInput);
}
if ( pInput ) m_cInputList.Release(strInput);
if ( pChannel ) m_cChannelList.Release(strChannel);
if ( pPgrm ) m_cProgramList.ReleasePgrm(strPgrm);
return pBroadcast;
}
......
......@@ -2,7 +2,7 @@
* repository.h: Repository class definition
*-------------------------------------------------------------------------------
* (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>
*
......@@ -53,7 +53,6 @@ template <class T> class C_RepositoryItem
~C_RepositoryItem()
{
//printf("<item> m_iRefCounter: %d\n", m_iRefCounter);
ASSERT(m_iRefCounter == 0);
delete m_pItem;
}
......
......@@ -17,7 +17,7 @@ BEGIN "Groups"
# groupname = "cmd1|cmd2|..."
# --- Example:
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
# 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