"Internal data stream error" with uridecodebin

Sergey Vlasov sergey.vlsv at gmail.com
Wed Feb 23 05:35:10 PST 2011


Hello,

After setting uri property of uridecodebin for the second time I get
"Internal data stream error" right after calling play(), but it works fine
with playbin2. What am I missing? There is my code example:

static GstElement *playbin;
#define USE_DECODEBIN

void init()
{
[..]
#ifdef USE_DECODEBIN
playbin = gst_parse_launch("uridecodebin name=my-decodebin ! autoaudiosink",
NULL);
#else
playbin = gst_element_factory_make("playbin2", NULL);
#endif
[..]
}

void setMedia(char *file)
{
[..]
gchar *uri = g_filename_to_uri(file, NULL, NULL);
#ifdef USE_DECODEBIN
GstElement *decodebin = gst_bin_get_by_name(GST_BIN(playbin),
"my-decodebin");
 g_object_set(decodebin, "uri", uri, NULL);
gst_object_unref(decodebin);
#else
g_object_set(playbin, "uri", uri, NULL);
#endif
[..]
}

void play()
{
gst_element_set_state(playbin, GST_STATE_PLAYING);
}

void stop()
{
gst_element_set_state(playbin, GST_STATE_NULL);
}

void main()
{
[..]
init();
setMedia("1.mp3");
 play();
[..]
stop();
setMedia("2.mp3");
 play();
[..]
}

--
Sergey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20110223/5cf40403/attachment.htm>


More information about the gstreamer-devel mailing list