[FFmpeg-trac] #177(FFmpeg:open): "non monotone timestamps" error patch

FFmpeg trac at avcodec.org
Mon Jun 27 20:58:11 CEST 2011


#177: "non monotone timestamps" error patch
-------------------------------+---------------------
Reporter:  andrixnet           |       Owner:
    Type:  defect              |      Status:  open
Priority:  minor               |   Component:  FFmpeg
 Version:  unspecified         |  Resolution:
Keywords:  monotone timestamp  |  Blocked By:
Blocking:                      |  Reproduced:  0
Analyzed:  0                   |
-------------------------------+---------------------

Comment (by andrixnet):

 Taken from ~alien builds for Slackware :

 [http://connie.slackware.com/~alien/slackbuilds/ffmpeg/build/ffmpeg-HEAD-
 VP8_param_mapping.diff]

 Seems to do the job nicely, with the additions as michael said.

 {{{
 diff --git a/libavformat/avformat.h b/libavformat/avformat.h
 index 767356a..17418bc 100644
 --- a/libavformat/avformat.h
 +++ b/libavformat/avformat.h
 @@ -258,6 +258,9 @@ typedef struct AVFormatParameters {
  #define AVFMT_VARIABLE_FPS  0x0400 /**< Format allows variable fps. */
  #define AVFMT_NODIMENSIONS  0x0800 /**< Format does not need width/height
 */
  #define AVFMT_NOSTREAMS     0x1000 /**< Format does not require any
 streams */
 +#define AVFMT_TS_NONSTRICT  0x2000 /**< Format does not require strictly
 +                                        increasing timestamps, but they
 must
 +                                        still be monotonic */

  typedef struct AVOutputFormat {
      const char *name;
 diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
 index 5e4552a..2c846c8 100644
 --- a/libavformat/matroskaenc.c
 +++ b/libavformat/matroskaenc.c
 @@ -1199,7 +1199,7 @@ AVOutputFormat ff_webm_muxer = {
      mkv_write_header,
      mkv_write_packet,
      mkv_write_trailer,
 -    .flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS,
 +    .flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS |
 AVFMT_TS_NONSTRICT,
  };
  #endif

 diff --git a/libavformat/utils.c b/libavformat/utils.c
 index e7ce911..bc9d38f 100644
 --- a/libavformat/utils.c
 +++ b/libavformat/utils.c
 @@ -2901,7 +2901,7 @@ static int compute_pkt_fields2(AVFormatContext *s,
 AVStream *st, AVPacket *pkt){
          pkt->dts= st->pts_buffer[0];
      }

 -    if(st->cur_dts && st->cur_dts != AV_NOPTS_VALUE && st->cur_dts >=
 pkt->dts){
 +    if(st->cur_dts && st->cur_dts != AV_NOPTS_VALUE &&
 ((!(s->oformat->flags & AVFMT_TS_NONSTRICT) && st->cur_dts >= pkt->dts) ||
 st->cur_dts > pkt->dts)){
          av_log(s, AV_LOG_ERROR,
                 "Application provided invalid, non monotonically
 increasing dts to muxer in stream %d: %"PRId64" >= %"PRId64"\n",
                 st->index, st->cur_dts, pkt->dts);

 }}}

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/177#comment:6>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list