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 771853 - subparse: Last string isn't displayed when srt subtitles lack a blank line at the end
subparse: Last string isn't displayed when srt subtitles lack a blank line at...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
unspecified
Other Linux
: Normal normal
: 1.12.5
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-09-22 19:04 UTC by Alexandre Franke
Modified: 2018-01-26 11:27 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Alexandre Franke 2016-09-22 19:04:01 UTC
Using totem, if I have a video with srt subtitles and there is not empty line at the end of file, the last string isn't displayed as it should. The spec seems to state there should be an empty line, but youtube accepts the file without the blank line just fine. Maybe gstreamer shouldn't be so strict about it?
Comment 1 Tim-Philipp Müller 2016-09-22 20:04:28 UTC
That sounds like something we should be able to make work, thanks :)
Comment 2 Antonio Ospite 2017-09-16 10:28:59 UTC
Hi,

I noticed that too, the issue is still there in 1.12.2

A quick way to reproduce it:

gst-launch-1.0 playbin \
  uri="https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.ogv" \
  suburi="https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer_gr.srt"

There are four dialogues in the srt file but the last one does not seem to be rendered.

Ciao,
   Antonio
Comment 3 Tim-Philipp Müller 2017-12-24 16:51:17 UTC
Interesting bug.

subparse does the right thing here actually: when it gets an EOS event on its sink pad it will push out the remaining text, even if there's no empty line at the end.

The problem is that it never gets an EOS event until the end of the clip, by which time it's too late to push out that last text.

This is most likely a problem in streamsynchronizer, and I'm not sure if there's an easy fix for it.

It works fine in playbin3, so I'm tempted to WONTFIX this bug, sorry.
Comment 4 Bastien Nocera 2018-01-24 14:38:50 UTC
(In reply to Tim-Philipp Müller from comment #3)
> It works fine in playbin3, so I'm tempted to WONTFIX this bug, sorry.

Is playbin3 a drop-in replacement? Did it have a name change?
Comment 5 Tim-Philipp Müller 2018-01-24 14:49:42 UTC
It's not a drop-in replacement, no.

Some of the stuff used in Totem to get per-stream tags/caps etc. has to be done with the new streams API now.
Comment 6 Tim-Philipp Müller 2018-01-25 18:43:24 UTC
Found a solution after all:

commit 3219b704fd6a6f24daef5a66e9251ae2e159a4cc (HEAD -> master)
Author: Tim-Philipp Müller <tim@centricular.com>
Date:   Thu Jan 25 18:39:11 2018 +0000

    subparse: fix pushing out of last chunk if last line has no newline
    
    With playbin the last subtitle chunk would not get displayed
    if the last chunk was missing a newline at the end. This is
    because streamsynchronizer will hold back the EOS event until
    the audio and video streams are finished too, so subparse
    would never forcefully push out the last chunk until the very
    end when it is too late.
    
    We get a STREAM_GROUP_DONE event from streamsynchronizer however,
    so handle that like EOS and force out any remaining text then.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=771853