[gstreamer-bugs] [Bug 368536] New: bin_change_state makes children go through unnecessary state changes

GStreamer (bugzilla.gnome.org) bugzilla-daemon at bugzilla.gnome.org
Tue Oct 31 12:47:13 PST 2006


Do not reply to this via email (we are currently unable to handle email
responses and they get discarded).  You can add comments to this bug at
http://bugzilla.gnome.org/show_bug.cgi?id=368536

  GStreamer | gstreamer (core) | Ver: HEAD CVS

           Summary: bin_change_state makes children go through unnecessary
                    state changes
           Product: GStreamer
           Version: HEAD CVS
          Platform: Other
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gstreamer (core)
        AssignedTo: gstreamer-bugs at lists.sourceforge.net
        ReportedBy: hexa00 at gmail.com
         QAContact: gstreamer-bugs at lists.sourceforge.net
     GNOME version: Unspecified
   GNOME milestone: Unspecified


I noticed that in a bin when doing a change_state lets say from PLAYING to NULL
, 
change_state is called of course and it changes the children state to the next
state in the transition namely here PAUSE , 

but the problem is it does this without checking the children current state, if
the children was in state NULL for example there's no reason to bring it to
PAUSED to go to NULL after .. 

This could cause problems when for exemple the change state of the element to
PAUSE would fail and then it would make the pipeline state change form PLAYING
to NULL fail also , even if there's no reason to fail here...

So here's a patch to check the children state and to skip all children state
changes that are not in the same direction as the bin state changes (bin
changes downward , children changes downwards only too). Also if the children
state is already at the bin's pending state it will skip the transition since
it's not needed either...

Note that I still set the base_time even if I skip the transition just to be
sure... I was unsure about this.. ? feel free to comment

Also I could commit this myself ( and would like too ) :) .. just tell me if
you guys approuve the patch or if it needs changes...

(Tested with my regression , I could not see any problems)


-- 
Configure bugmail: http://bugzilla.gnome.org/userprefs.cgi?tab=email




More information about the Gstreamer-bugs mailing list