Comments (3)
I do agree with you guys, that's the main reason of focusing in the next major version.
New threading, locking mechanisms with custom blocking collections using pulse/wait.
However, this is not related with this issue, this has to do with the library being also a view model and if you don't know your events in which thread are running you probably going to mess up. In your case Pause will call also your registered event PlaybackStopped so you could just unsubscribe it when you manually pause and then subscribe again.
from flyleaf.
The PlaybackStopped event has a warning in it's summary:
/// Warning: Uses Invoke and it comes from playback thread so you can't pause/stop etc. You need to use another thread if you have to.
Maybe it should say that it uses the main thread / GUI thread and maybe pause should warn that is uses the GUI thread as well.
Other than that, it looks like this deadlock is created by the example itself.
If you don't like to use BeginInvoke you can also call Pause from another Task.
A better "WPF" way to handle this is to create bindings to the player state directly instead of manually setting IsEnabled on the button.
from flyleaf.
As a side note, the amount of Thread.Sleeps in the library's code is a little bit concerning.
Probably BlockingCollection<T>
, Channels
instead of ConcurrentQueue<T>
can be used instead
or use ConcurrentQueue<T>
with Monitor.Wait, Pulse
.
Sorry this has nothing to do with the issue, I am also wondering why Thread.Sleep is used so much.
from flyleaf.
Related Issues (20)
- Get FlyleafSharedOverlay DetachedContent as Visual HOT 9
- Decoder (Subtitles): Bitmap Support HOT 1
- Issues of brightness control HOT 1
- [New feature requests]Added multi-threading support for M3U8 HOT 3
- Demuxer: Blu-Ray Support HOT 8
- Subtitles seeking support HOT 2
- Memory Leakage HOT 11
- current subtitle disappear when resuming from pause HOT 1
- WPF FlyleafHost: Load/Unload should be symmetrical HOT 1
- how to config automatically reconnect
- Audio stopped after some time in rtsp stream HOT 1
- Settings Dialog and Popup Menu Not Show in flwpf:FlyleafME HOT 3
- Memory Leak when ZeroCopy = False HOT 8
- To play i frames only in a video HOT 2
- Can Multiple Audio Streams in One File Be Played Simultaneously? HOT 2
- RTSP Tcp option Not work HOT 2
- Current subtitle is not displayed after seeking HOT 5
- A way to work with alpha video(WPF) HOT 1
- question about playing pictures HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flyleaf.