ossia/score

AVFormatContext interrupt_callback support

開放

#1,792 建立於 2025年5月27日

 (0 則留言) (0 個反應) (0 位負責人)C++ (126 個分叉)auto 404
ODHack14easygood first issue

倉庫指標

星標
 (2,035 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

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;

貢獻者指南