[FFmpeg-trac] #6695(undetermined:new): avformat_new_stream() and cur_dts

FFmpeg trac at avcodec.org
Tue Sep 26 04:37:15 EEST 2017


#6695: avformat_new_stream() and cur_dts
-------------------------------------+-------------------------------------
             Reporter:  jonsmirl     |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:  git-
  undetermined                       |  master
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 avformat_new_stream() is not initializing AVStream->cur_dts.  This causes
 problems down in av_interleaved_write_frame(), compute_muxer_pkt_fields()
 on this test since cur_dts is randomly set.

     if (st->cur_dts && st->cur_dts != AV_NOPTS_VALUE &&
         ((!(s->oformat->flags & AVFMT_TS_NONSTRICT) &&
           st->codecpar->codec_type != AVMEDIA_TYPE_SUBTITLE &&
           st->codecpar->codec_type != AVMEDIA_TYPE_DATA &&
           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: %s >= %s\n",
                st->index, av_ts2str(st->cur_dts), av_ts2str(pkt->dts));
         return AVERROR(EINVAL);
     }

 Changing my code like this makes it work as expected.

         out_stream = avformat_new_stream(ofmt_ctx, NULL);
         out_stream->cur_dts = AV_NOPTS_VALUE;

 I'm using git head from 9/24. This is a recent change since my code worked
 on older versions of ffmpeg.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/6695>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list