From f865729e95279d715762660ee4cbfcccdcd0de9b Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Wed, 13 Jun 2012 01:58:05 +1000 Subject: [PATCH] videodecoder: Fix initial timestamp in ogg, and a warning. Don't replace the initial frame's timestamp with a bogus one calculated from the (incorrect for Ogg) frame number just because the 'sync time' hasn't changed. Also, don't output a bogus warning about the output_frame being NULL when it's being dropped/skipped due to QoS. --- gst-libs/gst/video/gstvideodecoder.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gst-libs/gst/video/gstvideodecoder.c b/gst-libs/gst/video/gstvideodecoder.c index 04c47a0bb5..14d711b398 100644 --- a/gst-libs/gst/video/gstvideodecoder.c +++ b/gst-libs/gst/video/gstvideodecoder.c @@ -1774,7 +1774,7 @@ gst_video_decoder_new_frame (GstVideoDecoder * decoder) static void gst_video_decoder_prepare_finish_frame (GstVideoDecoder * - decoder, GstVideoCodecFrame * frame) + decoder, GstVideoCodecFrame * frame, gboolean dropping) { GstVideoDecoderPrivate *priv = decoder->priv; GList *l, *events = NULL; @@ -1816,7 +1816,7 @@ gst_video_decoder_prepare_finish_frame (GstVideoDecoder * /* If the frame is meant to be outputted but we don't have an output buffer * we have a problem :) */ - if (G_UNLIKELY (frame->output_buffer == NULL)) + if (G_UNLIKELY ((frame->output_buffer == NULL) && !dropping)) goto no_output_buffer; if (GST_CLOCK_TIME_IS_VALID (frame->pts)) { @@ -1826,7 +1826,7 @@ gst_video_decoder_prepare_finish_frame (GstVideoDecoder * GST_TIME_ARGS (frame->pts), GST_TIME_ARGS (frame->pts - decoder->output_segment.start)); priv->timestamp_offset = frame->pts; - } else { + } else if (GST_CLOCK_TIME_IS_VALID (priv->last_timestamp)) { /* This case is for one initial timestamp and no others, e.g., * filesrc ! decoder ! xvimagesink */ GST_WARNING_OBJECT (decoder, "sync timestamp didn't change, ignoring"); @@ -1912,7 +1912,7 @@ gst_video_decoder_drop_frame (GstVideoDecoder * dec, GstVideoCodecFrame * frame) GST_VIDEO_DECODER_STREAM_LOCK (dec); - gst_video_decoder_prepare_finish_frame (dec, frame); + gst_video_decoder_prepare_finish_frame (dec, frame, TRUE); GST_DEBUG_OBJECT (dec, "dropping frame %" GST_TIME_FORMAT, GST_TIME_ARGS (frame->pts)); @@ -1976,7 +1976,7 @@ gst_video_decoder_finish_frame (GstVideoDecoder * decoder, GST_VIDEO_DECODER_STREAM_LOCK (decoder); - gst_video_decoder_prepare_finish_frame (decoder, frame); + gst_video_decoder_prepare_finish_frame (decoder, frame, FALSE); priv->processed++; /* no buffer data means this frame is skipped */ if (!frame->output_buffer || GST_VIDEO_CODEC_FRAME_IS_DECODE_ONLY (frame)) {