[Ffmpeg-cvslog] CVS: ffmpeg/libavformat mov.c,1.101,1.102

Michael Niedermayer michaelni
Sat Mar 11 04:00:24 CET 2006


Hi

On Fri, Mar 10, 2006 at 06:35:59PM -0500, The Wanderer wrote:
> Michael Niedermayer wrote:
> 
> >Hi
> >
> >On Fri, Mar 10, 2006 at 03:23:06PM -0500, The Wanderer wrote:
> >
> >>Michael Niedermayer CVS wrote:
> >>
> >>>Update of /cvsroot/ffmpeg/ffmpeg/libavformat
> >>>In directory mail:/var2/tmp/cvs-serv12806
> >>>
> >>>Modified Files:
> >>>	mov.c 
> >>>Log Message:
> >>>simplify timebase if possible
> >>>ignore edit lists instead of always failing
> >>
> >><snip>
> >>
> >>>@@ -2109,8 +2125,13 @@
> >>>            pts = dts + duration;
> >>>        }else
> >>>            pts = dts;
> >>>-        pkt->pts = pts;
> >>>-        pkt->dts = dts;
> >>>+
> >>>+        st= s->streams[ sc->ffindex ];
> >>>+        assert(pts % st->time_base.num == 0);
> >>
> >>I have files which fail to play (in MPlayer with -demuxer lavf) on
> >>this assertion. Is there information I could provide which would be
> >>useful in tracking down why (the 'in case of a crashing bug'
> >>information doesn't seem obviously appropriate, since this isn't
> >>really a crash), or should I just upload one of the files to
> >>incoming/?
> >
> >hmm what values do st->time_base.num/den/pts have?
> 
> According to gdb, at the point at which the failure would occur:
> 
> st->time_base.num: 2048
> st->time_base.den: 48000
> pts: 4160
> 
> (Weirdly enough, attempting to 'step' forward from there to confirm that
> the failure does in fact occur immediately afterward resulted in gdb
> maxing my CPU with no output for the fifteen seconds or so before I
> interrupted it. It doesn't take nearly that long for a failure to occur
> when running the program independently...)

[...]

does the attached patch fix the issue?


[...]
-- 
Michael
-------------- next part --------------
Index: mov.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/mov.c,v
retrieving revision 1.118
diff -u -r1.118 mov.c
--- mov.c	4 Mar 2006 01:13:13 -0000	1.118
+++ mov.c	11 Mar 2006 02:55:48 -0000
@@ -1231,6 +1231,8 @@
 
 static int mov_read_ctts(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
 {
+    AVStream *st = c->fc->streams[c->fc->nb_streams-1];
+    MOVStreamContext *sc = (MOVStreamContext *)st->priv_data;
     unsigned int i, entries;
 
     get_byte(pb); /* version */
@@ -1239,14 +1241,19 @@
     if(entries >= UINT_MAX / sizeof(Time2Sample))
         return -1;
 
-    c->streams[c->fc->nb_streams-1]->ctts_count = entries;
-    c->streams[c->fc->nb_streams-1]->ctts_data = av_malloc(entries * sizeof(Time2Sample));
+    sc->ctts_count = entries;
+    sc->ctts_data = av_malloc(entries * sizeof(Time2Sample));
 
     dprintf("track[%i].ctts.entries = %i\n", c->fc->nb_streams-1, entries);
 
     for(i=0; i<entries; i++) {
-        c->streams[c->fc->nb_streams - 1]->ctts_data[i].count= get_be32(pb);
-        c->streams[c->fc->nb_streams - 1]->ctts_data[i].duration= get_be32(pb);
+        int count    =get_be32(pb);
+        int duration =get_be32(pb);
+
+        sc->ctts_data[i].count   = count;
+        sc->ctts_data[i].duration= duration;
+
+        sc->time_rate= ff_gcd(sc->time_rate, duration);
     }
     return 0;
 }



More information about the ffmpeg-cvslog mailing list