aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-03-23 04:05:56 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-03-23 04:05:56 +0100
commitefe259a27e56ae2f68b924a7d24b08b69b3badc8 (patch)
tree0ab9c9ba528b0c7a02c0bb3834f1933780f5436b
parent49f11e12d5afa9cd800f3e2f753d83595d5cff5c (diff)
parent29d61d73b1cbf0dcd1f79bc49c7df01b0a377c85 (diff)
downloadffmpeg-efe259a27e56ae2f68b924a7d24b08b69b3badc8.tar.gz
Merge commit '29d61d73b1cbf0dcd1f79bc49c7df01b0a377c85' into release/2.2
* commit '29d61d73b1cbf0dcd1f79bc49c7df01b0a377c85': movenc: Allow override of major brand in ftyp atom Conflicts: libavformat/movenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/movenc.c5
-rw-r--r--libavformat/movenc.h2
2 files changed, 6 insertions, 1 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index ce7ca6f35b..01bc3c9535 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -67,6 +67,7 @@ static const AVOption options[] = {
{ "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},
{ "use_editlist", "use edit list", offsetof(MOVMuxContext, use_editlist), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 1, 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 },
{ NULL },
};
@@ -2960,7 +2961,9 @@ static int mov_write_ftyp_tag(AVIOContext *pb, AVFormatContext *s)
avio_wb32(pb, 0); /* size */
ffio_wfourcc(pb, "ftyp");
- if (mov->mode == MODE_3GP) {
+ if (mov->major_brand && strlen(mov->major_brand) >= 4)
+ ffio_wfourcc(pb, mov->major_brand);
+ else if (mov->mode == MODE_3GP) {
ffio_wfourcc(pb, has_h264 ? "3gp6" : "3gp4");
minor = has_h264 ? 0x100 : 0x200;
} else if (mov->mode & MODE_3G2) {
diff --git a/libavformat/movenc.h b/libavformat/movenc.h
index 09f3ea772c..a72ce53ab3 100644
--- a/libavformat/movenc.h
+++ b/libavformat/movenc.h
@@ -173,6 +173,8 @@ typedef struct MOVMuxContext {
int reserved_moov_size; ///< 0 for disabled, -1 for automatic, size otherwise
int64_t reserved_moov_pos;
+
+ char *major_brand;
} MOVMuxContext;
#define FF_MOV_FLAG_RTP_HINT 1