GNOME Bugzilla – Bug 334322
[mpegdemux] playbin freezes with VobSub subtitles
Last modified: 2006-11-19 13:10:37 UTC
Steps to reproduce: 1. Load a movie file (AVI, XVID, AC3 in this case) with VobSub (.sub and .idx) subtitles in the same directory using the Movie>Open dialogue. 2. Totem stops responding. Stack trace: Starting program: /usr/local/bin/totem [Thread debugging using libthread_db enabled] [New Thread -1217489232 (LWP 4400)] [New Thread -1223890016 (LWP 4403)] ** (totem:4400): WARNING **: Trying to connect to an older version of the GNOME screensaver [New Thread -1224995936 (LWP 4411)] [New Thread -1234396256 (LWP 4412)] Program received signal SIG33, Real-time event 33. [Switching to Thread -1224995936 (LWP 4411)] 0xffffe410 in __kernel_vsyscall () (gdb) thread apply all Display all 39883 possibilities? (y or n) (gdb) thread apply all bt
+ Trace 66871
Other information:
playbin/totem still freeze with vobsub subtitles specified. This is because mpegdemux/dvddemux don't accumulate flow returns properly, and don't return FLOW_NOT_LINKED upstream when all pads are unlinked. Same thing happens with Fluendo's mpeg demuxer. Fixing this might not be entirely straight-forward, since flow combination should only really happen once all source pads have been created, but we don't really know when that is due to the way mpeg works (and mpegdemux never emits a no-more-pads for the same reason AFAIK).
Created attachment 75836 [details] [review] combine flow returns in mpegdemux and dvddemux First attempt at a patch that combines flow returns for mpegdemux and dvddemux. The assumption is that in practice packets for different streams are interleaved in certain max. intervals, so once at least N buffers have been pushed on all so-far created pads, chances are pretty good that we have all our pads (or at least all the ones that we are looking for). Seems to work so far with the files I've tested it with, but haven't tested DVD streams yet.
2006-11-19 Tim-Philipp Müller <tim at centricular dot net> * gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_base_init), (gst_dvd_demux_class_init), (gst_dvd_demux_combine_flows), (gst_dvd_demux_send_subbuffer): * gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_class_init), (gst_mpeg_demux_init_stream), (gst_mpeg_demux_parse_packet), (gst_mpeg_demux_parse_pes), (gst_mpeg_demux_combine_flows), (gst_mpeg_demux_send_subbuffer): * gst/mpegstream/gstmpegdemux.h: * gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_process_event), (gst_mpeg_parse_chain): Fix flow value combination; this fixes playbin/totem locking up if a VobSub file is specified as subtitle file (#334322). Flow value combination should only happen once we are fairly sure we've got all pads that are available for now. Since there isn't a well-specified time when this is the case in MPEG, we'll just assume this is the case once there has been a certain number of packets for each stream we've found so far.