summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-06-14 00:30:25 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-06-15 18:07:03 +0200
commit153b5fb2fdef712434259218eefbbd704545b9b7 (patch)
tree9c6d2f311193993d035303fe2fb2f8cd1c4e2202
parent29f427c2397befc369a45999f24fc34d848510ea (diff)
downloadffmpeg-153b5fb2fdef712434259218eefbbd704545b9b7.tar.gz
avformat/framecrcenc: print the checksum and size of extradata as well
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/framecrcenc.c18
-rw-r--r--tests/ref/fate/iv8-demux1
-rw-r--r--tests/ref/fate/lmlm4-demux1
-rw-r--r--tests/ref/fate/mkv2
-rw-r--r--tests/ref/fate/mtv1
-rw-r--r--tests/ref/fate/mxf-demux1
-rw-r--r--tests/ref/fate/nc-demux1
-rw-r--r--tests/ref/fate/sub2video1
-rw-r--r--tests/ref/fate/vqf-demux2
-rw-r--r--tests/ref/fate/wmv8-drm-nodec2
-rw-r--r--tests/ref/fate/wtv-demux2
-rw-r--r--tests/ref/fate/xmv-demux1
12 files changed, 31 insertions, 2 deletions
diff --git a/libavformat/framecrcenc.c b/libavformat/framecrcenc.c
index 4a96083953..805b5428f9 100644
--- a/libavformat/framecrcenc.c
+++ b/libavformat/framecrcenc.c
@@ -26,6 +26,22 @@
#include "avformat.h"
#include "internal.h"
+static int framecrc_write_header(struct AVFormatContext *s)
+{
+ int i;
+ for (i = 0; i < s->nb_streams; i++) {
+ AVStream *st = s->streams[i];
+ AVCodecContext *avctx = st->codec;
+ if (avctx->extradata) {
+ uint32_t crc = av_adler32_update(0, avctx->extradata, avctx->extradata_size);
+ avio_printf(s->pb, "#extradata %d: %8d, 0x%08"PRIx32"\n",
+ i, avctx->extradata_size, crc);
+ }
+ }
+
+ return ff_framehash_write_header(s);
+}
+
static int framecrc_write_packet(struct AVFormatContext *s, AVPacket *pkt)
{
uint32_t crc = av_adler32_update(0, pkt->data, pkt->size);
@@ -65,7 +81,7 @@ AVOutputFormat ff_framecrc_muxer = {
.long_name = NULL_IF_CONFIG_SMALL("framecrc testing"),
.audio_codec = AV_CODEC_ID_PCM_S16LE,
.video_codec = AV_CODEC_ID_RAWVIDEO,
- .write_header = ff_framehash_write_header,
+ .write_header = framecrc_write_header,
.write_packet = framecrc_write_packet,
.flags = AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT |
AVFMT_TS_NEGATIVE,
diff --git a/tests/ref/fate/iv8-demux b/tests/ref/fate/iv8-demux
index f13e691944..02b6314b4d 100644
--- a/tests/ref/fate/iv8-demux
+++ b/tests/ref/fate/iv8-demux
@@ -1,3 +1,4 @@
+#extradata 0: 19, 0x1f2604b9
#tb 0: 1/90000
0, 0, 0, 0, 20883, 0x347191e2
0, 0, 3600, 0, 20882, 0xe1573905
diff --git a/tests/ref/fate/lmlm4-demux b/tests/ref/fate/lmlm4-demux
index f8a6e21038..95df3e6126 100644
--- a/tests/ref/fate/lmlm4-demux
+++ b/tests/ref/fate/lmlm4-demux
@@ -1,3 +1,4 @@
+#extradata 0: 28, 0x2f140538
#tb 0: 1001/30000
#tb 1: 1/90000
0, 0, -9223372036854775808, 1, 5951, 0xe9118e0d
diff --git a/tests/ref/fate/mkv b/tests/ref/fate/mkv
index 78440b2eb1..84608fd343 100644
--- a/tests/ref/fate/mkv
+++ b/tests/ref/fate/mkv
@@ -1,3 +1,5 @@
+#extradata 0: 35, 0xc3b20b70
+#extradata 1: 2, 0x00b200a1
#tb 0: 1/1000
#tb 1: 1/1000
0, -42, 0, 0, 63501, 0x139d4c99
diff --git a/tests/ref/fate/mtv b/tests/ref/fate/mtv
index a781c0835a..9e898ff0b8 100644
--- a/tests/ref/fate/mtv
+++ b/tests/ref/fate/mtv
@@ -1,3 +1,4 @@
+#extradata 0: 9, 0x116c033a
#tb 0: 1/16
#tb 1: 1/44100
0, 0, 0, 1, 12288, 0xc2258ebc
diff --git a/tests/ref/fate/mxf-demux b/tests/ref/fate/mxf-demux
index 454722e673..3d9a2dc49d 100644
--- a/tests/ref/fate/mxf-demux
+++ b/tests/ref/fate/mxf-demux
@@ -1,3 +1,4 @@
+#extradata 0: 18, 0x0b150244
#tb 0: 1/25
#tb 1: 1/8000
0, 0, -9223372036854775808, 1, 8468, 0xc0855553
diff --git a/tests/ref/fate/nc-demux b/tests/ref/fate/nc-demux
index f03aded866..98318ac874 100644
--- a/tests/ref/fate/nc-demux
+++ b/tests/ref/fate/nc-demux
@@ -1,3 +1,4 @@
+#extradata 0: 19, 0x1afd0446
#tb 0: 1/100
0, 0, -9223372036854775808, 1, 19787, 0x75e463f3
0, 1, -9223372036854775808, 1, 11913, 0x0f429c34, F=0x0
diff --git a/tests/ref/fate/sub2video b/tests/ref/fate/sub2video
index 39d00c7746..1c6cdaf121 100644
--- a/tests/ref/fate/sub2video
+++ b/tests/ref/fate/sub2video
@@ -1,3 +1,4 @@
+#extradata 1: 150, 0x7c99258b
#tb 0: 1/5
#tb 1: 1/1000
0, 0, 0, 1, 518400, 0x83c27b82
diff --git a/tests/ref/fate/vqf-demux b/tests/ref/fate/vqf-demux
index 3acae60f5a..3c1dd35955 100644
--- a/tests/ref/fate/vqf-demux
+++ b/tests/ref/fate/vqf-demux
@@ -1 +1 @@
-d72fb75fb22f4bcc94a1dc7af5356ec1
+084a9bf92d4096c8156d1fce50dac8b8
diff --git a/tests/ref/fate/wmv8-drm-nodec b/tests/ref/fate/wmv8-drm-nodec
index 76c4e75bc5..279c8b66ae 100644
--- a/tests/ref/fate/wmv8-drm-nodec
+++ b/tests/ref/fate/wmv8-drm-nodec
@@ -1,3 +1,5 @@
+#extradata 0: 4, 0x021800a2
+#extradata 1: 46, 0x63d9043a
#tb 0: 1/1000
#tb 1: 1/1000
0, 0, 0, 0, 282, 0x000d949a
diff --git a/tests/ref/fate/wtv-demux b/tests/ref/fate/wtv-demux
index 362c55b9d4..904d78b068 100644
--- a/tests/ref/fate/wtv-demux
+++ b/tests/ref/fate/wtv-demux
@@ -1,3 +1,5 @@
+#extradata 0: 86, 0xc7ca09e5
+#extradata 1: 22, 0x12dc010c
#tb 0: 1/10000000
#tb 1: 1/10000000
1, -2, -2, 240000, 576, 0x9b6e1638
diff --git a/tests/ref/fate/xmv-demux b/tests/ref/fate/xmv-demux
index 49f22c98d7..d13270a6fc 100644
--- a/tests/ref/fate/xmv-demux
+++ b/tests/ref/fate/xmv-demux
@@ -1,3 +1,4 @@
+#extradata 0: 4, 0x015a00ad
#tb 0: 1/1000
#tb 1: 16/11025
0, 0, 0, 0, 1508, 0xefceba48