Skip to content

win-dshow: Turning off Autorotation leaves the camera rotated #2137

Closed

Description

@rdoupe

Bug

On Windows, turning off Autorotation on a Video Capture Device source does not undo the rotation it already applied.

DShowInput::OnVideoData() (plugins/win-dshow/win-dshow.cpp) passes the device's roll to obs_source_set_async_rotation() only while autorotation is on, and only when the roll changes. Nothing calls obs_source_set_async_rotation(source, 0) when the setting is turned off. So the camera stays turned by the last roll the device reported until OBS restarts or the source is recreated.

A second, smaller symptom: when Autorotation is turned back on, lastRotation still holds the old value. If the device reports that same roll again, it is not re-applied. That only matters after the first fix, or if the source was rotated by something else in between.

Upstream has the same code. This was found while fixing #2121.

Plan

When the settings are updated (DShowInput::Update, where autorotation is read), if Autorotation is now off and a rotation was applied, set the async rotation back to 0 and reset lastRotation to 0. The next frame with Autorotation on then re-applies the device's roll. The change is Windows-only, so it is verified by the Windows build and by reading the code. The rotation itself is covered by test_async_rotation_normalize (#2121).

Activity

  1. rdoupe commented on Oct 24, 2026

    @rdoupe
    CollaboratorAuthor

    Claiming: #2137.

  2. added
    claimed
    on Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    claimed

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions