Skip to content

Commit 4cd083d

Browse files
committed
fix(obs-irl-source): release hw device on stream close
the d3d11va/vaapi device was only freed on source destroy, so reconnects silently skipped device creation (and its logging) and attached a stale device from the previous connection, making reconnect decode behavior diverge from fresh connects. create a fresh device per connection instead.
1 parent 8ebff47 commit 4cd083d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/receiver-stream.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,12 @@ void irl_close_ffmpeg(struct irl_source *ctx)
182182
avformat_close_input(&ctx->fmt_ctx);
183183
ctx->fmt_ctx = NULL;
184184
}
185+
/* Release the HW device with the connection it was created for.
186+
* Keeping it across reconnects made the device-creation loop
187+
* silently skip (no logging) and attach a stale device, so
188+
* reconnects behaved differently from fresh connects. */
189+
if (ctx->hw_device_ctx)
190+
av_buffer_unref(&ctx->hw_device_ctx);
185191
ctx->audio_stream_idx = -1;
186192
ctx->video_stream_idx = -1;
187193
ctx->using_hw_decode = false;

0 commit comments

Comments
 (0)