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 765736 - multiqueue: playback with sparse stream deadlocks
multiqueue: playback with sparse stream deadlocks
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other All
: Normal major
: 1.9.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-04-28 17:14 UTC by Matej Knopp
Modified: 2016-04-29 13:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (1017 bytes, patch)
2016-04-28 17:14 UTC, Matej Knopp
none Details | Review
Patch with expanded comment (1.11 KB, patch)
2016-04-29 12:56 UTC, Matej Knopp
committed Details | Review

Description Matej Knopp 2016-04-28 17:14:10 UTC
Created attachment 326958 [details] [review]
Patch

Basically, sq->max_size.visible is never increased for sparse streams in overruncb when empty queue has been found; 

This code inside single_queue_overrun_cb doesn't seem right

  /* check if we reached the hard time/bytes limits */
  if (sq->is_eos || sq->is_sparse || IS_FILLED (sq, bytes, size.bytes) ||
      IS_FILLED (sq, time, sq->cur_time)) {
    goto done;
  }

If the queue is sparse it just skip the entire logic determining whether max_size.visible should be increased, deadlocking the demuxer.

I think what should be done instead is that when determining if limits have bean reached, to ignore time for sparse streams, as the buffer may be far in the future.
Comment 1 Edward Hervey 2016-04-29 07:15:53 UTC
This makes sense IMHO. sparse streams will only really cause issues in regards to time limits.

Can you expand the comment before that line explaining that we only take into account the time limit for non-sparse streams ?
Comment 2 Matej Knopp 2016-04-29 12:56:05 UTC
Created attachment 327019 [details] [review]
Patch with expanded comment
Comment 3 Sebastian Dröge (slomo) 2016-04-29 13:10:33 UTC
commit efb1955ffb395759e92a2a49918f0e823bcf4dfa
Author: Matej Knopp <matej.knopp@gmail.com>
Date:   Fri Apr 29 14:55:02 2016 +0200

    multiqueue: Ignore time when determining whether sparse stream limits have been reached
    
    Basically, sq->max_size.visible is never increased for sparse streams in
    overruncb when empty queue has been found;
    
    If the queue is sparse it just skip the entire logic determining whether
    max_size.visible should be increased, deadlocking the demuxer.
    
    What should be done instead is that when determining if limits have been
    reached, to ignore time for sparse streams, as the buffer may be far in the
    future.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=765736
Comment 4 Tim-Philipp Müller 2016-04-29 13:18:16 UTC
A unit test for this would be superb (and shouldn't be too hard if you have a file / inputs to reproduce it with?) :)