On Mon, Nov 30, 2009 at 11:21:46PM +0200, Sergiy wrote:
2009/11/30 Diego Biurrun <diego at biurrun.de>:
Please respect the surrounding (K&R) style and be consistent, you mix styles even in the code you add: Place spaces after if/for/while/switch.
.. and space before {
Added. I also fix code for sending channel_id >= 64 in ff_rtmp_packet_write().
--- a/libavformat/rtmppkt.c +++ b/libavformat/rtmppkt.c @@ -144,17 +151,47 @@ int ff_rtmp_packet_write(URLContext *h, RTMPPacket *pkt,
+ if (prev_pkt[pkt->channel_id].channel_id && + pkt->extra == prev_pkt[pkt->channel_id].extra) { + if (pkt->type == prev_pkt[pkt->channel_id].type && + pkt->data_size == prev_pkt[pkt->channel_id].data_size) { + mode = RTMP_PS_FOURBYTES; + if (pkt->timestamp == prev_pkt[pkt->channel_id].timestamp) + mode = RTMP_PS_ONEBYTE;
weird and inconsistent indentation
--- a/libavformat/rtmpproto.c +++ b/libavformat/rtmpproto.c @@ -163,30 +202,40 @@ static void gen_play(URLContext *s, RTMPContext *rt)
- av_log(LOG_CONTEXT, AV_LOG_DEBUG, "Sending play command for '%s'\n", rt->playpath); - ff_rtmp_packet_create(&pkt, RTMP_VIDEO_CHANNEL, RTMP_PT_INVOKE, 0, - 20 + strlen(rt->playpath)); + av_log(LOG_CONTEXT, AV_LOG_DEBUG, "Sending %s command for '%s'\n", rt->is_input ? "play" : "publish", + rt->playpath); + ff_rtmp_packet_create(&pkt, rt->is_input ? RTMP_VIDEO_CHANNEL : RTMP_SOURCE_CHANNEL, RTMP_PT_INVOKE, 0, + 4096);
again Align the second line with the first character after the '('. .. more below ..
@@ -593,60 +671,51 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
+ rt->pkt_id = 1.0; + rt->chunk_size = 128; + rt->state = STATE_HANDSHAKED;
align the = Diego