summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Crête <olivier.crete@collabora.com>2013-09-18 20:42:55 -0400
committerSebastian Dröge <slomo@circular-chaos.org>2013-09-19 09:52:48 +0200
commitc10311ba70459baa6f299b8206ee183480074814 (patch)
treeae9726a364a0558bd78d91fc136099cb0616cbfa
parentdeb43fdd399d1302fe9bd34a56f483396ddce362 (diff)
videodecoder: If there is no PTS at all, assume it starts from the segment start
This is to make the multifilesrc ! pngdec case work https://bugzilla.gnome.org/show_bug.cgi?id=688043
-rw-r--r--gst-libs/gst/video/gstvideodecoder.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gst-libs/gst/video/gstvideodecoder.c b/gst-libs/gst/video/gstvideodecoder.c
index 1f33f0e6c..67582672d 100644
--- a/gst-libs/gst/video/gstvideodecoder.c
+++ b/gst-libs/gst/video/gstvideodecoder.c
@@ -2290,10 +2290,12 @@ gst_video_decoder_prepare_finish_frame (GstVideoDecoder *
if (frame->pts == GST_CLOCK_TIME_NONE) {
/* Last ditch timestamp guess: Just add the duration to the previous
- * frame */
- if (priv->last_timestamp_out != GST_CLOCK_TIME_NONE &&
- frame->duration != GST_CLOCK_TIME_NONE) {
- frame->pts = priv->last_timestamp_out + frame->duration;
+ * frame. If it's the first frame, just use the segment start. */
+ if (frame->duration != GST_CLOCK_TIME_NONE) {
+ if (GST_CLOCK_TIME_IS_VALID (priv->last_timestamp_out))
+ frame->pts = priv->last_timestamp_out + frame->duration;
+ else
+ frame->pts = decoder->output_segment.start;
GST_LOG_OBJECT (decoder,
"Guessing timestamp %" GST_TIME_FORMAT " for frame...",
GST_TIME_ARGS (frame->pts));