@@ -25,6 +25,8 @@ struct rtmp_result_t
25
25
// "NetConnection.Connect.InvalidApp",
26
26
// "NetConnection.Connect.Rejected",
27
27
//
28
+ // "NetConnection.Connect.ReconnectRequest" // enhanced rtmp v2
29
+ //
28
30
// "NetStream.Failed",
29
31
// "NetStream.Play.Failed",
30
32
// "NetStream.Play.StreamNotFound",
@@ -143,13 +145,15 @@ static int rtmp_command_onerror(struct rtmp_t* rtmp, double transaction, const u
143
145
// s -> c
144
146
static int rtmp_command_onstatus (struct rtmp_t * rtmp , double transaction , const uint8_t * data , uint32_t bytes )
145
147
{
148
+ char tcurl [256 ];
146
149
struct rtmp_result_t result ;
147
- struct amf_object_item_t info [3 ];
150
+ struct amf_object_item_t info [4 ];
148
151
struct amf_object_item_t items [2 ];
149
152
150
153
AMF_OBJECT_ITEM_VALUE (info [0 ], AMF_STRING , "code" , result .code , sizeof (result .code ));
151
154
AMF_OBJECT_ITEM_VALUE (info [1 ], AMF_STRING , "level" , result .level , sizeof (result .level ));
152
155
AMF_OBJECT_ITEM_VALUE (info [2 ], AMF_STRING , "description" , result .description , sizeof (result .description ));
156
+ AMF_OBJECT_ITEM_VALUE (info [3 ], AMF_STRING , "tcUrl" , tcurl , sizeof (tcurl ));
153
157
154
158
AMF_OBJECT_ITEM_VALUE (items [0 ], AMF_OBJECT , "command" , NULL , 0 ); // Command object
155
159
AMF_OBJECT_ITEM_VALUE (items [1 ], AMF_OBJECT , "information" , info , sizeof (info ) / sizeof (info [0 ])); // Information object
@@ -214,6 +218,11 @@ static int rtmp_command_onstatus(struct rtmp_t* rtmp, double transaction, const
214
218
//rtmp->onerror(rtmp->param, -1, result.code);
215
219
return -1 ;
216
220
}
221
+ else if (0 == strcasecmp (result .code , "NetConnection.Connect.ReconnectRequest" ))
222
+ {
223
+ // enhanced rtmp v2
224
+ rtmp -> client .onreconnect ? rtmp -> client .onreconnect (rtmp -> param , tcurl , result .description ) : 0 ;
225
+ }
217
226
else
218
227
{
219
228
assert (0 );
0 commit comments