On Tue, 7 Aug 2012, Samuel Pitoiset wrote:

When streaming live streams using the Akamai, Edgecast or Limelight CDN,
players cannot simply connect to the live stream. Instead, they have to
subscribe to it, by sending an FC Subscribe call to the server.
---
libavformat/rtmpproto.c | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)

diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index 4a35319..e658b68 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -604,6 +604,29 @@ static int gen_bytes_read(URLContext *s, RTMPContext *rt, 
uint32_t ts)
    return ret;
}

+static int gen_fcsubscribe_stream(URLContext *s, RTMPContext *rt)
+{
+    RTMPPacket pkt;
+    uint8_t *p;
+    int ret;
+
+    if ((ret = ff_rtmp_packet_create(&pkt, RTMP_SYSTEM_CHANNEL, RTMP_PT_INVOKE,
+                                     0, 27 + strlen(rt->playpath))) < 0)
+        return ret;
+
+    p = pkt.data;
+    ff_amf_write_string(&p, "FCSubscribe");
+    ff_amf_write_number(&p, rt->nb_invokes);

You should increase nb_invokes here, like it is done in every other gen_* function.

Other than that, this looks ok, but I'll wait with applying it until you've retested the patch with that change in place since I don't off-hand have a test case for it.

// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to