]> granicus.if.org Git - rtmpdump/commitdiff
flvstreamer bug#107134 stop streaming for onFCUnsubscribe
authorhyc <hyc@400ebc74-4327-4243-bc38-086b20814532>
Fri, 20 Nov 2009 19:03:20 +0000 (19:03 +0000)
committerhyc <hyc@400ebc74-4327-4243-bc38-086b20814532>
Fri, 20 Nov 2009 19:03:20 +0000 (19:03 +0000)
git-svn-id: svn://svn.mplayerhq.hu/rtmpdump@55 400ebc74-4327-4243-bc38-086b20814532

rtmp.cpp
rtmpdump.cpp

index df83c0832fff065d4b55a7d3781cf318b144766e..7b9170b96115db48e2791061859970d7308fb144 100644 (file)
--- a/rtmp.cpp
+++ b/rtmp.cpp
@@ -1151,6 +1151,11 @@ int CRTMP::HandleInvoke(const char *body, unsigned int nBodySize)
   {
     // SendOnFCSubscribe();
   }
+  else if (CSCMP(method,"onFCUnsubscribe"))
+  {
+    Close();
+    return 1;
+  }
   else if (CSCMP(method,"_onbwcheck"))
   {
     SendCheckBWResult(txn);
index b04d6c2d74b1d9447f15460128ace7f41a11bfab..98338a776bb7ced948b53c015a596cfced76ce61 100644 (file)
@@ -158,6 +158,12 @@ int WriteStream(
                char *packetBody        = packet.m_body;
                unsigned int nPacketLen = packet.m_nBodySize;
 
+                // Return -3 if this was completed nicely with invoke message Play.Stop or Play.Complete
+                if (rtnGetNextMediaPacket == 2) {
+                        Log(LOGDEBUG, "Got Play.Complete or Play.Stop from server. Assuming stream is complete");
+                        return -3;
+                }
+
                // skip video info/command packets
                if(packet.m_packetType == 0x09 && 
                   nPacketLen == 2 &&
@@ -432,11 +438,6 @@ stopKeyframeSearch:
                if(tsm)
                        *tsm = bLiveStream ? packet.m_nTimeStamp : nTimeStamp;
 
-                // Return -3 if this was completed nicely with invoke message Play.Stop or Play.Complete
-                if (rtnGetNextMediaPacket == 2) {
-                        Log(LOGDEBUG, "Got Play.Complete or Play.Stop from server. Assuming stream is complete");
-                        return -3;
-                }
 
                return size;
        }