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;

贡献者指南