On Thu, 18 Dec 2014, Diego Biurrun wrote:

On Thu, Dec 18, 2014 at 12:29:55PM +0200, Martin Storsjö wrote:
--- /dev/null
+++ b/libavformat/rtpdec_h261.c
@@ -0,0 +1,202 @@
+
+#include "avformat.h"
+#include "rtpdec_formats.h"
+#include "libavcodec/get_bits.h"

nit: header ordering

+static int h261_handle_packet(AVFormatContext *ctx, PayloadContext 
*rtp_h261_ctx,
+                              AVStream *st, AVPacket *pkt, uint32_t *timestamp,
+                              const uint8_t *buf, int len, uint16_t seq,
+                              int flags)
+{
+    int sbit, ebit, gobn, mbap, quant;
+    int res;
+
+    /* drop data of previous packets in case of non-continuous (loss) packet 
stream */

lossY?  I cannot quite make heads or tails of "loss" otherwise...

+    /* do the "byte merging" at the boundaries of two consecutive frame 
fragments */
+    if (rtp_h261_ctx->endbyte_bits || sbit) {
+        if (rtp_h261_ctx->endbyte_bits == sbit) {
+            rtp_h261_ctx->endbyte |= buf[0] & (0xff >> sbit);
+            rtp_h261_ctx->endbyte_bits = 0;

nit: align

+            if (rtp_h261_ctx->endbyte_bits)
+                rtp_h261_ctx->endbyte = get_bits(&gb, rtp_h261_ctx->endbyte_bits) 
<<
+                                (8 - rtp_h261_ctx->endbyte_bits);

Indentation is off.

+    if (ebit) {
+        if (len > 0)
+            avio_write(rtp_h261_ctx->buf, buf, len - 1);
+        rtp_h261_ctx->endbyte_bits = 8 - ebit;
+        rtp_h261_ctx->endbyte = buf[len - 1] & (0xff << ebit);

nit: align

Fixed all these locally.

// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to