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 751539 - dashdemux: wrong duration validation in gst_mpd_client_get_next_fragment_duration
dashdemux: wrong duration validation in gst_mpd_client_get_next_fragment_dura...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other All
: Normal normal
: 1.5.90
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-06-26 11:58 UTC by Florin Apostol
Modified: 2015-08-16 13:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (1.19 KB, patch)
2015-06-26 12:11 UTC, Florin Apostol
committed Details | Review

Description Florin Apostol 2015-06-26 11:58:44 UTC
Before returning the duration value, the gst_mpd_client_get_next_fragment_duration function tries to validate it. The condition is:

    if (GST_CLOCK_TIME_IS_VALID (duration) || segments_count == 0
        || seg_idx < segments_count)
      return duration;
    return 0;

But it should be:
    if (GST_CLOCK_TIME_IS_VALID (duration) && (segments_count == 0
        || seg_idx < segments_count))
      return duration;
    return 0;

Even better, we could write the code similar to gst_mpd_client_get_next_fragment or gst_mpd_client_get_next_fragment_timestamp functions:

    if (!GST_CLOCK_TIME_IS_VALID (duration) || (segments_count > 0
            && stream->segment_index >= segments_count)) {
      return 0;
    }
    return duration;
Comment 1 Florin Apostol 2015-06-26 12:11:56 UTC
Created attachment 306169 [details] [review]
proposed patch
Comment 2 Thiago Sousa Santos 2015-06-26 13:59:18 UTC
commit e09cf2f3b6106d3aa9e7b8b6ab72b09cce3d45c5
Author: Florin Apostol <florin.apostol@oregan.net>
Date:   Fri Jun 26 13:09:54 2015 +0100

    dashdemux: corrected next fragment duration validation
    
    Before returning the next fragment duration value, the
    gst_mpd_client_get_next_fragment_duration function tries to validate it.
    But the condition was incorrect.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=751539