-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FFplay's video_thread deadlocks in frame_queue_peek_writable after queuing a few frames #8443
Comments
video_thread
deadlocks in frame_queue_peek_writable
after queuing a few frames
I'm also working on turning this into a test. |
Does this still happen with |
@kripken Yes, it still happens with |
I see, thanks. Then I don't have a guess as to what might cause this. Perhaps @juj has an idea? I wonder if we should spend time to improve tools in this area, like we have the AUTODEBUG and DETERMINISTIC options that make debugging many bugs really easy, but for multithreaded code those won't really help... |
Not exactly sure what would be going on here. Emscripten has a linker flag |
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant. |
I can verify that this issue is still present, and that the original workaround is still relevant, which is a nice clue. Could we reopen this? |
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant. |
This seems to be an issue with Emscripten's pthread implementation which causes FFplay to deadlock while queuing frames. Switching to the generic SDL2 thread backend, which implements mutexes on top of semaphores, fixes the issue, as documented in PR #8429.
Running FFplay requires this patch to Emscripten's port of SDL2:
emscripten-ports/SDL2#77
To reproduce this problem, clone or download FFmpeg sources, and configure with:
Patch ffplay to work around issue #7684
Make the install target:
make install
Symlink
ffplay
in thebin
directory toffplay.bc
ln -sf $(readlink -f prefix/bin/ffplay) prefix/bin/ffplay.bc
Download a video sample:
Build
ffplay
using Emscripten:emcc prefix/bin/ffplay.bc -o ffplay.html -Lprefix/lib -lavfilter -lswscale -lpostproc -lavformat -lavcodec -lswresample -lavresample -lavutil -s TOTAL_MEMORY=$((512*1024*1024)) --emrun -s USE_PTHREADS=1 -s PROXY_TO_PTHREAD=1 -s USE_SDL=2 --embed-file big_buck_bunny.webm@/big_buck_bunny.webm
Run FFplay:
The expected behavior is for the video to play to completion, but it stops after two or three frames. With the workaround from above, the video plays to completion. This may indicate a bug in Emscripten's implementation of the pthread API.
The text was updated successfully, but these errors were encountered: