Skip to content

Commit

Permalink
framecrcenc: print flags and side data elements
Browse files Browse the repository at this point in the history
The new fields are only printed when they differ from their defaults
this way only few fate refs change

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  • Loading branch information
michaelni committed Oct 3, 2012
1 parent 6a697b4 commit dc82b2c
Show file tree
Hide file tree
Showing 12 changed files with 725 additions and 719 deletions.
8 changes: 7 additions & 1 deletion libavformat/framecrcenc.c
Expand Up @@ -20,6 +20,7 @@
*/

#include "libavutil/adler32.h"
#include "libavutil/avstring.h"
#include "avformat.h"
#include "internal.h"

Expand All @@ -28,8 +29,13 @@ static int framecrc_write_packet(struct AVFormatContext *s, AVPacket *pkt)
uint32_t crc = av_adler32_update(0, pkt->data, pkt->size);
char buf[256];

snprintf(buf, sizeof(buf), "%d, %10"PRId64", %10"PRId64", %8d, %8d, 0x%08x\n",
snprintf(buf, sizeof(buf), "%d, %10"PRId64", %10"PRId64", %8d, %8d, 0x%08x",
pkt->stream_index, pkt->dts, pkt->pts, pkt->duration, pkt->size, crc);
if (pkt->flags != AV_PKT_FLAG_KEY)
av_strlcatf(buf, sizeof(buf), ", F=0x%0X", pkt->flags);
if (pkt->side_data_elems)
av_strlcatf(buf, sizeof(buf), ", S=%d", pkt->side_data_elems);
av_strlcatf(buf, sizeof(buf), "\n");
avio_write(s->pb, buf, strlen(buf));
avio_flush(s->pb);
return 0;
Expand Down
2 changes: 1 addition & 1 deletion tests/ref/fate/d-cinema-demux
Expand Up @@ -2,4 +2,4 @@
0, 0, 0, 1875, 36000, 0xd592781d
0, 1875, 1875, 1875, 36000, 0xd592781d
0, 3750, 3750, 1875, 36000, 0xd592781d
0, 5625, 5625, 1200, 23056, 0xde81f0d6
0, 5625, 5625, 1200, 23056, 0xde81f0d6, F=0x3
168 changes: 84 additions & 84 deletions tests/ref/fate/lmlm4-demux

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/ref/fate/mtv
Expand Up @@ -133,6 +133,6 @@
1, 104832, 104832, 1152, 418, 0xa105cdcc
1, 105984, 105984, 1152, 418, 0x1477ba58
1, 107136, 107136, 1152, 418, 0x8d0dcdb2
0, 39, 39, 1, 3584, 0x0354c435
0, 39, 39, 1, 3584, 0x0354c435, F=0x3
1, 108288, 108288, 1152, 418, 0x0d7cbef4
1, 109440, 109440, 1152, 294, 0x5e2b87c4
170 changes: 85 additions & 85 deletions tests/ref/fate/mxf-demux
Expand Up @@ -2,98 +2,98 @@
#tb 1: 1/25
0, 0, -9223372036854775808, 1, 8468, 0xc0855553
1, 0, 0, 50, 32000, 0x479155e6
0, 1, -9223372036854775808, 1, 3814, 0xa10783b4
0, 2, -9223372036854775808, 1, 3747, 0xb7bf6973
0, 3, -9223372036854775808, 1, 3705, 0x5462a600
0, 4, -9223372036854775808, 1, 3704, 0x1e564943
0, 5, -9223372036854775808, 1, 3760, 0x10464b9a
0, 6, -9223372036854775808, 1, 3799, 0xd41d6dcf
0, 7, -9223372036854775808, 1, 3832, 0x5cf6999e
0, 8, -9223372036854775808, 1, 3778, 0xe5fc7b9e
0, 9, -9223372036854775808, 1, 38193, 0xd34e5dd4
0, 1, -9223372036854775808, 1, 3814, 0xa10783b4, F=0x0
0, 2, -9223372036854775808, 1, 3747, 0xb7bf6973, F=0x0
0, 3, -9223372036854775808, 1, 3705, 0x5462a600, F=0x0
0, 4, -9223372036854775808, 1, 3704, 0x1e564943, F=0x0
0, 5, -9223372036854775808, 1, 3760, 0x10464b9a, F=0x0
0, 6, -9223372036854775808, 1, 3799, 0xd41d6dcf, F=0x0
0, 7, -9223372036854775808, 1, 3832, 0x5cf6999e, F=0x0
0, 8, -9223372036854775808, 1, 3778, 0xe5fc7b9e, F=0x0
0, 9, -9223372036854775808, 1, 38193, 0xd34e5dd4, F=0x0
0, 10, -9223372036854775808, 1, 8520, 0x2a203e68
0, 11, -9223372036854775808, 1, 3832, 0xe4c4b2fe
0, 12, -9223372036854775808, 1, 3787, 0x0cf95fee
0, 13, -9223372036854775808, 1, 3766, 0x9e019d14
0, 14, -9223372036854775808, 1, 3785, 0x0ea9ae75
0, 15, -9223372036854775808, 1, 3703, 0x11d349ff
0, 16, -9223372036854775808, 1, 3731, 0x5cf358ef
0, 17, -9223372036854775808, 1, 3785, 0x01c8962f
0, 18, -9223372036854775808, 1, 3741, 0xb2c47d53
0, 19, -9223372036854775808, 1, 38150, 0x08fa1f55
0, 11, -9223372036854775808, 1, 3832, 0xe4c4b2fe, F=0x0
0, 12, -9223372036854775808, 1, 3787, 0x0cf95fee, F=0x0
0, 13, -9223372036854775808, 1, 3766, 0x9e019d14, F=0x0
0, 14, -9223372036854775808, 1, 3785, 0x0ea9ae75, F=0x0
0, 15, -9223372036854775808, 1, 3703, 0x11d349ff, F=0x0
0, 16, -9223372036854775808, 1, 3731, 0x5cf358ef, F=0x0
0, 17, -9223372036854775808, 1, 3785, 0x01c8962f, F=0x0
0, 18, -9223372036854775808, 1, 3741, 0xb2c47d53, F=0x0
0, 19, -9223372036854775808, 1, 38150, 0x08fa1f55, F=0x0
0, 20, -9223372036854775808, 1, 8487, 0x0c234b9a
0, 21, -9223372036854775808, 1, 3791, 0x831192ef
0, 22, -9223372036854775808, 1, 3612, 0x598944fb
0, 23, -9223372036854775808, 1, 3710, 0xccbb711a
0, 24, -9223372036854775808, 1, 3864, 0x4385966e
0, 25, -9223372036854775808, 1, 3919, 0x24e2abc3
0, 26, -9223372036854775808, 1, 3777, 0x210c6219
0, 27, -9223372036854775808, 1, 3811, 0x23bf68c2
0, 28, -9223372036854775808, 1, 3802, 0x52688862
0, 29, -9223372036854775808, 1, 38027, 0x3d5aa8b9
0, 21, -9223372036854775808, 1, 3791, 0x831192ef, F=0x0
0, 22, -9223372036854775808, 1, 3612, 0x598944fb, F=0x0
0, 23, -9223372036854775808, 1, 3710, 0xccbb711a, F=0x0
0, 24, -9223372036854775808, 1, 3864, 0x4385966e, F=0x0
0, 25, -9223372036854775808, 1, 3919, 0x24e2abc3, F=0x0
0, 26, -9223372036854775808, 1, 3777, 0x210c6219, F=0x0
0, 27, -9223372036854775808, 1, 3811, 0x23bf68c2, F=0x0
0, 28, -9223372036854775808, 1, 3802, 0x52688862, F=0x0
0, 29, -9223372036854775808, 1, 38027, 0x3d5aa8b9, F=0x0
0, 30, -9223372036854775808, 1, 8333, 0x617de950
0, 31, -9223372036854775808, 1, 3831, 0x13fad8fc
0, 32, -9223372036854775808, 1, 3719, 0xbc317470
0, 33, -9223372036854775808, 1, 3761, 0xeac460b6
0, 34, -9223372036854775808, 1, 3637, 0x27d64b32
0, 35, -9223372036854775808, 1, 3666, 0xf0f700a5
0, 36, -9223372036854775808, 1, 3788, 0x1c4662a8
0, 37, -9223372036854775808, 1, 3960, 0xef6b9e99
0, 38, -9223372036854775808, 1, 3793, 0x3a6ca832
0, 39, -9223372036854775808, 1, 38312, 0xce1317cc
0, 31, -9223372036854775808, 1, 3831, 0x13fad8fc, F=0x0
0, 32, -9223372036854775808, 1, 3719, 0xbc317470, F=0x0
0, 33, -9223372036854775808, 1, 3761, 0xeac460b6, F=0x0
0, 34, -9223372036854775808, 1, 3637, 0x27d64b32, F=0x0
0, 35, -9223372036854775808, 1, 3666, 0xf0f700a5, F=0x0
0, 36, -9223372036854775808, 1, 3788, 0x1c4662a8, F=0x0
0, 37, -9223372036854775808, 1, 3960, 0xef6b9e99, F=0x0
0, 38, -9223372036854775808, 1, 3793, 0x3a6ca832, F=0x0
0, 39, -9223372036854775808, 1, 38312, 0xce1317cc, F=0x0
0, 40, -9223372036854775808, 1, 8548, 0x4ca944d4
0, 41, -9223372036854775808, 1, 3866, 0x4e85bf0f
0, 42, -9223372036854775808, 1, 3644, 0x030338e5
0, 43, -9223372036854775808, 1, 3634, 0xa95f4512
0, 44, -9223372036854775808, 1, 3925, 0x7583ba86
0, 45, -9223372036854775808, 1, 3675, 0x979f423f
0, 46, -9223372036854775808, 1, 3703, 0x11375f7a
0, 47, -9223372036854775808, 1, 3705, 0xb7de5d16
0, 48, -9223372036854775808, 1, 3688, 0x1db45852
0, 49, -9223372036854775808, 1, 38412, 0x2ee26a63
0, 41, -9223372036854775808, 1, 3866, 0x4e85bf0f, F=0x0
0, 42, -9223372036854775808, 1, 3644, 0x030338e5, F=0x0
0, 43, -9223372036854775808, 1, 3634, 0xa95f4512, F=0x0
0, 44, -9223372036854775808, 1, 3925, 0x7583ba86, F=0x0
0, 45, -9223372036854775808, 1, 3675, 0x979f423f, F=0x0
0, 46, -9223372036854775808, 1, 3703, 0x11375f7a, F=0x0
0, 47, -9223372036854775808, 1, 3705, 0xb7de5d16, F=0x0
0, 48, -9223372036854775808, 1, 3688, 0x1db45852, F=0x0
0, 49, -9223372036854775808, 1, 38412, 0x2ee26a63, F=0x0
0, 50, -9223372036854775808, 1, 8385, 0x0bc20a27
1, 50, 50, 50, 32000, 0x8f7e5009
0, 51, -9223372036854775808, 1, 3733, 0xa3e2a9a0
0, 52, -9223372036854775808, 1, 3773, 0x27769caa
0, 53, -9223372036854775808, 1, 3670, 0xc8335e98
0, 54, -9223372036854775808, 1, 3596, 0xd6512fb0
0, 55, -9223372036854775808, 1, 3579, 0xa621fbc2
0, 56, -9223372036854775808, 1, 3641, 0x2f4f46ca
0, 57, -9223372036854775808, 1, 3686, 0x0a92385a
0, 58, -9223372036854775808, 1, 3672, 0xe65137b9
0, 59, -9223372036854775808, 1, 39065, 0xc723bf8b
0, 51, -9223372036854775808, 1, 3733, 0xa3e2a9a0, F=0x0
0, 52, -9223372036854775808, 1, 3773, 0x27769caa, F=0x0
0, 53, -9223372036854775808, 1, 3670, 0xc8335e98, F=0x0
0, 54, -9223372036854775808, 1, 3596, 0xd6512fb0, F=0x0
0, 55, -9223372036854775808, 1, 3579, 0xa621fbc2, F=0x0
0, 56, -9223372036854775808, 1, 3641, 0x2f4f46ca, F=0x0
0, 57, -9223372036854775808, 1, 3686, 0x0a92385a, F=0x0
0, 58, -9223372036854775808, 1, 3672, 0xe65137b9, F=0x0
0, 59, -9223372036854775808, 1, 39065, 0xc723bf8b, F=0x0
0, 60, -9223372036854775808, 1, 8611, 0x5d177f40
0, 61, -9223372036854775808, 1, 3758, 0x33d59966
0, 62, -9223372036854775808, 1, 3674, 0x54f37902
0, 63, -9223372036854775808, 1, 3615, 0xa0f045fa
0, 64, -9223372036854775808, 1, 3719, 0x41cf93ff
0, 65, -9223372036854775808, 1, 3757, 0x3a1b7e8f
0, 66, -9223372036854775808, 1, 3762, 0xe7f9714d
0, 67, -9223372036854775808, 1, 3738, 0x8121805b
0, 68, -9223372036854775808, 1, 3733, 0x13e262db
0, 69, -9223372036854775808, 1, 38433, 0x3d58c500
0, 61, -9223372036854775808, 1, 3758, 0x33d59966, F=0x0
0, 62, -9223372036854775808, 1, 3674, 0x54f37902, F=0x0
0, 63, -9223372036854775808, 1, 3615, 0xa0f045fa, F=0x0
0, 64, -9223372036854775808, 1, 3719, 0x41cf93ff, F=0x0
0, 65, -9223372036854775808, 1, 3757, 0x3a1b7e8f, F=0x0
0, 66, -9223372036854775808, 1, 3762, 0xe7f9714d, F=0x0
0, 67, -9223372036854775808, 1, 3738, 0x8121805b, F=0x0
0, 68, -9223372036854775808, 1, 3733, 0x13e262db, F=0x0
0, 69, -9223372036854775808, 1, 38433, 0x3d58c500, F=0x0
0, 70, -9223372036854775808, 1, 8410, 0xa4f7fd2e
0, 71, -9223372036854775808, 1, 3711, 0x0e112d3c
0, 72, -9223372036854775808, 1, 3692, 0xb46574b2
0, 73, -9223372036854775808, 1, 3563, 0xad43343d
0, 74, -9223372036854775808, 1, 3613, 0x5cd85c4f
0, 75, -9223372036854775808, 1, 3653, 0xe15a2853
0, 76, -9223372036854775808, 1, 3684, 0x9ddd58cb
0, 77, -9223372036854775808, 1, 3256, 0xd7f89f2e
0, 78, -9223372036854775808, 1, 3698, 0x2b82624a
0, 79, -9223372036854775808, 1, 39520, 0xd3f2b7c5
0, 71, -9223372036854775808, 1, 3711, 0x0e112d3c, F=0x0
0, 72, -9223372036854775808, 1, 3692, 0xb46574b2, F=0x0
0, 73, -9223372036854775808, 1, 3563, 0xad43343d, F=0x0
0, 74, -9223372036854775808, 1, 3613, 0x5cd85c4f, F=0x0
0, 75, -9223372036854775808, 1, 3653, 0xe15a2853, F=0x0
0, 76, -9223372036854775808, 1, 3684, 0x9ddd58cb, F=0x0
0, 77, -9223372036854775808, 1, 3256, 0xd7f89f2e, F=0x0
0, 78, -9223372036854775808, 1, 3698, 0x2b82624a, F=0x0
0, 79, -9223372036854775808, 1, 39520, 0xd3f2b7c5, F=0x0
0, 80, -9223372036854775808, 1, 8493, 0x163559be
0, 81, -9223372036854775808, 1, 3719, 0x6fa0916f
0, 82, -9223372036854775808, 1, 3655, 0xa9233de1
0, 83, -9223372036854775808, 1, 3684, 0xa6125737
0, 84, -9223372036854775808, 1, 3688, 0xa9da6686
0, 85, -9223372036854775808, 1, 3685, 0x674d634e
0, 86, -9223372036854775808, 1, 3677, 0x7a85535d
0, 87, -9223372036854775808, 1, 3666, 0xce3600a2
0, 88, -9223372036854775808, 1, 3837, 0x3a7090e1
0, 89, -9223372036854775808, 1, 38696, 0x12c59cd2
0, 81, -9223372036854775808, 1, 3719, 0x6fa0916f, F=0x0
0, 82, -9223372036854775808, 1, 3655, 0xa9233de1, F=0x0
0, 83, -9223372036854775808, 1, 3684, 0xa6125737, F=0x0
0, 84, -9223372036854775808, 1, 3688, 0xa9da6686, F=0x0
0, 85, -9223372036854775808, 1, 3685, 0x674d634e, F=0x0
0, 86, -9223372036854775808, 1, 3677, 0x7a85535d, F=0x0
0, 87, -9223372036854775808, 1, 3666, 0xce3600a2, F=0x0
0, 88, -9223372036854775808, 1, 3837, 0x3a7090e1, F=0x0
0, 89, -9223372036854775808, 1, 38696, 0x12c59cd2, F=0x0
0, 90, -9223372036854775808, 1, 8022, 0xd343433f
0, 91, -9223372036854775808, 1, 5157, 0x440c14e5
0, 92, -9223372036854775808, 1, 5003, 0xf8e1daff
0, 93, -9223372036854775808, 1, 4954, 0x89866344
0, 94, -9223372036854775808, 1, 53664, 0xeb0c4c42
0, 91, -9223372036854775808, 1, 5157, 0x440c14e5, F=0x0
0, 92, -9223372036854775808, 1, 5003, 0xf8e1daff, F=0x0
0, 93, -9223372036854775808, 1, 4954, 0x89866344, F=0x0
0, 94, -9223372036854775808, 1, 53664, 0xeb0c4c42, F=0x0

0 comments on commit dc82b2c

Please sign in to comment.