diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-06-14 00:30:25 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-06-15 18:07:03 +0200 |
commit | 153b5fb2fdef712434259218eefbbd704545b9b7 (patch) | |
tree | 9c6d2f311193993d035303fe2fb2f8cd1c4e2202 /libavformat/framecrcenc.c | |
parent | 29f427c2397befc369a45999f24fc34d848510ea (diff) | |
download | ffmpeg-153b5fb2fdef712434259218eefbbd704545b9b7.tar.gz |
avformat/framecrcenc: print the checksum and size of extradata as well
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/framecrcenc.c')
-rw-r--r-- | libavformat/framecrcenc.c | 18 |
1 files changed, 17 insertions, 1 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, |