+#ifdef DEBUG
+ ff_rtmp_packet_dump(s, &pkt);
+#endif
+ if (pkt.type == RTMP_PT_CHUNK_SIZE) {
+ if ((ret = handle_chunk_size(s, &pkt)) < 0) {
+ ff_rtmp_packet_destroy(&pkt);
+ return ret;
+ }
+ } else if (pkt.type == RTMP_CTRL_ABORT_MESSAGE) {
+ av_log(s, AV_LOG_ERROR, "received abort message\n");
+ ff_rtmp_packet_destroy(&pkt);
+ return AVERROR_UNKNOWN;
+ } else if (pkt.type == RTMP_PT_BYTES_READ) {
+ av_log(s, AV_LOG_TRACE, "received acknowledgement\n");
+ } else if (pkt.type == RTMP_PT_SERVER_BW) {
+ if ((ret = handle_server_bw(s, &pkt)) < 0) {
+ ff_rtmp_packet_destroy(&pkt);
+ return ret;
+ }
+ } else if (pkt.type == RTMP_PT_CLIENT_BW) {
+ if ((ret = handle_client_bw(s, &pkt)) < 0) {
+ ff_rtmp_packet_destroy(&pkt);
+ return ret;
+ }
+ } else if (pkt.type == RTMP_PT_INVOKE) {
+ // received RTMP Command Message
+ break;
+ } else {
+ av_log(s, AV_LOG_ERROR, "Unknown control message type (%d)\n", pkt.type);
+ }
+ ff_rtmp_packet_destroy(&pkt);