aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/movenc.c
diff options
context:
space:
mode:
authorbbraun <bbraun@synack.net>2012-08-21 03:21:39 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-10-28 14:36:57 +0100
commitd72aef4e922b71fd00665c863b66682ac36fc264 (patch)
treed32786ff6a4d54269fa370c0606f44bb339c5f2b /libavformat/movenc.c
parentac090fa68c6233076508705d80090edb9eea4eed (diff)
downloadffmpeg-d72aef4e922b71fd00665c863b66682ac36fc264.tar.gz
movenc: add more metadata types
Fixes Ticket1052 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r--libavformat/movenc.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 7d50131d17..71037bd3c0 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -2012,6 +2012,24 @@ static int mov_write_trkn_tag(AVIOContext *pb, MOVMuxContext *mov,
return size;
}
+static int mov_write_int8_metadata(AVFormatContext *s, AVIOContext *pb,
+ const char *name, const char *tag,
+ int len)
+{
+ AVDictionaryEntry *t = NULL;
+ uint8_t num;
+
+ if (!(t = av_dict_get(s->metadata, tag, NULL, 0)))
+ return 0;
+ num = t ? atoi(t->value) : 0;
+
+ avio_wb32(pb, len+8);
+ ffio_wfourcc(pb, name);
+ if (len==4) avio_wb32(pb, num);
+ else avio_w8 (pb, num);
+ return len+8;
+}
+
/* iTunes meta data list */
static int mov_write_ilst_tag(AVIOContext *pb, MOVMuxContext *mov,
AVFormatContext *s)
@@ -2036,6 +2054,11 @@ static int mov_write_ilst_tag(AVIOContext *pb, MOVMuxContext *mov,
mov_write_string_metadata(s, pb, "tvsh", "show" , 1);
mov_write_string_metadata(s, pb, "tven", "episode_id",1);
mov_write_string_metadata(s, pb, "tvnn", "network" , 1);
+ mov_write_int8_metadata (s, pb, "tves", "episode_sort",4);
+ mov_write_int8_metadata (s, pb, "tvsn", "season_number",4);
+ mov_write_int8_metadata (s, pb, "stik", "media_type",1);
+ mov_write_int8_metadata (s, pb, "hdvd", "hd_video", 1);
+ mov_write_int8_metadata (s, pb, "pgap", "gapless_playback",1);
mov_write_trkn_tag(pb, mov, s);
mov_write_tmpo_tag(pb, s);
return update_size(pb, pos);