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 774030 - postproc: return valid error when gst_pad_push fails
postproc: return valid error when gst_pad_push fails
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer-vaapi
git master
Other Linux
: Normal normal
: 1.11.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-11-07 07:02 UTC by Hyunjun Ko
Modified: 2016-11-08 07:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
postproc: return GST_FLOW_FLUSHING during flushing (1.29 KB, patch)
2016-11-07 07:03 UTC, Hyunjun Ko
none Details | Review
postproc: return error value coming out from gst_pad_push instead of just GST_FLOW_ERROR (1.33 KB, patch)
2016-11-08 01:08 UTC, Hyunjun Ko
committed Details | Review

Description Hyunjun Ko 2016-11-07 07:02:37 UTC
Currently, when gst_pad_push fails it always return GST_FLOW_ERROR.
I found this could lead to deadlock during seek, which happens very unusually.
I don't know why it returns same error value, but IMO, it should be modified.

@Victor, with the media you downloaded from me last week, you can reproduce deadloc.
Just play it and seek repidly several times.
Comment 1 Hyunjun Ko 2016-11-07 07:03:31 UTC
Created attachment 339220 [details] [review]
postproc: return GST_FLOW_FLUSHING during flushing

Returning GST_FLOW_ERROR always when gst_pad_push fails might lead to
deadlock during seek sometimes.

Return exact error value when flush happens.
Comment 2 Sebastian Dröge (slomo) 2016-11-07 09:49:07 UTC
Review of attachment 339220 [details] [review]:

::: gst/vaapi/gstvaapipostproc.c
@@ +812,2 @@
       GST_ERROR_OBJECT (postproc, "failed to push output buffer to video sink");
+      return GST_FLOW_ERROR;

Why not "return ret"?

@@ +813,3 @@
+      return GST_FLOW_ERROR;
+    } else
+      return GST_FLOW_FLUSHING;

{}

@@ +891,2 @@
       GST_ERROR_OBJECT (postproc, "failed to push output buffer to video sink");
+      return GST_FLOW_EOS;

Why not "return ret"?

@@ +892,3 @@
+      return GST_FLOW_EOS;
+    } else
+      return GST_FLOW_FLUSHING;

{}
Comment 3 Hyunjun Ko 2016-11-07 09:57:17 UTC
(In reply to Sebastian Dröge (slomo) from comment #2)
> Review of attachment 339220 [details] [review] [review]:
> 
> ::: gst/vaapi/gstvaapipostproc.c
> @@ +812,2 @@
>        GST_ERROR_OBJECT (postproc, "failed to push output buffer to video
> sink");
> +      return GST_FLOW_ERROR;
> 
> Why not "return ret"?
> 
> @@ +813,3 @@
> +      return GST_FLOW_ERROR;
> +    } else
> +      return GST_FLOW_FLUSHING;
> 
> {}
> 
> @@ +891,2 @@
>        GST_ERROR_OBJECT (postproc, "failed to push output buffer to video
> sink");
> +      return GST_FLOW_EOS;
> 
> Why not "return ret"?
> 
> @@ +892,3 @@
> +      return GST_FLOW_EOS;
> +    } else
> +      return GST_FLOW_FLUSHING;
> 
> {}

Maybe I was afraid a sort of regression? :)
But I totally agree that just do "return ret;"
Comment 4 Sebastian Dröge (slomo) 2016-11-07 10:12:23 UTC
Well, you would've uncovered more bugs in the existing code there then. It is the right thing to do in this context ;)
Comment 5 Víctor Manuel Jáquez Leal 2016-11-07 12:14:11 UTC
What Sebastian said and please log out the return of gst_flow_get_name() for debugging purposes :)
Comment 6 Hyunjun Ko 2016-11-08 01:08:55 UTC
Created attachment 339296 [details] [review]
postproc: return error value coming out from gst_pad_push instead of just GST_FLOW_ERROR

Returning GST_FLOW_ERROR always when gst_pad_push fails might lead to deadlock during seek sometimes.
Comment 7 Víctor Manuel Jáquez Leal 2016-11-08 07:31:31 UTC
This should be pushed for 1.10 and perhaps 1.8