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 668097 - [subtitleoverlay] fix state change stall on PAUSED->READY->PAUSED (patch)
[subtitleoverlay] fix state change stall on PAUSED->READY->PAUSED (patch)
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
0.10.x
Other Linux
: Normal normal
: 0.10.36
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-01-17 14:42 UTC by Anssi Hannula
Modified: 2012-01-23 17:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test program for subtitleoverlay state change stall (5.57 KB, application/octet-stream)
2012-01-17 14:42 UTC, Anssi Hannula
  Details
fix state change stall on PAUSED->READY->PAUSED (1.67 KB, patch)
2012-01-17 14:43 UTC, Anssi Hannula
committed Details | Review

Description Anssi Hannula 2012-01-17 14:42:44 UTC
Created attachment 205448 [details]
Test program for subtitleoverlay state change stall

After a PAUSED->READY change the sink pads are currently not set to
blocking state. When the element is set back to PAUSED, the change will
be done asynchronously, but as the _pad_blocked_cb() callback is now not
called, the state change never completes.

Fix that by setting the sink pads to blocking state on a PAUSED->READY
change, which ensures that the _pad_blocked_cb() is called when needed
on any future READY->PAUSED change. The sink pads are already put to
blocking state on NULL->READY change, so this behavior is consistent.


Git-formatted patch attached, and a simple quickly-hacked-up test program I used which does NULL->READY->PAUSED->READY->PAUSED, useful with GST_DEBUG="*:2,GST_STATES:4,subtitleoverlay:5".

I tested the patch with 0.10.32 gst+plugins-base, and it seems to fix the issue.

This is the first time I've looked at GST, so be sure to double-check I understood everything correctly :)
Comment 1 Anssi Hannula 2012-01-17 14:43:52 UTC
Created attachment 205450 [details] [review]
fix state change stall on PAUSED->READY->PAUSED
Comment 2 Vincent Penquerc'h 2012-01-20 17:36:35 UTC
It makes sense to me.
Thanks for the patch.

commit dd8f9aca92df070157172bdeb97c93c33a3d5c22
Author: Anssi Hannula <anssi.hannula@iki.fi>
Date:   Tue Jan 17 16:05:41 2012 +0200

    subtitleoverlay: fix state change stall on PAUSED->READY->PAUSED
    
    After a PAUSED->READY change the sink pads are currently not set to
    blocking state. When the element is set back to PAUSED, the change will
    be done asynchronously, but as the _pad_blocked_cb() callback is now not
    called, the state change never completes.
    
    Fix that by setting the sink pads to blocking state on a PAUSED->READY
    change, which ensures that the _pad_blocked_cb() is called when needed
    on any future READY->PAUSED change. The sink pads are already put to
    blocking state on NULL->READY change, so this behavior is consistent.
    
    Fixes bug #668097.