]> git.sesse.net Git - ffmpeg/commitdiff
Add convergence_duration to AVCodecParserContext.
authorIvan Schreter <schreter@gmx.net>
Thu, 19 Feb 2009 23:35:59 +0000 (23:35 +0000)
committerCarl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at>
Thu, 19 Feb 2009 23:35:59 +0000 (23:35 +0000)
Patch by Ivan Schreter, schreter gmx net

Originally committed as revision 17468 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/avcodec.h
libavcodec/parser.c
libavformat/avformat.h
libavformat/utils.c

index e4f1831c85b25c809a21ce8552a9211ae828416a..b0ec18a49ca3551867a5eeadf34507b4264b218c 100644 (file)
@@ -30,7 +30,7 @@
 #include "libavutil/avutil.h"
 
 #define LIBAVCODEC_VERSION_MAJOR 52
-#define LIBAVCODEC_VERSION_MINOR 17
+#define LIBAVCODEC_VERSION_MINOR 18
 #define LIBAVCODEC_VERSION_MICRO  0
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
@@ -3033,6 +3033,23 @@ typedef struct AVCodecParserContext {
      * will be used.
      */
     int key_frame;
+
+    /**
+     * Time difference in stream time base units from the pts of this
+     * packet to the point at which the output from the decoder has converged
+     * independent from the availability of previous frames. That is, the
+     * frames are virtually identical no matter if decoding started from
+     * the very first frame or from this keyframe.
+     * Is AV_NOPTS_VALUE if unknown.
+     * This field is not the display duration of the current frame.
+     *
+     * The purpose of this field is to allow seeking in streams that have no
+     * keyframes in the conventional sense. It corresponds to the
+     * recovery point SEI in H.264 and match_time_delta in NUT. It is also
+     * essential for some types of subtitle streams to ensure that all
+     * subtitles are correctly displayed after seeking.
+     */
+    int64_t convergence_duration;
 } AVCodecParserContext;
 
 typedef struct AVCodecParser {
index db9b2363fe93c2bf282849fff97551758c2197d2..a0d604dabe90a158e492d1273477e7d98a52517d 100644 (file)
@@ -74,6 +74,7 @@ AVCodecParserContext *av_parser_init(int codec_id)
     s->fetch_timestamp=1;
     s->pict_type = FF_I_TYPE;
     s->key_frame = -1;
+    s->convergence_duration = AV_NOPTS_VALUE;
     return s;
 }
 
index 561e367a315c65942db7cc122331640033ba9157..2427f840771c04a94f904b1a0ef4238d8e1d55cf 100644 (file)
@@ -23,7 +23,7 @@
 
 #define LIBAVFORMAT_VERSION_MAJOR 52
 #define LIBAVFORMAT_VERSION_MINOR 29
-#define LIBAVFORMAT_VERSION_MICRO  1
+#define LIBAVFORMAT_VERSION_MICRO  2
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
                                                LIBAVFORMAT_VERSION_MINOR, \
index 2d66dced35572701e9965ebd1f5f214d93f3a89f..6fcca6ffbf2f20d57408260adddd892405ddfffb 100644 (file)
@@ -909,6 +909,8 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
         else if (pc->key_frame == -1 && pc->pict_type == FF_I_TYPE)
             pkt->flags |= PKT_FLAG_KEY;
     }
+    if (pc)
+        pkt->convergence_duration = pc->convergence_duration;
 }
 
 void av_destruct_packet_nofree(AVPacket *pkt)