Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-10-26 20:50:36 +0300
committerJames Almer <jamrial@gmail.com>2017-10-26 21:21:59 +0300
commit4bb09bf5a04af7a76f8bb514edf7e755066b81cd (patch)
tree8b575bb470557d05f7b7e50e123bfb5a033bc8cd /libavformat/mov_esds.c
parent4576ee100b9e645ff3a63e36c500ea4b3001a198 (diff)
parent604fbb3132e88727e496c96c92cfe02748c25a1a (diff)
Merge commit '604fbb3132e88727e496c96c92cfe02748c25a1a'
* commit '604fbb3132e88727e496c96c92cfe02748c25a1a': mov: Move code shared with CAF to a separate file Merged-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/mov_esds.c')
-rw-r--r--libavformat/mov_esds.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/libavformat/mov_esds.c b/libavformat/mov_esds.c
new file mode 100644
index 0000000000..2ecf03742f
--- /dev/null
+++ b/libavformat/mov_esds.c
@@ -0,0 +1,43 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "avformat.h"
+#include "avio.h"
+#include "isom.h"
+
+int ff_mov_read_esds(AVFormatContext *fc, AVIOContext *pb)
+{
+ AVStream *st;
+ int tag;
+
+ if (fc->nb_streams < 1)
+ return 0;
+ st = fc->streams[fc->nb_streams-1];
+
+ avio_rb32(pb); /* version + flags */
+ ff_mp4_read_descr(fc, pb, &tag);
+ if (tag == MP4ESDescrTag) {
+ ff_mp4_parse_es_descr(pb, NULL);
+ } else
+ avio_rb16(pb); /* ID */
+
+ ff_mp4_read_descr(fc, pb, &tag);
+ if (tag == MP4DecConfigDescrTag)
+ ff_mp4_read_dec_config_descr(fc, st, pb);
+ return 0;
+}