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 440127 - Autoaudiosink does extra switching between null and ready with sink
Autoaudiosink does extra switching between null and ready with sink
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 0.10.6
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-05-21 09:07 UTC by Tommi Myöhänen
Modified: 2007-05-25 10:24 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Tommi Myöhänen 2007-05-21 09:07:06 UTC
gst_auto_audio_sink_find_best() currently finds an actual sink and leaves it to READY state. However soon the state is switched temporarily back to NULL when syncing state with autoaudiosink container in gst_auto_audio_sink_detect():

  /* find element */
  GST_DEBUG_OBJECT (sink, "Creating new kid");
  if (!(esink = gst_auto_audio_sink_find_best (sink))) {
    return FALSE;
  }

  sink->kid = esink;
  gst_element_set_state (sink->kid, GST_STATE (sink));
  gst_bin_add (GST_BIN (sink), esink);


Is it necessary to set the state of actual sink according to container state before adding it? The state of autoaudiosink is always NULL here since we're doing null_to_ready state change. It would be good to avoid extra switches between null and ready states if the opening of audio device is slow.
Comment 1 Jan Schmidt 2007-05-21 14:20:35 UTC
We could just do:

if (GST_STATE (sink->kid) < GST_STATE (sink))
  gst_element_set_state (sink->kid, GST_STATE (sink));

instead. That would only change the state in the case that the code one day gets called in a state higher than READY.
Comment 2 Jan Schmidt 2007-05-25 10:24:35 UTC
Fixed in CVS:

2007-05-25  Jan Schmidt  <thaytan@mad.scientist.com>

        * gst/autodetect/gstautoaudiosink.c: (gst_auto_audio_sink_detect):
          Don't unnecessarily perform a READY->NULL->READY transition on the
          detected audio sink when starting up. Fixes: #440127