X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=h264encode.cpp;h=19cd2fc3f7ba99dad675e8575326e597df44e907;hb=6796837c2e3e08de8d530be233317a2fc4a43f72;hp=6eb11d1ef1204b0efc7d03b67bde09a3cb603733;hpb=c76392ca2e019399e6123a7ba0849090a3f7a4ce;p=nageru diff --git a/h264encode.cpp b/h264encode.cpp index 6eb11d1..19cd2fc 100644 --- a/h264encode.cpp +++ b/h264encode.cpp @@ -1868,11 +1868,11 @@ bool H264Encoder::begin_frame(GLuint *y_tex, GLuint *cbcr_tex) return true; } -void H264Encoder::end_frame(RefCountedGLsync fence, const std::vector &input_frames_to_release) +void H264Encoder::end_frame(RefCountedGLsync fence, const std::vector &input_frames) { { unique_lock lock(frame_queue_mutex); - pending_frames[current_storage_frame++] = PendingFrame{ fence, input_frames_to_release }; + pending_frames[current_storage_frame++] = PendingFrame{ fence, input_frames }; } frame_queue_nonempty.notify_one(); } @@ -1901,10 +1901,7 @@ void H264Encoder::copy_thread_func() glClientWaitSync(frame.fence.get(), 0, 0); // Release back any input frames we needed to render this frame. - // (Actually, those that were needed one output frame ago.) - for (FrameAllocator::Frame input_frame : frame.input_frames_to_release) { - input_frame.owner->release_frame(input_frame); - } + frame.input_frames.clear(); // Unmap the image. GLSurface *surf = &gl_surfaces[current_frame_display % SURFACE_NUM];