GNOME Bugzilla – Bug 160730
[PATCH] [mpegdemux] should remove pads on "new-media" event
Last modified: 2005-01-05 17:03:10 UTC
This feature would greatly help to implement channel zapping in the DVB sample application (in the sandbox module). dvbsrc is sending a "new-media" event every time it tunes to a new channel. The new channel may or may not contain new elemtary stream ids for audio and/or video. In the following usecase a DVB application (or spider...) can not determine which pads to connect to the mpeg decoder elements. 1. Decoding channel A with eid's 1/2 (A/V) Pads audio_00 and video_00 have been created in the mpegdemuxer App linked them to the decoder elements 2. Tuning to channel B with eid's 3/4 "new-pad" event is emmited for audio_01, video_01 App links new pads to the decoder elements 3. Tuning back to channel A No "new-pad" events are emmited so the wrong pads remain connected to the decoder elements. The app actually knows it changed the channel but as to assume (or awkwardly verify) that the pads which are connected to the decoder elements are the correct ones.
this could also happen when switching audio streams, no ? if yes, it could be an issue too in DVD player for the same problem. (and for subs too) come in #gstreamer and ask the devs for the better way to handle all this
Ronald, Wim: does decodebin or playbin handle this dynamic stuff with mpeg streams? If not, is there anything we can do in thsi regard to make it easier on apps?
playbin listens for new-pad, pad-removed and no-more-pads. On channel change, remove pads (emits pad-removed), setup new pads (emits new-pad) and signal no-more-pads to let the app know you're done. Playbin will handle this correctly.
Created attachment 35101 [details] [review] proposed patch mpegdemuxer/dvddemuxer reset internal state and remove pads on "new-media" event
You're calling reset on discont, that can't be right... Disconts can appear anywhere in a stream, for example when starting a MPEG system stream from halfway its original start, or also when concatenating two pieces of a stream. All this is allowed in MPEG. The patch doesn't allow for this anymore.
It should still be possible to play those mpeg streams, as a reset is only done on "new-media" discont events. IIRC mpegparse/-demux generate normal disconts only.
applied.