Skip to content

Commit

Permalink
EncodePipelineVAAPI: Don't allocate extra VA surface (alvr-org#1796)
Browse files Browse the repository at this point in the history
This doesn't really matter all that much since it's only one extra
surface, but it would be shame if someone took inspiration here and
copied this bad code somewhere else (as I did).
  • Loading branch information
nowrep authored Aug 18, 2023
1 parent 4088ac3 commit 4afd1b3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion alvr/server/cpp/platform/linux/EncodePipelineVAAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ AVFrame *map_frame(AVBufferRef *hw_device_ctx, AVBufferRef *drm_device_ctx, alvr
}

AVFrame * mapped_frame = av_frame_alloc();
av_hwframe_get_buffer(hw_frames_ref, mapped_frame, 0);
mapped_frame->format = AV_PIX_FMT_VAAPI;
mapped_frame->hw_frames_ctx = av_buffer_ref(hw_frames_ref);

AVBufferRef *drm_frames_ref = NULL;
if (!(drm_frames_ref = av_hwframe_ctx_alloc(drm_device_ctx))) {
Expand Down

0 comments on commit 4afd1b3

Please sign in to comment.