Skip to content

libobs: Async rotations other than 0, ±90, 180 and 270 are drawn outside the item #2121

Closed

Description

@rdoupe

Bug

An async source's rotation is drawn in the wrong place unless it is exactly 0, 90, -90, 180 or 270.

  • get_async_width() and get_async_height() swap the axes for any rotation that is not a multiple of 180.
  • rotate_async_video() only has the move back into the item's box for 90, 270, -90 and 180.
  • So a rotation of -180, -270, 360 or 450 turns the picture without moving it back. The picture lands outside the item's box: invisible, or offset.

obs_source_set_async_rotation() stores any long. Device autorotation (win-dshow) and plugins pass their value through unchanged, so a device that reports -180 or 360 hits this. Upstream has the same code. Found while scoping round 6 of the Rust port (R6-3).

Plan

  1. RED: a real-libobs test that sets each of the rotations 0, 90, -90, 180, 270, -180, -270, 360, 450 and -450 on an async test source, and checks that the source's reported size and the colour it draws inside the item's box match the equivalent rotation in 0-359.
  2. GREEN: normalize the rotation to 0-359 once, in obs_source_set_async_rotation(). The five values that work today give exactly the same result. Rotations that are not a multiple of 90 stay as they are now; this fix does not define them.

Activity

  1. rdoupe commented on Oct 24, 2026

    @rdoupe
    CollaboratorAuthor

    Claiming: #2121.

  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