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 340699 - [flacdec] should not send EOS when doing segment seeking
[flacdec] should not send EOS when doing segment seeking
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 0.10.4
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-05-05 04:18 UTC by Артём Попов
Modified: 2006-05-06 09:02 UTC
See Also:
GNOME target: ---
GNOME version: 2.11/2.12


Attachments
patch (2.39 KB, patch)
2006-05-05 13:03 UTC, Tim-Philipp Müller
committed Details | Review

Description Артём Попов 2006-05-05 04:18:00 UTC
When doing segment seeking in a FLAC file (the segment stop point is set exactly to the duration of the file), flacdec does not send SEGMENT_DONE message when reaching the stop point, but sends EOS message instead.

While it may seem right to send EOS, because there's EOS after the last nanosecond, the more right behaviour, I think, would be to send SEGMENT_DONE message. Besides, some plugins react exactly that way, i. e. oggdemux:

gst-plugins-base/ext/ogg/gstoggdemux.c (2681):

eos:
  {
    ret = GST_FLOW_OK;
    /* segment playback just posts a segment end message instead of
     * pushing out EOS. */
    ogg->segment_running = FALSE;
    if (ogg->segment.flags & GST_SEEK_FLAG_SEGMENT) {
      gint64 stop;

      if ((stop = ogg->segment.stop) == -1)
        stop = ogg->segment.duration;

      GST_LOG_OBJECT (ogg, "Sending segment done, at end of segment");
      gst_element_post_message (GST_ELEMENT (ogg),
          gst_message_new_segment_done (GST_OBJECT (ogg), GST_FORMAT_TIME,
              stop));
    } else {
      GST_LOG_OBJECT (ogg, "Sending EOS, at end of stream");
      gst_ogg_demux_send_event (ogg, gst_event_new_eos ());
    }
    goto pause;
  }

Unfortunately, I do not fully understand flacdec source to write a patch myself, but I hope this information may be useful to the developers.
Comment 1 Tim-Philipp Müller 2006-05-05 08:49:29 UTC
You mean you wrongly get an EOS when you do a segment seek and the stop point is the end of the file, but everything's fine as long as the stop point is somewhere in the middle of the fil, right?

Comment 2 Tim-Philipp Müller 2006-05-05 13:03:22 UTC
Created attachment 64856 [details] [review]
patch

Does this patch fix it for you?
Comment 3 Wim Taymans 2006-05-05 14:54:08 UTC
normally the EOS detection code can be identical with a simple if() on the seek flags. 
Comment 4 Tim-Philipp Müller 2006-05-05 16:39:42 UTC
I didn't want to make any assumptions about the exact behaviour of the libFLAC seekable stream decoder interface.
Comment 5 Артём Попов 2006-05-06 01:08:45 UTC
With the patch everything works just as expected, thanks!
Comment 6 Tim-Philipp Müller 2006-05-06 09:02:13 UTC
Thanks for testing, committed to CVS:

 2006-05-06  Tim-Philipp Müller  <tim at centricular dot net>

        * ext/flac/gstflacdec.c: (gst_flac_dec_loop):
        * ext/flac/gstflacdec.h:
          Handle segment seeks that include the end of the file as stop point
          properly: when the decoder hits EOS we want to send a SEGMENT_DONE
          message instead of an EOS event in case we're in segment seek
          mode (fixes #340699).