GNOME Bugzilla – Bug 589609
[PATCH] fix dvdspu crash when subtitles do not fit the incoming video
Last modified: 2009-09-07 06:47:38 UTC
Please describe the problem: If overlaying SPU images onto an incoming video, where the video is smaller than the original one, and the SPUs do not fit, dvdspu may crash. Steps to reproduce: 1. Apply the Kate patch to Thoggen (so, meant for Tim-Phillip Muller only for now I suppose :)) 2. Encode a DVD at a low resolution, selecting at least one SPU stream 3. Play back that video, using katedec and dvdspu Actual results: dvdspu may crash when trying to display SPUs outside the video. Expected results: A lack of crash. Moving and/or scaling SPUs would be nice too. Does this happen every time? For some test cases, yes. Other information: Patch attached.
Created attachment 139154 [details] [review] Try to fit subtitles within an incoming video where subs would not fit (and avoid crashing too)
There is a file in the Ubuntu bug that reproduces this problem: https://bugs.edge.launchpad.net/ubuntu/+source/gst-plugins-bad0.10/+bug/408647 I've tested this patch and it stops the crash but also seems to hide the subtitles.
*** Bug 594105 has been marked as a duplicate of this bug. ***
commit c6c19b79e0b120d3312edf7eadb5bf9e76654f9e Author: Vincent Penquerc'h <ogg.k.ogg.k@googlemail.com> Date: Thu Jul 16 10:06:36 2009 +0100 [dvdspu] Try to fit subtitles within the video frame when they're too large Fixes bug #589609.
> I've tested this patch and it stops the crash but also seems to hide the > subtitles. I've tested that file, and the subtitles are very large images, including large amounts of blank space, so when clipped you just see part of the image, which happens to be within the transparent border. A fix could be to look inside the subtitles, trim transparent borders, and center the rest, but it really should be fixed encoding side, and this goes into diminishing returns.
It's not that the subtitles are very large images (they're from standard DVD resolution of 720×480), but that the video is very small (320×240) and totem/gstreamer don't scale the subtitles to fit. The video plays fine, including subtitles, in VLC and mplayer, which do scale the subtitles appropriately.