def fix_nframes(nframes, profile):
    """
    # make sure we break at the "true scale" max
    #
    # should this be in terms of fps or nframes?
    """
    fix_nframes_even = nframes == 1 or nframes % 2 == 0
    fix_nframes_sin = nframes == 1 or nframes % 4 != 1
    is_div_four_profile = ('0 to scale to -scale to 0' in profile or 
        profile == 'sinusoidal: scale to -scale to scale')
    if profile in ['0 to scale to 0', '-scale to scale to -scale'
        ] and fix_nframes_even:
        nframes_div_2 = nframes // 2
        nframes = 2 * (nframes_div_2 + 1) + 1
    if is_div_four_profile and fix_nframes_sin:
        nframes_div_4 = nframes // 4
        nframes = 4 * (nframes_div_4 + 1) + 1
    return nframes
