[FFmpeg-cvslog] rtmp: Do not send _checkbw calls as notifications
Samuel Pitoiset
git at videolan.org
Wed Aug 15 16:02:53 CEST 2012
ffmpeg | branch: master | Samuel Pitoiset <samuel.pitoiset at gmail.com> | Sat Aug 11 12:41:33 2012 +0200| [8b6a5a7923dc4596091acaa9d8219ade39dd2d61] | committer: Martin Storsjö
rtmp: Do not send _checkbw calls as notifications
The _checkbw calls were changed to use transactionId 0 in commit
82613564 so that servers would not return _result/_error about it.
While this is the strict interpretation of the spec, there are
servers that return _error about it, even if transactionId was 0.
The latest version of EvoStream Media Server (the commercial version
of crtmpserver) behaves properly as described, i.e. returning an
_error normally but not returning anything when using transactionId
0. The latest version of crtmpserver (right now at least) doesn't
behave like this though, it returns an error even if transactionId
was 0.
There are also other servers that return errors even if transactionId
is set to 0. Therefore set a proper transaction id so that the invoke
can be tracked and the error properly ignored instead.
Signed-off-by: Martin Storsjö <martin at martin.st>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8b6a5a7923dc4596091acaa9d8219ade39dd2d61
---
libavformat/rtmp.h | 9 ---------
libavformat/rtmpproto.c | 2 +-
2 files changed, 1 insertion(+), 10 deletions(-)
diff --git a/libavformat/rtmp.h b/libavformat/rtmp.h
index c9aa67e..b9c5f1e 100644
--- a/libavformat/rtmp.h
+++ b/libavformat/rtmp.h
@@ -33,15 +33,6 @@
#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 1db3152..150e45a 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -626,7 +626,7 @@ static int gen_check_bw(URLContext *s, RTMPContext *rt)
p = pkt.data;
ff_amf_write_string(&p, "_checkbw");
- ff_amf_write_number(&p, RTMP_NOTIFICATION);
+ ff_amf_write_number(&p, ++rt->nb_invokes);
ff_amf_write_null(&p);
return rtmp_send_packet(rt, &pkt, 0);
More information about the ffmpeg-cvslog
mailing list