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 706292 - mpegtsmux: Can't re-use safely after coming back from GST_STATE_NULL again
mpegtsmux: Can't re-use safely after coming back from GST_STATE_NULL again
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 1.5.90
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-08-19 10:09 UTC by lorddoskias
Modified: 2015-08-16 13:41 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description lorddoskias 2013-08-19 10:09:59 UTC
When MpegTSmux with requested pads is being reset the associated pid on the pads is set to 0. Later, when the mpegtsmux is set to playing the following errors is generated since PID 0 is reserved for PAT : 


0:00:08.918212309  4108  0x1984150 DEBUG              mpegtsmux mpegtsmux.c:565:mpegtsmux_create_stream:<muxer:sink_66> Creating stream with PID 0x0000 for caps video/x-h264, stream-format=(string)byte-stream, width=(int)720, height=(int)576, parsed=(boolean)true, alignment=(string)au

0:00:08.920068219  4108  0x1984150 WARN               mpegtsmux mpegtsmux.c:767:mpegtsmux_create_streams:<muxer> error: Could not create handler for stream

Edward Hervey summarised it as follows: "essentially the code assumes that pad won't be resetted and re-used"
Comment 1 Edward Hervey 2013-08-19 10:14:39 UTC
The pid associated with a pad is set when the pad is requested (either provided as part of the requested pad name, or provided by tsmux).

When the muxer is set to NULL and back to PAUSED/PLAYING .. it gets resetted, ends up having an associated PID of 0 (amongst other NULL values) and mayhem ensues.
Comment 2 Edward Hervey 2013-08-20 08:21:38 UTC
Making this bug more generic.
Comment 3 Tim-Philipp Müller 2015-08-03 16:39:58 UTC
I believe this is fixed by this commit:

commit 55373e21a8870d92ffe49a2d88deb68cf40cfdb4
Author: Jan Schmidt <jan@centricular.com>
Date:   Wed Jul 29 22:57:44 2015 +1000

    mpegtsmux: Don't clear the PID on reset.
    
    The PID on a pad shouldn't change on a state change, only
    if the pad is freed and a new one created. Clearing the PID
    prevented mpegtsmux from being reused, because all packets
    would end up muxed in PID 0
    
    https://bugzilla.gnome.org/show_bug.cgi?id=752999

Please re-open if not.