Commit 31dc054f authored by Damien Lucas's avatar Damien Lucas

Changes in order to fix the following bugs:

1. channels were marked as audio (should be video)
2. The same message id were used for all channels which
   is against the sap (rfc 2974)
3. All channels sent at the same time and then delay is not a
   good idea when sending many channels. Spreading out the sending
   and increasing the delay, makes it more likely to stay under 4000 bits/s
   (even though it still is a very rudimentary bandwidth regulation to
   require recompilation when adding channels.....)



courtesy of Gunnar Monell <gunnar.monell@i3micro.com>
parent 1cd83c62
......@@ -2,7 +2,7 @@
* message.cpp : SAP Message class
****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
* $Id: message.cpp,v 1.7 2003/09/11 15:33:53 zorglub Exp $
* $Id: message.cpp,v 1.8 2003/09/23 16:47:15 nitrox Exp $
*
* Authors: Damien Lucas <nitrox@videolan.org>
* Philippe Van Hecke <philippe.vanhecke@belnet.be>
......@@ -145,7 +145,7 @@ void Message::AddProgram(Program *p)
fprintf(stderr, "Non permanent program not supported ...\n");
fprintf(stderr, "Announcing permanent session instead\n");
}
string m="m=audio "+p->GetPort()+" ";
string m="m=video "+p->GetPort()+" ";
if( p->IsHTTP() )
{
......
......@@ -2,7 +2,7 @@
* sapserver.cpp : SAP discovery service mini-server
****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
* $Id: sapserver.cpp,v 1.15 2003/08/12 15:59:19 zorglub Exp $
* $Id: sapserver.cpp,v 1.16 2003/09/23 16:47:15 nitrox Exp $
*
* Authors: Arnaud Schauly <gitan@via.ecp.fr>
* Clment Stenac <zorglub@via.ecp.fr>
......@@ -163,7 +163,7 @@ int main(int argc, char *argv[])
for (unsigned int i=0; i<config->Programs.size(); i++)
{
/* Create a new message */
message=new Message(SAP_ANNOUNCE, 0x4212, "1.2.3.4");
message=new Message(SAP_ANNOUNCE, 0x4212+i, "1.2.3.4");
/* Build the message header */
message->BuildHeader("application/sdp");
/* Add the program */
......@@ -176,10 +176,10 @@ int main(int argc, char *argv[])
if(config->GetDotMode())
fprintf(stdout,".");
/* Wait for next sending */
usleep(SAP_DELAY*1000000/config->Programs.size());
}
fflush(stdout);
/* Wait for next sending */
sleep(SAP_DELAY);
}
}
else
......
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