score icon indicating copy to clipboard operation
score copied to clipboard

AVFormatContext interrupt_callback support

Open jcelerier opened this issue 7 months ago • 0 comments

needed to handle proper camera unplugging:

+++ b/src/plugins/score-plugin-media/Video/CameraInput.cpp
@@ -71,6 +71,9 @@ bool CameraInput::start() noexcept
   m_formatContext->flags |= AVFMT_FLAG_NOBUFFER;
   m_formatContext->flags |= AVFMT_FLAG_FLUSH_PACKETS;
 
+  m_formatContext->interrupt_callback.callback = +[](void*) -> int { return 1; };
+  m_formatContext->interrupt_callback.opaque = 0;
+
   AVDictionary* options = nullptr;

jcelerier avatar May 27 '25 01:05 jcelerier