On Wed, 24 Apr 2013 18:55:52 +0200, Luca Barbato <[email protected]> wrote: > On 04/24/2013 05:29 PM, Anton Khirnov wrote: > > Hack partially based on a commit by Michael Niedermayer <[email protected]> > > Should fix (or work around) bug 458. > > --- > > avconv.c | 18 ++++++++++++++++++ > > avconv.h | 2 ++ > > avconv_opt.c | 1 + > > 3 files changed, 21 insertions(+) > > > > diff --git a/avconv.c b/avconv.c > > index 7aee0cb..5a52565 100644 > > --- a/avconv.c > > +++ b/avconv.c > > @@ -348,6 +348,24 @@ static void write_frame(AVFormatContext *s, AVPacket > > *pkt, OutputStream *ost) > > bsfc = bsfc->next; > > } > > > > + if (!(s->oformat->flags & AVFMT_NOTIMESTAMPS) && ost->last_mux_dts != > > AV_NOPTS_VALUE && > > + pkt->dts < ost->last_mux_dts + !(s->oformat->flags & > > AVFMT_TS_NONSTRICT)) { > > + av_log(NULL, AV_LOG_WARNING, "Non-monotonous DTS in output stream " > > + "%d:%d; previous: %"PRId64", current: %"PRId64"; ", > > + ost->file_index, ost->st->index, ost->last_mux_dts, > > pkt->dts); > > + if (exit_on_error) { > > + av_log(NULL, AV_LOG_FATAL, "aborting.\n"); > > + exit(1); > > + } > > Not sure what is better: having a proper check in the muxing layer under > a proper flag or try to make this lumpo of code at least moderately > formatted. (prize for doing a < b + boolean for getting <= ) > > As the code is a bit convoluted in the checks as is now. >
A proper check for what? I don't think lavf itself should try to be smart about this. And of course this is an ugly hack, but I think it is not too invasive and should be slightly better than failing completely. -- Anton Khirnov _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
