I don't quite like this if statement.
I think mine was easier to understand:
```python
        if frames > valid_frames:
            if fill_value is None:
                out = out[:valid_frames]
            else:
                out[valid_frames:] = fill_value

        return out
```