[FFmpeg-devel,1/2] avformat/mov: add mov_metadata_int16()

Submitted by Moritz Barsnick on Sept. 19, 2018, 1:45 p.m.

Details

Message ID 0baf3fe87ad4b69ab5f237c1db08be3f403e5644.1537362628.git.barsnick@gmx.net
State New
Headers show

Commit Message

Moritz Barsnick Sept. 19, 2018, 1:45 p.m.
Allows to read 16-bit integer atoms (currently only tmpo known to
be such).

Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
---
 libavformat/mov.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Patch hide | download patch | download mbox

diff --git a/libavformat/mov.c b/libavformat/mov.c
index ec57a05803..03c39d0e5d 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -111,6 +111,15 @@  static int mov_metadata_int8_bypass_padding(MOVContext *c, AVIOContext *pb,
     return 0;
 }
 
+static int mov_metadata_int16(MOVContext *c, AVIOContext *pb,
+                                         unsigned len, const char *key)
+{
+    c->fc->event_flags |= AVFMT_EVENT_FLAG_METADATA_UPDATED;
+    av_dict_set_int(&c->fc->metadata, key, avio_rb16(pb), 0);
+
+    return 0;
+}
+
 static int mov_metadata_int8_no_padding(MOVContext *c, AVIOContext *pb,
                                         unsigned len, const char *key)
 {