[FFmpeg-devel] [PATCH] ffmpeg: replace missing PTS by DTS

Clément Bœsch u at pkh.me
Tue Sep 23 07:47:41 CEST 2014


On Tue, Sep 23, 2014 at 07:45:56AM +0200, Clément Bœsch wrote:
> On Tue, Sep 23, 2014 at 03:21:30AM +0200, Michael Niedermayer wrote:
> > This fixes the case where muxing fails hard in case of stream copying damaged input
> > 
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > ---
> >  ffmpeg.c |    8 ++++++++
> >  1 file changed, 8 insertions(+)
> > 
> > diff --git a/ffmpeg.c b/ffmpeg.c
> > index 47a4144..5492cfe 100644
> > --- a/ffmpeg.c
> > +++ b/ffmpeg.c
> > @@ -670,6 +670,14 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
> >                       - FFMIN3(pkt->pts, pkt->dts, ost->last_mux_dts + 1)
> >                       - FFMAX3(pkt->pts, pkt->dts, ost->last_mux_dts + 1);
> >          }
> > +        if (pkt->dts != AV_NOPTS_VALUE &&
> > +            pkt->pts == AV_NOPTS_VALUE &&
> > +            !(s->oformat->flags & AVFMT_TS_NONSTRICT)) { //FIXME use a AVFMT_TS_NEEDS_PTS
> > +            av_log(s, AV_LOG_WARNING, "PTS unknown, using DTS: %"PRId64" in output stream %d:%d\n",
> > +                   pkt->dts,
> > +                   ost->file_index, ost->st->index);
> > +            pkt->pts = pkt->dts;
> > +        }
> 
> why not abort with a AVERROR_BUG or something so we get report of such
> cases?
> 

Oh I'm sorry, I misread the patch, I thought it was about buggy muxers;
ignore my comment

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140923/6b7689f5/attachment.asc>


More information about the ffmpeg-devel mailing list