From 9b6e819247fef4defd63ffc20d5173149675c744 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Sun, 3 Apr 2011 22:35:13 +0200 Subject: [PATCH] basevideodecoder: handle missing framerate when calculating timestamp --- gst-libs/gst/video/gstbasevideodecoder.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gst-libs/gst/video/gstbasevideodecoder.c b/gst-libs/gst/video/gstbasevideodecoder.c index 8064183c94..16c35ecd6f 100644 --- a/gst-libs/gst/video/gstbasevideodecoder.c +++ b/gst-libs/gst/video/gstbasevideodecoder.c @@ -1553,7 +1553,7 @@ gst_base_video_decoder_get_timestamp (GstBaseVideoDecoder * base_video_decoder, { GstVideoState *state = &GST_BASE_VIDEO_CODEC (base_video_decoder)->state; - if (state->fps_d == 0) { + if (state->fps_d == 0 || state->fps_n == 0) { return -1; } if (picture_number < base_video_decoder->base_picture_number) { @@ -1574,7 +1574,7 @@ gst_base_video_decoder_get_field_timestamp (GstBaseVideoDecoder * { GstVideoState *state = &GST_BASE_VIDEO_CODEC (base_video_decoder)->state; - if (state->fps_d == 0) { + if (state->fps_d == 0 || state->fps_n == 0) { return GST_CLOCK_TIME_NONE; } if (field_offset < 0) { @@ -1592,7 +1592,7 @@ gst_base_video_decoder_get_field_duration (GstBaseVideoDecoder * { GstVideoState *state = &GST_BASE_VIDEO_CODEC (base_video_decoder)->state; - if (state->fps_d == 0) { + if (state->fps_d == 0 || state->fps_n == 0) { return GST_CLOCK_TIME_NONE; } if (n_fields < 0) {