<meta http-equiv="content-type" content="text/html; charset=utf-8"><div>Hello,</div><div><br></div><div>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:</div>
<div><br></div><div>static GstElement *playbin;</div><div>#define USE_DECODEBIN</div><div><br></div><div>void init()</div><div>{</div><div>[..]</div><div>#ifdef USE_DECODEBIN</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>playbin = gst_parse_launch("uridecodebin name=my-decodebin ! autoaudiosink", NULL);</div>
<div>#else</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>playbin = gst_element_factory_make("playbin2", NULL);</div><div>#endif</div><div>[..]</div><div>}</div><div><br></div><div>void setMedia(char *file)</div>
<div>{</div><div>[..]</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>gchar *uri = g_filename_to_uri(file, NULL, NULL);</div><div>#ifdef USE_DECODEBIN</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>GstElement *decodebin = gst_bin_get_by_name(GST_BIN(playbin), "my-decodebin");</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>g_object_set(decodebin, "uri", uri, NULL);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>gst_object_unref(decodebin);</div>
<div>#else</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>g_object_set(playbin, "uri", uri, NULL);</div><div>#endif</div><div>[..]</div><div>}</div><div><br></div><div>void play()</div><div>
{</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>gst_element_set_state(playbin, GST_STATE_PLAYING);</div><div>}</div><div><br></div><div>void stop()</div><div>{</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>gst_element_set_state(playbin, GST_STATE_NULL);</div>
<div>}</div><div><br></div><div>void main()</div><div>{</div><div>[..]</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>init();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>setMedia("1.mp3");</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>play();</div><div>[..]</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>stop();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>setMedia("2.mp3");</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>play();</div><div>[..]</div><div>}</div><div><br></div><div>--</div><div>Sergey</div>