[FFmpeg-cvslog] rtmp: send check_bw as notification

Luca Barbato git at videolan.org
Thu Aug 9 01:02:23 CEST 2012


ffmpeg | branch: master | Luca Barbato <lu_zero at gentoo.org> | Wed Aug  8 11:49:02 2012 +0200| [82613564cfae459796642b22fc0163927d7f49e0] | committer: Luca Barbato

rtmp: send check_bw as notification

Set the transactionId to 0 to signal the server a return _result/_error
is not expected.

Solves the problems experienced with strict rtmp servers.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=82613564cfae459796642b22fc0163927d7f49e0
---

 libavformat/rtmp.h      |    9 +++++++++
 libavformat/rtmpproto.c |    2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/libavformat/rtmp.h b/libavformat/rtmp.h
index b9c5f1e..c9aa67e 100644
--- a/libavformat/rtmp.h
+++ b/libavformat/rtmp.h
@@ -33,6 +33,15 @@
 #define HMAC_OPAD_VAL 0x5C
 
 /**
+ * A non-zero transaction id requires the server to send back
+ * a _result or _error response.
+ * Setting it to 0 marks the message as a notification not
+ * requiring feedback.
+ */
+
+#define RTMP_NOTIFICATION 0
+
+/**
  * emulated Flash client version - 9.0.124.2 on Linux
  * @{
  */
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index 19b6874..f660777 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -573,7 +573,7 @@ static int gen_check_bw(URLContext *s, RTMPContext *rt)
 
     p = pkt.data;
     ff_amf_write_string(&p, "_checkbw");
-    ff_amf_write_number(&p, ++rt->nb_invokes);
+    ff_amf_write_number(&p, RTMP_NOTIFICATION);
     ff_amf_write_null(&p);
 
     ret = ff_rtmp_packet_write(rt->stream, &pkt, rt->chunk_size,



More information about the ffmpeg-cvslog mailing list