Fixed RTMP desync bug with Windows clients.
This commit is contained in:
parent
90e0c0037e
commit
c49eaca664
2 changed files with 1 additions and 4 deletions
|
@ -13,7 +13,7 @@ std::string RTMPStream::handshake_out;///< Output for the handshake.
|
|||
unsigned int RTMPStream::getNowMS(){
|
||||
timeval t;
|
||||
gettimeofday(&t, 0);
|
||||
return t.tv_sec + t.tv_usec/1000;
|
||||
return t.tv_sec * 1000 + t.tv_usec/1000;
|
||||
}//RTMPStream::getNowMS
|
||||
|
||||
|
||||
|
@ -27,7 +27,6 @@ unsigned int RTMPStream::rec_cnt = 0;
|
|||
unsigned int RTMPStream::snd_cnt = 0;
|
||||
|
||||
timeval RTMPStream::lastrec;
|
||||
unsigned int RTMPStream::firsttime;
|
||||
|
||||
/// Holds the last sent chunk for every msg_id.
|
||||
std::map<unsigned int, RTMPStream::Chunk> RTMPStream::Chunk::lastsend;
|
||||
|
@ -42,7 +41,6 @@ std::string RTMPStream::Chunk::Pack(){
|
|||
RTMPStream::Chunk prev = lastsend[cs_id];
|
||||
unsigned int tmpi;
|
||||
unsigned char chtype = 0x00;
|
||||
//timestamp -= firsttime;
|
||||
if ((prev.msg_type_id > 0) && (prev.cs_id == cs_id)){
|
||||
if (msg_stream_id == prev.msg_stream_id){
|
||||
chtype = 0x40;//do not send msg_stream_id
|
||||
|
|
|
@ -30,7 +30,6 @@ namespace RTMPStream{
|
|||
extern unsigned int snd_cnt; ///< Counter for total data sent, in bytes.
|
||||
|
||||
extern timeval lastrec; ///< Timestamp of last time data was received.
|
||||
extern unsigned int firsttime; ///< Timestamp of first time a chunk was sent.
|
||||
|
||||
/// Holds a single RTMP chunk, either send or receive direction.
|
||||
class Chunk{
|
||||
|
|
Loading…
Add table
Reference in a new issue