summaryrefslogtreecommitdiff
path: root/libavformat/rtpdec_h264.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2012-05-05 00:28:25 +0300
committerMartin Storsjö <martin@martin.st>2012-05-05 20:35:05 +0300
commit48666c2bd6791e989cdb61f8fecd8dd2ce13bc58 (patch)
tree474aba586e7597524642af0111cad143c50d651b /libavformat/rtpdec_h264.c
parent0b3ac9fe05ae4eec0ee155c49c0aa6ac7575f54f (diff)
rtpdec_h264: Cleanup debug packet type counting
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/rtpdec_h264.c')
-rw-r--r--libavformat/rtpdec_h264.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/libavformat/rtpdec_h264.c b/libavformat/rtpdec_h264.c
index 27ab7be81d..5fd4efc65e 100644
--- a/libavformat/rtpdec_h264.c
+++ b/libavformat/rtpdec_h264.c
@@ -57,6 +57,12 @@ struct PayloadContext {
#endif
};
+#ifdef DEBUG
+#define COUNT_NAL_TYPE(data, nal) data->packet_types_received[(nal) & 0x1f]++
+#else
+#define COUNT_NAL_TYPE(data, nal) do { } while (0)
+#endif
+
static int sdp_parse_fmtp_config_h264(AVStream *stream,
PayloadContext *h264_data,
char *attr, char *value)
@@ -188,9 +194,7 @@ static int h264_handle_packet(AVFormatContext *ctx, PayloadContext *data,
av_new_packet(pkt, len + sizeof(start_sequence));
memcpy(pkt->data, start_sequence, sizeof(start_sequence));
memcpy(pkt->data + sizeof(start_sequence), buf, len);
-#ifdef DEBUG
- data->packet_types_received[nal & 0x1f]++;
-#endif
+ COUNT_NAL_TYPE(data, nal);
break;
case 24: // STAP-A (one packet, multiple nals)
@@ -224,9 +228,7 @@ static int h264_handle_packet(AVFormatContext *ctx, PayloadContext *data,
memcpy(dst, start_sequence, sizeof(start_sequence));
dst += sizeof(start_sequence);
memcpy(dst, src, nal_size);
-#ifdef DEBUG
- data->packet_types_received[*src & 0x1f]++;
-#endif
+ COUNT_NAL_TYPE(data, *src);
dst += nal_size;
}
} else {
@@ -287,10 +289,8 @@ static int h264_handle_packet(AVFormatContext *ctx, PayloadContext *data,
buf++;
len--;
-#ifdef DEBUG
if (start_bit)
- data->packet_types_received[nal_type]++;
-#endif
+ COUNT_NAL_TYPE(data, nal_type);
if (start_bit) {
/* copy in the start sequence, and the reconstructed nal */
av_new_packet(pkt, sizeof(start_sequence) + sizeof(nal) + len);