After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 674080 - dvbsrc internal data flow error
dvbsrc internal data flow error
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
0.10.22
Other Linux
: Normal normal
: 0.10.24
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-04-13 21:35 UTC by Frankie Eymard
Modified: 2012-06-15 15:27 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Frankie Eymard 2012-04-13 21:35:44 UTC
The code has changed in 0.10.23 but the rootcause remains i.e. unlock() spec is not fulfilled: 

"Unlock any pending access to the resource. Subclasses should unblock any blocked function ASAP. In particular, any create() function in progress should be unblocked and should return GST_FLOW_WRONG_STATE. Any future create() function call should also return GST_FLOW_WRONG_STATE until the unlock_stop() function has been called."
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-libs/html/GstBaseSrc.html

gst_dvbsrc_unlock() calls gst_poll_set_flushing() with flushing set to TRUE
http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/sys/dvb/gstdvbsrc.c?id=RELEASE-0.10.23#n1090

gst_poll_wait() returns -1, with errno set to EBUSY
http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/sys/dvb/gstdvbsrc.c?id=RELEASE-0.10.23#n921

gst_dvbsrc_read_device() returns NULL
http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/sys/dvb/gstdvbsrc.c?id=RELEASE-0.10.23#n953

gst_dvbsrc_create() returns GST_FLOW_ERROR instead of GST_FLOW_WRONG_STATE
http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/sys/dvb/gstdvbsrc.c?id=RELEASE-0.10.23#n966

My patch for 0.10.22 follows.

diff -dur gst-plugins-bad-0.10.22/sys/dvb/gstdvbsrc.c gst-plugins-bad-0.10.22-patch/sys/dvb/gstdvbsrc.c
--- gst-plugins-bad-0.10.22/sys/dvb/gstdvbsrc.c    2011-02-20 22:34:03.000000000 +0100
+++ gst-plugins-bad-0.10.22-patch/sys/dvb/gstdvbsrc.c    2011-08-11 11:54:08.959738425 +0200
@@ -974,13 +977,17 @@
   object = GST_DVBSRC (element);
   GST_LOG ("fd_dvr: %d", object->fd_dvr);
 
+  if (object->need_unlock) {
+      GST_DEBUG_OBJECT (object, "Unlock device");
+      return GST_FLOW_WRONG_STATE;
+  }
+
   //g_object_get(G_OBJECT(object), "blocksize", &buffer_size, NULL);
   buffer_size = DEFAULT_BUFFER_SIZE;
 
   /* device can not be tuned during read */
   g_mutex_lock (object->tune_mutex);
 
-
   if (object->fd_dvr > -1) {
     /* --- Read TS from DVR device --- */
     GST_DEBUG_OBJECT (object, "Reading from DVR device");
@@ -994,6 +1001,9 @@
       caps = gst_pad_get_caps (GST_BASE_SRC_PAD (object));
       gst_buffer_set_caps (*buf, caps);
       gst_caps_unref (caps);
+    } else if (object->need_unlock) {
+      GST_DEBUG_OBJECT (object, "Unlock device");
+      retval = GST_FLOW_WRONG_STATE;
     } else {
       GST_DEBUG_OBJECT (object, "Failed to read from device");
       gst_element_post_message (GST_ELEMENT_CAST (object),
Comment 1 Wim Taymans 2012-04-20 13:10:15 UTC
This is a patch against latest 0.10:

commit a5965d0d813c461b9f07ddcedd0617a5905bfa2f
Author: Wim Taymans <wim.taymans@collabora.co.uk>
Date:   Fri Apr 20 15:05:36 2012 +0200

    dvbsrc: pass the reason for failed read as GstFlowReturn
    
    Make the _read_device function return a GstFlowReturn so that we can propagate
    this to the caller. This allows us to differentiate between poll errors and
    flushing state.
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=674219
Comment 2 Frankie Eymard 2012-04-20 20:40:22 UTC
(In reply to comment #1)
>     Fixes https://bugzilla.gnome.org/show_bug.cgi?id=674219

The commit should refer to https://bugzilla.gnome.org/show_bug.cgi?id=674080
Comment 3 Wim Taymans 2012-04-20 21:03:33 UTC
Argh, yes...