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 654853 - multifilesrc: always honour stop-index
multifilesrc: always honour stop-index
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 1.1.1
Assigned To: David Schleef
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-07-18 15:10 UTC by Stas Sergeev
Modified: 2012-10-26 10:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
the patch (1.86 KB, patch)
2011-07-18 15:10 UTC, Stas Sergeev
reviewed Details | Review

Description Stas Sergeev 2011-07-18 15:10:52 UTC
Created attachment 192195 [details] [review]
the patch

Hi.

When the file pattern for multifilesrc is specified without
the template elements (that is, no % sign), the stop_index
gets ignored, resulting in a tight loop.

It turned out, the loop handling got a separate piece of code,
that triggers only when the next file is not found. Another
wrap-around checking code, that is activated when the file is
found, did not check the loop argument, and appears to be buggy:
it checks stop_index off-by-2.

I don't think that the two separate pieces of code for the same
purpose are necessary. The attached patch removes the redundant
code and fixes the rest.
Note that I haven't tested the patch properly.
The only thing I needed was to fix the aforementioned tight loop,
but I hope the patch is good. :)
Comment 1 Tim-Philipp Müller 2012-10-26 10:02:03 UTC
Right, so I think you're onto something here, and I've committed part of your patch.

However, I have not committed the bits that touch the file-not-found-or-read-error bits, because it doesn't look right to me to just remove it. That code looks useful, in the sense that it makes sure that if we're in loop mode and wrap around to the start, and there's no start file, we don't end up in a loop. Also, it handles the looping case from START-X where the stop-index is not known and we just wrap around when the next file can't be found.

commit 40117be0605e447a3321897c52e37e885b12249e
Author: Tim-Philipp Müller <tim@centricular.net>
Date:   Fri Oct 26 10:55:28 2012 +0100

    tests: add multifilesrc test for fix in previous commit
    
    Make sure the stop-index set is honoured.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=654853

commit 3f2363fa57bea944686e37abf5e937e8947ada06
Author: Stas Sergeev <stsp@aknet.ru>
Date:   Fri Oct 26 10:33:03 2012 +0100

    multifilesrc: fix stop index handling
    
    Make sure the stop index is always honoured. Avoids
    endless loop if one wants to read and output the same
    file N times, for example.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=654853