Re: [FFmpeg-devel] [PATCH 1/3] avformat/mov: Only set pkt->duration to non negative values

2018-06-14 Thread Michael Niedermayer
On Thu, Jun 14, 2018 at 09:13:19AM -0700, Sasi Inguva wrote:
> looks good to me

thx, will apply


[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The worst form of inequality is to try to make unequal things equal.
-- Aristotle


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/3] avformat/mov: Only set pkt->duration to non negative values

2018-06-14 Thread Sasi Inguva
looks good to me

On Wed, Jun 13, 2018 at 10:11 AM Michael Niedermayer 
wrote:

> Signed-off-by: Michael Niedermayer 
> ---
>  libavformat/mov.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index 5d9ffa69a3..0acf981aef 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -7586,7 +7586,9 @@ static int mov_read_packet(AVFormatContext *s,
> AVPacket *pkt)
>  } else {
>  int64_t next_dts = (sc->current_sample < st->nb_index_entries) ?
>  st->index_entries[sc->current_sample].timestamp :
> st->duration;
> -pkt->duration = next_dts - pkt->dts;
> +
> +if (next_dts >= pkt->dts)
> +pkt->duration = next_dts - pkt->dts;
>  pkt->pts = pkt->dts;
>  }
>  if (st->discard == AVDISCARD_ALL)
> --
> 2.17.1
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 1/3] avformat/mov: Only set pkt->duration to non negative values

2018-06-13 Thread Michael Niedermayer
Signed-off-by: Michael Niedermayer 
---
 libavformat/mov.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 5d9ffa69a3..0acf981aef 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -7586,7 +7586,9 @@ static int mov_read_packet(AVFormatContext *s, AVPacket 
*pkt)
 } else {
 int64_t next_dts = (sc->current_sample < st->nb_index_entries) ?
 st->index_entries[sc->current_sample].timestamp : st->duration;
-pkt->duration = next_dts - pkt->dts;
+
+if (next_dts >= pkt->dts)
+pkt->duration = next_dts - pkt->dts;
 pkt->pts = pkt->dts;
 }
 if (st->discard == AVDISCARD_ALL)
-- 
2.17.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel