Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[gst-plugins-base] Fix appsrc based pipelines reporting the wrong dur…
…ation. Fixes JB#37547
  • Loading branch information
adenexter authored and Andrew Branson committed Apr 21, 2017
1 parent 997375b commit 5f2461e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
@@ -0,0 +1,27 @@
From 6cfd94d8f9396da2d4769722222fb0f64713b3c1 Mon Sep 17 00:00:00 2001
From: Andrew den Exter <andrew.den.exter@jolla.com>
Date: Fri, 21 Apr 2017 18:24:59 +1000
Subject: [PATCH] Fix pipelines with appsrc returning incorrect durations.

Allow downstream elements to try and provide the duration if the
duration property is not set or equal to GST_CLOCK_TIME_NONE.
---
gst-libs/gst/app/gstappsrc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gst-libs/gst/app/gstappsrc.c b/gst-libs/gst/app/gstappsrc.c
index 5a44a45..6959af6 100644
--- a/gst-libs/gst/app/gstappsrc.c
+++ b/gst-libs/gst/app/gstappsrc.c
@@ -956,7 +956,7 @@ gst_app_src_query (GstBaseSrc * src, GstQuery * query)
if (format == GST_FORMAT_BYTES) {
gst_query_set_duration (query, format, priv->size);
res = TRUE;
- } else if (format == GST_FORMAT_TIME) {
+ } else if (format == GST_FORMAT_TIME && priv->duration != GST_CLOCK_TIME_NONE) {
gst_query_set_duration (query, format, priv->duration);
res = TRUE;
} else {
--
2.9.3

2 changes: 2 additions & 0 deletions rpm/gst-plugins-base.spec
Expand Up @@ -10,6 +10,7 @@ Group: Applications/Multimedia
License: LGPLv2+
URL: http://gstreamer.freedesktop.org/
Source: http://gstreamer.freedesktop.org/src/gst-plugins-base/gstreamer1.0-plugins-base-%{version}.tar.xz
Patch0: 0001-Fix-pipelines-with-appsrc-returning-incorrect-durati.patch

%define sonamever %(echo %{version} | cut -d '+' -f 1)

Expand Down Expand Up @@ -53,6 +54,7 @@ GStreamer Plugins Base library applications

%prep
%setup -q -n gstreamer1.0-plugins-base-%{version}/gst-plugins-base
%patch0 -p1

%build
NOCONFIGURE=1 ./autogen.sh
Expand Down

0 comments on commit 5f2461e

Please sign in to comment.