def _parse_intervals(durations):
    """Parse the given durations.

    Args:
        durations (dict): A dictionary of the each frame duration.

    Returns:
        A tuple of:
            * A list each element of which marks the start time
              of the next frame.
            * The total animation length.

    """
    result, time_ = [], 0
    for _, duration in durations.items():
        time_ += duration
        result.append(time_)
    return result, time_