<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div><div><div>Hi,<br><br></div>I am new to gstreamer. Need help in resolving this issue.<br><br></div>I am writing an app which reads ts streams one after the other and renders both video and audio. <br></div>Hence I need to change the ts streaming file after receiving EOS from the first ts file in filesrc element.<br></div>My pipeline looks as below:<br><br>filesrc location=B4USO123073012.ts ! tsdemux  name=d ! queue ! h264parse ! avdec_h264 ! xvimagesink  d. ! queue ! faad ! autoaudiosink (ofcourse I am not using gst-launch, instead writing C program to implement the pipeline).<br><br><br></div>The first file runs fine, after receiving EOS I follwo following steps:<br></div>1. Set pipeline state to NULL<br></div>2. Remove filesrc element<br></div>3. Create new filesrc element<br></div>4. Set the location in filesrc to new file<br></div>5. add the new filesrc element to pipeline.<br></div>6. link filesrc to tsdemux<br></div>7. change pipeline state to PLAYING<br><br></div>After this I receive error message "No program activated before EOS" and app terminates.<br></div>Here is a snippet of my code where location is changed on arrival of EOS.<br><br>case GST_MESSAGE_EOS:<br>                        g_print ("End-Of-Stream reached.\n");<br>                        gst_element_set_state (data->pipeline, GST_STATE_NULL);<br>                        gst_bin_remove(data->pipeline, data->source);<br>                        data->source = gst_element_factory_make ("filesrc", "file-source");<br>                        g_object_set (G_OBJECT (data->source), "location", "B4USO123073012.ts", NULL);<br>                        gst_bin_add(data->pipeline, data->source);<br>                        gst_element_link(data->source, data->demuxer);<br>                        gst_element_set_state (data->pipeline, GST_STATE_PLAYING);<br>                        break;<br><br><div><br clear="all"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><br>Regards,<br></div>Sujata<br></div></div>
</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>