rtmp: support strict rtmp servers

In order to send or receive a stream FCPublish, FCSubscribe and _checkbw
are completely optional and often not implemented. releaseStream over a
non-existen stream might report an error instead of being silent.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
Samuel Pitoiset 2012-08-19 13:02:23 +02:00 committed by Luca Barbato
parent ac33016158
commit 7011a42b1a
1 changed files with 7 additions and 4 deletions

View File

@ -549,7 +549,7 @@ static int gen_release_stream(URLContext *s, RTMPContext *rt)
ff_amf_write_null(&p);
ff_amf_write_string(&p, rt->playpath);
return rtmp_send_packet(rt, &pkt, 0);
return rtmp_send_packet(rt, &pkt, 1);
}
/**
@ -573,7 +573,7 @@ static int gen_fcpublish_stream(URLContext *s, RTMPContext *rt)
ff_amf_write_null(&p);
ff_amf_write_string(&p, rt->playpath);
return rtmp_send_packet(rt, &pkt, 0);
return rtmp_send_packet(rt, &pkt, 1);
}
/**
@ -1525,8 +1525,11 @@ static int handle_invoke_error(URLContext *s, RTMPPacket *pkt)
if (!ff_amf_get_field_value(pkt->data + 9, data_end,
"description", tmpstr, sizeof(tmpstr))) {
if (tracked_method && !strcmp(tracked_method, "_checkbw")) {
/* Ignore _checkbw errors. */
if (tracked_method && (!strcmp(tracked_method, "_checkbw") ||
!strcmp(tracked_method, "releaseStream") ||
!strcmp(tracked_method, "FCSubscribe") ||
!strcmp(tracked_method, "FCPublish"))) {
/* Gracefully ignore Adobe-specific historical artifact errors. */
level = AV_LOG_WARNING;
ret = 0;
} else