After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 160730 - [PATCH] [mpegdemux] should remove pads on "new-media" event
[PATCH] [mpegdemux] should remove pads on "new-media" event
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins
git master
Other All
: Normal normal
: 0.8.8
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks: 152403
 
 
Reported: 2004-12-07 21:14 UTC by Martin Eikermann
Modified: 2005-01-05 17:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (3.63 KB, patch)
2004-12-21 23:09 UTC, Martin Eikermann
none Details | Review

Description Martin Eikermann 2004-12-07 21:14:35 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.
Comment 1 Stephane Loeuillet 2004-12-07 23:58:41 UTC
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
Comment 2 Zaheer Abbas Merali 2004-12-09 23:09:48 UTC
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?
Comment 3 Ronald Bultje 2004-12-18 19:41:40 UTC
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.
Comment 4 Martin Eikermann 2004-12-21 23:09:33 UTC
Created attachment 35101 [details] [review]
proposed patch

mpegdemuxer/dvddemuxer reset internal state and remove pads on "new-media"
event
Comment 5 Ronald Bultje 2004-12-22 20:04:36 UTC
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.
Comment 6 Martin Eikermann 2004-12-22 21:00:37 UTC
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.
Comment 7 Ronald Bultje 2005-01-05 17:03:10 UTC
applied.