ossia/score

AVFormatContext interrupt_callback support

Aperta

#1792 aperta il 27 mag 2025

 (0 commenti) (0 reazioni) (0 assegnatari)C++ (126 fork)auto 404
ODHack14easygood first issue

Metriche repository

Star
 (2035 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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;

Guida contributor