Skip to content
  • Carlos Rafael Giani's avatar
    queue2: Distinguish between buffering percentage and buffering level · e0f1a9e6
    Carlos Rafael Giani authored and Sebastian Dröge's avatar Sebastian Dröge committed
    To make the code clearer, and to facilitate future improvements, introduce
    a distinction between the buffering level and the buffering percentage.
    
    Buffering level: the queue's current fill level. The low/high watermarks
    are in this range.
    
    Buffering percentage: percentage relative to the low/high watermarks
    (0% = low watermark, 100% = high watermark).
    
    To that end, get_buffering_percent() is renamed to get_buffering_level(),
    and the code at the end that transforms to the buffering percentage is
    factored out into a new convert_to_buffering_percent() function. Also,
    the buffering level range is parameterized by adding a new constant called
    MAX_BUFFERING_LEVEL.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=769449
    e0f1a9e6