From dde3478561de3ababdac2cc071ed5bf5c955dc03 Mon Sep 17 00:00:00 2001
From: Kevin Wheatley <kevin.j.wheatley@gmail.com>
Date: Mon, 4 Nov 2019 13:50:22 +0000
Subject: [PATCH v2 1/3] avformat/movenc: Add command line option to set base
 mov file timescale

Signed-off-by: Kevin Wheatley <kevin.j.wheatley@gmail.com>
---
 libavformat/movenc.c | 1 +
 libavformat/movenc.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 715bec1..2790030 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -89,6 +89,7 @@ static const AVOption options[] = {
     { "min_frag_duration", "Minimum fragment duration", offsetof(MOVMuxContext, min_fragment_duration), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM},
     { "frag_size", "Maximum fragment size", offsetof(MOVMuxContext, max_fragment_size), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM},
     { "ism_lookahead", "Number of lookahead entries for ISM files", offsetof(MOVMuxContext, ism_lookahead), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM},
+    { "mov_timescale", "set timescale of mov container", offsetof(MOVMuxContext, mov_timescale), AV_OPT_TYPE_INT, {.i64 = MOV_TIMESCALE}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM},
     { "video_track_timescale", "set timescale of all video tracks", offsetof(MOVMuxContext, video_track_timescale), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM},
     { "brand",    "Override major brand", offsetof(MOVMuxContext, major_brand),   AV_OPT_TYPE_STRING, {.str = NULL}, .flags = AV_OPT_FLAG_ENCODING_PARAM },
     { "use_editlist", "use edit list", offsetof(MOVMuxContext, use_editlist), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, AV_OPT_FLAG_ENCODING_PARAM},
diff --git a/libavformat/movenc.h b/libavformat/movenc.h
index 68d6f23..1ab7216 100644
--- a/libavformat/movenc.h
+++ b/libavformat/movenc.h
@@ -204,6 +204,7 @@ typedef struct MOVMuxContext {
     AVIOContext *mdat_buf;
     int first_trun;
 
+    int mov_timescale;
     int video_track_timescale;
 
     int reserved_moov_size; ///< 0 for disabled, -1 for automatic, size otherwise
-- 
1.8.5.6

