summaryrefslogtreecommitdiff
path: root/libavformat/movenc.c
diff options
context:
space:
mode:
authorGyan Doshi <ffmpeg@gyani.pro>2018-06-21 11:33:00 +0530
committerGyan Doshi <ffmpeg@gyani.pro>2018-06-21 11:33:00 +0530
commitdeb9a04d54045c8021816cfe019bf2bba0e9595d (patch)
tree687b920fbaccd6a3f739f60d170c06f698c5d5fc /libavformat/movenc.c
parent649d7ca47780523673bbfe43407b9cb71c4ad811 (diff)
avformat/movenc: allow hdlr name field to be empty
Both QTFF and the ISOBMFF standards allow it. Fixes #7262
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r--libavformat/movenc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 3661d24f4f..e2c5613f98 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -101,6 +101,7 @@ static const AVOption options[] = {
{ "write_prft", "Write producer reference time box with specified time source", offsetof(MOVMuxContext, write_prft), AV_OPT_TYPE_INT, {.i64 = MOV_PRFT_NONE}, 0, MOV_PRFT_NB-1, AV_OPT_FLAG_ENCODING_PARAM, "prft"},
{ "wallclock", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = MOV_PRFT_SRC_WALLCLOCK}, 0, 0, AV_OPT_FLAG_ENCODING_PARAM, "prft"},
{ "pts", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = MOV_PRFT_SRC_PTS}, 0, 0, AV_OPT_FLAG_ENCODING_PARAM, "prft"},
+ { "empty_hdlr_name", "write zero-length name string in hdlr atoms within mdia and minf atoms", offsetof(MOVMuxContext, empty_hdlr_name), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM},
{ NULL },
};
@@ -2551,6 +2552,7 @@ static int is_clcp_track(MOVTrack *track)
static int mov_write_hdlr_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *track)
{
+ MOVMuxContext *mov = s->priv_data;
const char *hdlr, *descr = NULL, *hdlr_type = NULL;
int64_t pos = avio_tell(pb);
@@ -2605,6 +2607,9 @@ static int mov_write_hdlr_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *tra
}
}
+ if (mov->empty_hdlr_name) /* expressly allowed by QTFF and not prohibited in ISO 14496-12 8.4.3.3 */
+ descr = "";
+
avio_wb32(pb, 0); /* size */
ffio_wfourcc(pb, "hdlr");
avio_wb32(pb, 0); /* Version & flags */