]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Change duration computation to use time_base instead of TB/2.
authorcehoyos <cehoyos@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Tue, 24 Feb 2009 20:17:02 +0000 (20:17 +0000)
committercehoyos <cehoyos@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Tue, 24 Feb 2009 20:17:02 +0000 (20:17 +0000)
Patch by Ivan Schreter, schreter gmx net

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@17570 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/avcodec.h
libavformat/utils.c

index cfe38c5edb7882ccc624ea46664ea16941c1b316..d4bbe29b82fa4eb1b718fc84f34133131976ee62 100644 (file)
@@ -3098,12 +3098,9 @@ typedef struct AVCodecParserContext {
      * It signals, how much longer the frame duration of the current frame
      * is compared to normal frame duration.
      *
-     * frame_duration = (2 + repeat_pict) / (2*fps)
+     * frame_duration = (1 + repeat_pict) * time_base
      *
      * It is used by codecs like H.264 to display telecined material.
-     *
-     * @note This field can also be set to -1 for half-frame duration in case
-     *       of field pictures.
      */
     int repeat_pict; /* XXX: Put it back in AVCodecContext. */
     int64_t pts;     /* pts of the current frame */
index 46a1b5f8bb7814616dc10597390141c29396f94b..61f74c3c18dfb9de506ab18034f3d138c30404ef 100644 (file)
@@ -680,10 +680,7 @@ static void compute_frame_duration(int *pnum, int *pden, AVStream *st,
             *pnum = st->codec->time_base.num;
             *pden = st->codec->time_base.den;
             if (pc && pc->repeat_pict) {
-                // NOTE: repeat_pict can be also -1 for half-frame durations,
-                // e.g., in H.264 interlaced field picture stream
-                *pden *= 2;
-                *pnum = (*pnum) * (2 + pc->repeat_pict);
+                *pnum = (*pnum) * (1 + pc->repeat_pict);
             }
         }
         break;