rtmpproto: Pass the 'live' parameter in the right unit
authorMartin Storsjö <martin@martin.st>
Thu, 3 Oct 2013 07:09:56 +0000 (09:09 +0200)
committerMartin Storsjö <martin@martin.st>
Fri, 4 Oct 2013 06:25:05 +0000 (09:25 +0300)
The current magic numbers passed are values in seconds, while the
parameter itself should be passed over the wire in milliseconds.

This makes (some/all?) live streams from Red5 work correctly, that
previously returned StreamNotFound even with "-rtmp_live live". After
this commit, the default 'any' also works on these streams.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/rtmpproto.c

index 52dc45f..02fbcc4 100644 (file)
@@ -706,7 +706,7 @@ static int gen_play(URLContext *s, RTMPContext *rt)
     ff_amf_write_number(&p, ++rt->nb_invokes);
     ff_amf_write_null(&p);
     ff_amf_write_string(&p, rt->playpath);
-    ff_amf_write_number(&p, rt->live);
+    ff_amf_write_number(&p, rt->live * 1000);
 
     return rtmp_send_packet(rt, &pkt, 1);
 }