Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 524753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:36:02+00:00 2026-05-13T08:36:02+00:00

I get the cross-thread operation not valid here: if ( vlc.State == VlcPlayerControlState.PLAYING )

  • 0

I get the “cross-thread operation not valid” here:

if ( vlc.State == VlcPlayerControlState.PLAYING )
        {
            if ( vlc.InvokeRequired )
            {
                vlc.Invoke( new MediaPlayerNoParameterDelegate( vlc.Stop ) );
            }
            else
            {
                vlc.Stop(); // debugger points here
            }
        }

Debugging shows me that vlc doesn’t require invoking. but the thread from which this is accessed is different from the thread it was created on.

I’m using the libvlc.net wrapper to play sound, but the problem should not be there.
How can I get rid of this exception?

I’m using threading not backgroundworker.

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T08:36:03+00:00Added an answer on May 13, 2026 at 8:36 am

    It sounds like this is a bug in the libvlc.net wrappers.

    My suggestion would be to just always call vlc.Invoke(…). You’ll suffer a (small) performance hit when the invoke is truly not required, but if you’re doing this from a separate thread, it will always be required anyways.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get the error Cross-thread operation not valid: Control 'label1' accessed from a thread
I get the following error Cross-thread operation not valid: Control accessed from a thread
Possible Duplicate: Cross-thread operation not valid: Control accessed from a thread other than the
Possible Duplicate: Cross-thread operation not valid: Control accessed from a thread other than the
I am trying to get around a Cross Thread Exception, Invalid Object Exception. Here
I am using vb.net, and in my program I get this 'crossthread operation not
I get an invalid cross-thread access exception when trying to set an image using
I've been thinking for a while if there's a way to get cross-domain AJAX
How can I get the list of cross product pairs from a list of
Where do I get a link to install Qt with the MinGW cross compiler

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.