[FFmpeg-cvslog] r23171 - in branches/0.6: . doc/libavfilter.texi libavcodec/aandcttab.c libavcodec/arm/dsputil_iwmmxt_rnd_template.c libavcodec/atrac.c libavcodec/celp_filters.c libavcodec/celp_filters.h libavcode...

siretart subversion
Wed May 19 09:58:18 CEST 2010


Author: siretart
Date: Wed May 19 09:58:17 2010
New Revision: 23171

Log:
mov: Read nero chapters

backport r23020 by conrad

Modified:
   branches/0.6/   (props changed)
   branches/0.6/doc/libavfilter.texi   (props changed)
   branches/0.6/libavcodec/aandcttab.c   (props changed)
   branches/0.6/libavcodec/arm/dsputil_iwmmxt_rnd_template.c   (props changed)
   branches/0.6/libavcodec/atrac.c   (props changed)
   branches/0.6/libavcodec/celp_filters.c   (props changed)
   branches/0.6/libavcodec/celp_filters.h   (props changed)
   branches/0.6/libavcodec/celp_math.c   (props changed)
   branches/0.6/libavcodec/celp_math.h   (props changed)
   branches/0.6/libavcodec/dxva2.c   (props changed)
   branches/0.6/libavcodec/flacdata.c   (props changed)
   branches/0.6/libavcodec/flacdata.h   (props changed)
   branches/0.6/libavcodec/flacdec.c   (props changed)
   branches/0.6/libavcodec/get_bits.h   (props changed)
   branches/0.6/libavcodec/options.c   (props changed)
   branches/0.6/libavcodec/put_bits.h   (props changed)
   branches/0.6/libavcodec/vdpau.h   (props changed)
   branches/0.6/libavcodec/vp6dsp.c   (props changed)
   branches/0.6/libavcodec/x86/   (props changed)
   branches/0.6/libavcodec/x86/dsputil_mmx_avg_template.c   (props changed)
   branches/0.6/libavcodec/x86/dsputil_mmx_qns_template.c   (props changed)
   branches/0.6/libavcodec/x86/dsputil_mmx_rnd_template.c   (props changed)
   branches/0.6/libavcodec/x86/lpc_mmx.c   (props changed)
   branches/0.6/libavdevice/oss_audio.c   (props changed)
   branches/0.6/libavformat/aiff.h   (props changed)
   branches/0.6/libavformat/aiffdec.c   (props changed)
   branches/0.6/libavformat/aiffenc.c   (props changed)
   branches/0.6/libavformat/apetag.c   (props changed)
   branches/0.6/libavformat/asf.c   (props changed)
   branches/0.6/libavformat/asfenc.c   (props changed)
   branches/0.6/libavformat/flacdec.c   (props changed)
   branches/0.6/libavformat/flacenc.c   (props changed)
   branches/0.6/libavformat/flacenc.h   (props changed)
   branches/0.6/libavformat/flacenc_header.c   (props changed)
   branches/0.6/libavformat/metadata.c   (props changed)
   branches/0.6/libavformat/metadata.h   (props changed)
   branches/0.6/libavformat/mov.c
   branches/0.6/libavformat/mxf.c   (props changed)
   branches/0.6/libavformat/mxf.h   (props changed)
   branches/0.6/libavformat/mxfdec.c   (props changed)
   branches/0.6/libavformat/options.c   (props changed)
   branches/0.6/libavformat/rtpdec.h   (props changed)
   branches/0.6/libavformat/rtpenc.h   (props changed)
   branches/0.6/libavformat/rtpenc_aac.c   (props changed)
   branches/0.6/libavformat/rtpenc_amr.c   (props changed)
   branches/0.6/libavformat/rtpenc_h263.c   (props changed)
   branches/0.6/libavformat/rtpenc_mpv.c   (props changed)
   branches/0.6/libavutil/avstring.c   (props changed)
   branches/0.6/libavutil/pixdesc.c   (props changed)
   branches/0.6/libavutil/pixdesc.h   (props changed)
   branches/0.6/libavutil/pixfmt.h   (props changed)
   branches/0.6/libavutil/sha.c   (props changed)
   branches/0.6/libavutil/sha.h   (props changed)
   branches/0.6/libavutil/timer.h   (props changed)
   branches/0.6/tests/lavf-regression.sh   (props changed)
   branches/0.6/tests/lavfi-regression.sh   (props changed)
   branches/0.6/tests/regression-funcs.sh   (props changed)

Modified: branches/0.6/libavformat/mov.c
==============================================================================
--- branches/0.6/libavformat/mov.c	Wed May 19 08:46:50 2010	(r23170)
+++ branches/0.6/libavformat/mov.c	Wed May 19 09:58:17 2010	(r23171)
@@ -219,6 +219,36 @@ static int mov_read_udta_string(MOVConte
     return 0;
 }
 
+static int mov_read_chpl(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
+{
+    int64_t start;
+    int i, nb_chapters, str_len;
+    char str[256+1];
+
+    if ((atom.size -= 5) < 0)
+        return 0;
+
+    get_be32(pb); // version + flags
+    get_be32(pb); // ???
+    nb_chapters = get_byte(pb);
+
+    for (i = 0; i < nb_chapters; i++) {
+        if (atom.size < 9)
+            return 0;
+
+        start = get_be64(pb);
+        str_len = get_byte(pb);
+
+        if ((atom.size -= 9+str_len) < 0)
+            return 0;
+
+        get_buffer(pb, str, str_len);
+        str[str_len] = 0;
+        ff_new_chapter(c->fc, i, (AVRational){1,10000000}, start, AV_NOPTS_VALUE, str);
+    }
+    return 0;
+}
+
 static int mov_read_default(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
 {
     int64_t total_size = 0;
@@ -2166,6 +2196,7 @@ static int mov_read_elst(MOVContext *c, 
 
 static const MOVParseTableEntry mov_default_parse_table[] = {
 { MKTAG('a','v','s','s'), mov_read_extradata },
+{ MKTAG('c','h','p','l'), mov_read_chpl },
 { MKTAG('c','o','6','4'), mov_read_stco },
 { MKTAG('c','t','t','s'), mov_read_ctts }, /* composition time to sample */
 { MKTAG('d','i','n','f'), mov_read_default },



More information about the ffmpeg-cvslog mailing list