From eac243bc01100c73c4d8b3ec62464a4533fc9469 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 21 Dec 2010 13:19:38 +0100 Subject: [PATCH] vorbisdec: avoid using invalid timestamps --- ext/vorbis/gstvorbisdec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/vorbis/gstvorbisdec.c b/ext/vorbis/gstvorbisdec.c index efd0ba0557..e607ce1d92 100644 --- a/ext/vorbis/gstvorbisdec.c +++ b/ext/vorbis/gstvorbisdec.c @@ -827,7 +827,7 @@ vorbis_do_timestamps (GstVorbisDec * vd, GstBuffer * buf, gboolean reverse, GstClockTime timestamp, GstClockTime duration) { /* interpolate reverse */ - if (vd->last_timestamp != -1 && reverse) + if (vd->last_timestamp != -1 && duration != -1 && reverse) vd->last_timestamp -= duration; /* take buffer timestamp, use interpolated timestamp otherwise */ @@ -837,7 +837,7 @@ vorbis_do_timestamps (GstVorbisDec * vd, GstBuffer * buf, gboolean reverse, timestamp = vd->last_timestamp; /* interpolate forwards */ - if (vd->last_timestamp != -1 && !reverse) + if (vd->last_timestamp != -1 && duration != -1 && !reverse) vd->last_timestamp += duration; GST_BUFFER_TIMESTAMP (buf) = timestamp;