[FFmpeg-devel] [PATCH] ffmpeg.c: Fallback to duration_dts, when duration_pts can't be determined.

Michael Niedermayer michael at niedermayer.cc
Thu Oct 12 02:28:01 EEST 2017


On Tue, Oct 10, 2017 at 10:26:13PM +0200, Thomas Mundt wrote:
> 2017-10-10 19:36 GMT+02:00 Sasi Inguva <isasi-at-google.com at ffmpeg.org>:
> 
> > This is required for FLV files, for which duration_pts comes out to be
> > zero.
> >
> > Signed-off-by: Sasi Inguva <isasi at google.com>
> > ---
> >  fftools/ffmpeg.c | 9 +++++++--
> >  1 file changed, 7 insertions(+), 2 deletions(-)
> >
> > diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
> > index 6d64bc1043..3ee31473dc 100644
> > --- a/fftools/ffmpeg.c
> > +++ b/fftools/ffmpeg.c
> > @@ -2665,8 +2665,13 @@ static int process_input_packet(InputStream *ist,
> > const AVPacket *pkt, int no_eo
> >                      ist->next_dts = AV_NOPTS_VALUE;
> >              }
> >
> > -            if (got_output)
> > -                ist->next_pts += av_rescale_q(duration_pts,
> > ist->st->time_base, AV_TIME_BASE_Q);
> > +            if (got_output) {
> > +                if (duration_pts > 0) {
> > +                    ist->next_pts += av_rescale_q(duration_pts,
> > ist->st->time_base, AV_TIME_BASE_Q);
> > +                } else {
> > +                    ist->next_pts += duration_dts;
> > +                }
> > +            }
> >              break;
> >          case AVMEDIA_TYPE_SUBTITLE:
> >              if (repeating)
> > --
> >
> 
> Patch LGTM.

will apply

thx

> Since before commit 36c111c40f4bd7da114df0e9c484833aa2cdf2dc duration_dts
> was generally used here, it should be ok as fallback.
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you drop bombs on a foreign country and kill a hundred thousand
innocent people, expect your government to call the consequence
"unprovoked inhuman terrorist attacks" and use it to justify dropping
more bombs and killing more people. The technology changed, the idea is old.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20171012/b03894be/attachment.sig>


More information about the ffmpeg-devel mailing list