title: Switch on the fly between two sources in gstreamer
body: <p>I'm currently facing a problem that I'm not able to resovle yet, but I hope I can do it with your help.</p>
  
  <p>I currently developp an application with gstreamer to playback different kind of files : video and photo (avi and jpg respectively). The user has to have the possibility to switch between those different files. I have achieved this but by creating a new pipeline if the file format is different. There, screen randomly blinks between two files loading.</p>
  
  <p>Now, I've played with valve just for jpg files and it works like a charm. But, I'm stuck at the step to implement video files, I don't know how to swith between two video files : the code below doesn't work for video files, it freezes:</p>
  
  <pre><code>gst-launch-1.0 filesrc name=photosrc ! jpegdec ! valve name=playvalve drop=false ! imxg2dvideosink
  </code></pre>
  
  <p>Then further in my code, I drop the valve, set differents elements to ready state, change location of filesrc and return to playing state.</p>
  
  <p>I take a look a input-selector but it appears that non-read file still playing when one switches to the other (cf doc). Is it possible to set an input as ready to avoid this behavior ?</p>
  
  <p>Thanks a lot for helping</p>