Skip to content

Remove / add feature for NotSendSyncAcrossAllPlatforms #793

@Fabus1184

Description

@Fabus1184

If NotSendSyncAcrossAllPlatforms is just there in case of some eventual future Android compatibility, why not lock it behind a feature flag?
Not being able to use streams across threads is a major drawback compared to the compatibility with the not yet supported Android AAudio API.

cpal/src/platform/mod.rs

Lines 66 to 72 in f063271

// Streams cannot be `Send` or `Sync` if we plan to support Android's AAudio API. This is
// because the stream API is not thread-safe, and the API prohibits calling certain
// functions within the callback.
//
// TODO: Confirm this and add more specific detail and references.
#[must_use = "If the stream is not stored it will not play."]
pub struct Stream(StreamInner, crate::platform::NotSendSyncAcrossAllPlatforms);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions