aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/md5enc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-07-16 22:34:56 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-07-16 22:50:24 +0200
commit7da2592f5677460118c10aa9accd89958c7304d8 (patch)
treea94bfefc0a625ece67f05acffaadcf6fc5179c4f /libavformat/md5enc.c
parent57641410d1a386937bec3fddd6c75119550916ec (diff)
downloadffmpeg-7da2592f5677460118c10aa9accd89958c7304d8.tar.gz
avformat/md5enc: add format_version, to allow selecting which version to use
Currently there is just version 1 Fixes remaining part of Ticket2280 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/md5enc.c')
-rw-r--r--libavformat/md5enc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/md5enc.c b/libavformat/md5enc.c
index 8b14fbaa0f..8e87f095c9 100644
--- a/libavformat/md5enc.c
+++ b/libavformat/md5enc.c
@@ -30,6 +30,7 @@ struct MD5Context {
const AVClass *avclass;
struct AVHashContext *hash;
char *hash_name;
+ int format_version;
};
static void md5_finish(struct AVFormatContext *s, char *buf)
@@ -55,6 +56,7 @@ static void md5_finish(struct AVFormatContext *s, char *buf)
#define ENC AV_OPT_FLAG_ENCODING_PARAM
static const AVOption hash_options[] = {
{ "hash", "set hash to use", OFFSET(hash_name), AV_OPT_TYPE_STRING, {.str = "md5"}, 0, 0, ENC },
+ { "format_version", "file format version", OFFSET(format_version), AV_OPT_TYPE_INT, {.i64 = 1}, 1, 1, ENC },
{ NULL },
};
@@ -118,7 +120,7 @@ static int framemd5_write_header(struct AVFormatContext *s)
if (res < 0)
return res;
avio_printf(s->pb, "#format: frame checksums\n");
- avio_printf(s->pb, "#version: 1\n");
+ avio_printf(s->pb, "#version: %d\n", c->format_version);
avio_printf(s->pb, "#hash: %s\n", av_hash_get_name(c->hash));
ff_framehash_write_header(s);
avio_printf(s->pb, "#stream#, dts, pts, duration, size, hash\n");