diff options
author | Timo Rothenpieler <[email protected]> | 2025-09-17 18:31:11 +0200 |
---|---|---|
committer | Timo Rothenpieler <[email protected]> | 2025-09-18 01:04:59 +0000 |
commit | 983fed34f8172228c2e5490882531668d9d35105 (patch) | |
tree | 61b3173cda97f12a7e97d706ea3dbe43c0212b28 /libavfilter/vsrc_gfxcapture_winrt.cpp | |
parent | 8accbbdf9a99a1999e7e0c19f6cc91085b3b1905 (diff) |
avfilter/vsrc_gfxcapture: don't pass pointer to ComPtr
While it does appear to work fine, with all the operator overloads, it
at least has potential for surprises, so pass it by reference instead.
Diffstat (limited to 'libavfilter/vsrc_gfxcapture_winrt.cpp')
-rw-r--r-- | libavfilter/vsrc_gfxcapture_winrt.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libavfilter/vsrc_gfxcapture_winrt.cpp b/libavfilter/vsrc_gfxcapture_winrt.cpp index 9562863d7f..b037dc89aa 100644 --- a/libavfilter/vsrc_gfxcapture_winrt.cpp +++ b/libavfilter/vsrc_gfxcapture_winrt.cpp @@ -436,7 +436,7 @@ static int wgc_setup_gfxcapture_capture(AVFilterContext *avctx) return 0; } -static int wgc_try_get_next_frame(AVFilterContext *avctx, ComPtr<IDirect3D11CaptureFrame> *capture_frame) +static int wgc_try_get_next_frame(AVFilterContext *avctx, ComPtr<IDirect3D11CaptureFrame> &capture_frame) { GfxCaptureContext *cctx = CCTX(avctx->priv); GfxCaptureContextCpp *ctx = cctx->ctx; @@ -447,11 +447,11 @@ static int wgc_try_get_next_frame(AVFilterContext *avctx, ComPtr<IDirect3D11Capt ComPtr<ID3D11Texture2D> frame_texture; SizeInt32 frame_size = { 0, 0 }; - CHECK_HR_RET(wgctx->frame_pool->TryGetNextFrame(capture_frame->ReleaseAndGetAddressOf())); - if (!capture_frame->Get()) + CHECK_HR_RET(wgctx->frame_pool->TryGetNextFrame(&capture_frame)); + if (!capture_frame) return AVERROR(EAGAIN); - CHECK_HR_RET(capture_frame->Get()->get_ContentSize(&frame_size)); + CHECK_HR_RET(capture_frame->get_ContentSize(&frame_size)); if (frame_size.Width != wgctx->cap_size.Width || frame_size.Height != wgctx->cap_size.Height) { av_log(avctx, AV_LOG_VERBOSE, "Capture size changed to %dx%d\n", frame_size.Width, frame_size.Height); @@ -1394,7 +1394,7 @@ static int process_frame_if_exists(AVFilterLink *outlink) ComPtr<ID3D11Texture2D> frame_texture; TimeSpan frame_time = { 0 }; - ret = wgc_try_get_next_frame(avctx, &capture_frame); + ret = wgc_try_get_next_frame(avctx, capture_frame); if (ret < 0) return ret; |