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.
This commit is contained in:
Jan Schmidt 2012-06-13 01:58:05 +10:00
parent d9740bf9ba
commit f865729e95

View File

@ -1774,7 +1774,7 @@ gst_video_decoder_new_frame (GstVideoDecoder * decoder)
static void static void
gst_video_decoder_prepare_finish_frame (GstVideoDecoder * gst_video_decoder_prepare_finish_frame (GstVideoDecoder *
decoder, GstVideoCodecFrame * frame) decoder, GstVideoCodecFrame * frame, gboolean dropping)
{ {
GstVideoDecoderPrivate *priv = decoder->priv; GstVideoDecoderPrivate *priv = decoder->priv;
GList *l, *events = NULL; 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 /* If the frame is meant to be outputted but we don't have an output buffer
* we have a problem :) */ * we have a problem :) */
if (G_UNLIKELY (frame->output_buffer == NULL)) if (G_UNLIKELY ((frame->output_buffer == NULL) && !dropping))
goto no_output_buffer; goto no_output_buffer;
if (GST_CLOCK_TIME_IS_VALID (frame->pts)) { 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),
GST_TIME_ARGS (frame->pts - decoder->output_segment.start)); GST_TIME_ARGS (frame->pts - decoder->output_segment.start));
priv->timestamp_offset = frame->pts; 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., /* This case is for one initial timestamp and no others, e.g.,
* filesrc ! decoder ! xvimagesink */ * filesrc ! decoder ! xvimagesink */
GST_WARNING_OBJECT (decoder, "sync timestamp didn't change, ignoring"); 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_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_DEBUG_OBJECT (dec, "dropping frame %" GST_TIME_FORMAT,
GST_TIME_ARGS (frame->pts)); 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_STREAM_LOCK (decoder);
gst_video_decoder_prepare_finish_frame (decoder, frame); gst_video_decoder_prepare_finish_frame (decoder, frame, FALSE);
priv->processed++; priv->processed++;
/* no buffer data means this frame is skipped */ /* no buffer data means this frame is skipped */
if (!frame->output_buffer || GST_VIDEO_CODEC_FRAME_IS_DECODE_ONLY (frame)) { if (!frame->output_buffer || GST_VIDEO_CODEC_FRAME_IS_DECODE_ONLY (frame)) {