if (vd->last_timestamp != -1 && duration != -1 && !reverse)
vd->last_timestamp += duration;
- GST_BUFFER_TIMESTAMP (buf) = timestamp;
- GST_BUFFER_DURATION (buf) = duration;
+ GST_LOG_OBJECT (vd,
+ "keeping timestamp %" GST_TIME_FORMAT " ts %" GST_TIME_FORMAT " dur %"
+ GST_TIME_FORMAT, GST_TIME_ARGS (vd->last_timestamp),
+ GST_TIME_ARGS (timestamp), GST_TIME_ARGS (duration));
+
+ if (buf) {
+ GST_BUFFER_TIMESTAMP (buf) = timestamp;
+ GST_BUFFER_DURATION (buf) = duration;
+ }
}
static GstFlowReturn
{
vorbis_sample_t **pcm;
guint sample_count;
- GstBuffer *out;
+ GstBuffer *out = NULL;
GstFlowReturn result;
gint size;
result = vorbis_dec_push_reverse (vd, out);
done:
+ if (out == NULL) {
+ /* no output, still keep track of timestamps */
+ vorbis_do_timestamps (vd, NULL, FALSE, timestamp, duration);
+ }
vorbis_synthesis_read (&vd->vd, sample_count);
return result;