[streaming] Bug in miniSAP

Vincent Bernat bernat at luffy.cx
Mon Jul 4 23:37:13 CEST 2005


Hello !

I don't know if  it is a known bug, but the  following line in miniSAP
server actual code makes that  only one announce is taken into account
by a recent VLC for a given server :

    string o="o="+p->GetUser()+" 3247692199 3247895918 IN IP4 "+
                                 p->GetMachine()+"\n";

The first number is the session  number and should be dependent of the
program/channel. The second number  is the version and should increase
at each update.

Here is the code I have used instead

     long long unsigned int hash = 0;
     for (int i = 0; i < p->GetName().size(); i++) 
     {
        hash *= 2;
        hash += (int)p->GetName()[i];
     }
   
    string v="v=0\n";  // SDP version
    char oo[1000];
    sprintf(oo, " %lld %ld IN IP4 ", hash, time(NULL));
    string o="o=" + p->GetUser() + oo + p->GetMachine() + "\n";

The code  is a gross  hack, but I  am not a  fan of C++  and therefore
don't know how to handle type string. But the idea is here.
-- 
I WILL NOT SCREAM FOR ICE CREAM
I WILL NOT SCREAM FOR ICE CREAM
I WILL NOT SCREAM FOR ICE CREAM
-+- Bart Simpson on chalkboard in episode AABF03

-- 
This is the streaming mailing-list, see http://www.videolan.org/streaming/
To unsubscribe, please read http://www.videolan.org/support/lists.html



More information about the streaming mailing list