[gst-devel] Stop problems

René Stadler mail at renestadler.de
Mon Jan 8 01:45:52 CET 2007


Am Montag, den 08.01.2007, 00:32 +0100 schrieb Andreas Volz:
> Am Sat, 06 Jan 2007 15:52:37 +0100 schrieb René Stadler:
> 
> > The filesink must be in the READY or NULL state when you change the
> > location (as the file is not opened then).
> 
> Hm, could you tell me how I do this? I tried various commands, but I
> get the same error message or a segfault.
> 
> regards
> Andreas

I don't know what you miss, states are set using using
gst_element_set_state, and you already seem to know this because you use
it just fine.  To elaborate a little bit: The problem you face in your
program is how you call your "record" function.  Apparently it is called
at some point where the sink is in the PLAYING or PAUSED state.  To fix
this, you could unconditionally set the sink's state to READY before
setting the location:

void record (char *file)
{
  gst_element_set_state (sink, GST_STATE_READY);
  g_object_set (G_OBJECT (sink), "location", file, NULL);
  gst_element_set_state (pipeline, GST_STATE_PLAYING);
}

That should make the error go away.

-- 
Regards,
  René Stadler





More information about the gstreamer-devel mailing list