]> granicus.if.org Git - rtmpdump/commitdiff
All timestamps are 32 bit ints
authorhyc <hyc@400ebc74-4327-4243-bc38-086b20814532>
Sat, 27 Mar 2010 20:20:14 +0000 (20:20 +0000)
committerhyc <hyc@400ebc74-4327-4243-bc38-086b20814532>
Sat, 27 Mar 2010 20:20:14 +0000 (20:20 +0000)
git-svn-id: svn://svn.mplayerhq.hu/rtmpdump/trunk@407 400ebc74-4327-4243-bc38-086b20814532

librtmp/rtmp.c
librtmp/rtmp.h

index 07139fdf2769315c88637f62133d1d7fb0569cde..060c38cbc2e4185028b4234ac8a1b57a84756d35 100644 (file)
@@ -876,10 +876,14 @@ SocksNegotiate(RTMP *r)
 }
 
 bool
-RTMP_ConnectStream(RTMP *r, double seekTime)
+RTMP_ConnectStream(RTMP *r, int seekTime)
 {
   RTMPPacket packet = { 0 };
-  if (seekTime >= -2.0)
+
+  /* seekTime was already set by SetupStream / SetupURL.
+   * This is only needed by ReconnectStream.
+   */
+  if (seekTime > 0)
     r->Link.seekTime = seekTime;
 
   r->m_mediaChannel = 0;
@@ -908,7 +912,7 @@ RTMP_ConnectStream(RTMP *r, double seekTime)
 }
 
 bool
-RTMP_ReconnectStream(RTMP *r, double seekTime)
+RTMP_ReconnectStream(RTMP *r, int seekTime)
 {
   RTMP_DeleteStream(r);
 
@@ -1677,7 +1681,7 @@ SendDeleteStream(RTMP *r, double dStreamId)
 SAVC(pause);
 
 bool
-RTMP_SendPause(RTMP *r, bool DoPause, double dTime)
+RTMP_SendPause(RTMP *r, bool DoPause, int dTime)
 {
   RTMPPacket packet;
   char pbuf[256], *pend = pbuf + sizeof(pbuf);
@@ -1706,7 +1710,7 @@ RTMP_SendPause(RTMP *r, bool DoPause, double dTime)
 SAVC(seek);
 
 bool
-RTMP_SendSeek(RTMP *r, double dTime)
+RTMP_SendSeek(RTMP *r, int dTime)
 {
   RTMPPacket packet;
   char pbuf[256], *pend = pbuf + sizeof(pbuf);
@@ -1723,7 +1727,7 @@ RTMP_SendSeek(RTMP *r, double dTime)
   enc = AMF_EncodeString(enc, pend, &av_seek);
   enc = AMF_EncodeNumber(enc, pend, ++r->m_numInvokes);
   *enc++ = AMF_NULL;
-  enc = AMF_EncodeNumber(enc, pend, dTime);
+  enc = AMF_EncodeNumber(enc, pend, (double)dTime);
 
   packet.m_nBodySize = enc - packet.m_body;
 
index b4eaf7a8c35306586d43639f8dc5cc247f4b058e..f018efa1f9c094499e88221915c03b125453a084 100644 (file)
@@ -276,8 +276,8 @@ extern "C"
   double RTMP_GetDuration(RTMP *r);
   bool RTMP_ToggleStream(RTMP *r);
 
-  bool RTMP_ConnectStream(RTMP *r, double seekTime);
-  bool RTMP_ReconnectStream(RTMP *r, double seekTime);
+  bool RTMP_ConnectStream(RTMP *r, int seekTime);
+  bool RTMP_ReconnectStream(RTMP *r, int seekTime);
   void RTMP_DeleteStream(RTMP *r);
   int RTMP_GetNextMediaPacket(RTMP *r, RTMPPacket *packet);
   int RTMP_ClientPacket(RTMP *r, RTMPPacket *packet);
@@ -289,7 +289,7 @@ extern "C"
 
   bool RTMP_SendCtrl(RTMP *r, short nType, unsigned int nObject,
                     unsigned int nTime);
-  bool RTMP_SendPause(RTMP *r, bool DoPause, double dTime);
+  bool RTMP_SendPause(RTMP *r, bool DoPause, int dTime);
   bool RTMP_FindFirstMatchingProperty(AMFObject *obj, const AVal *name,
                                      AMFObjectProperty * p);
 
@@ -298,7 +298,7 @@ extern "C"
   int RTMPSockBuf_Close(RTMPSockBuf *sb);
 
   bool RTMP_SendCreateStream(RTMP *r);
-  bool RTMP_SendSeek(RTMP *r, double dTime);
+  bool RTMP_SendSeek(RTMP *r, int dTime);
   bool RTMP_SendServerBW(RTMP *r);
   bool RTMP_SendClientBW(RTMP *r);
   void RTMP_DropRequest(RTMP *r, int i, bool freeit);