Open YaboWei opened 6 years ago
If scale_qsv + enc and ONLY enc called by different thread, ONLY enc may got a Locked mfxFrameSurface1(https://github.com/Intel-FFmpeg-Plugin/Intel_FFmpeg_plugins/blob/bd1a484e986b95052f9a15d444ee747746d706aa/libavcodec/qsvenc.c#L1120) which is Locked by scale_qsv + enc's scale_qsv, and this surf would never be Unlocked, and this surf in qsv_pool(https://github.com/Intel-FFmpeg-Plugin/Intel_FFmpeg_plugins/blob/bd1a484e986b95052f9a15d444ee747746d706aa/libavutil/hwcontext_qsv.c#L379) is "leak".
If scale_qsv also localize input surf like enc, ONLY enc would never got a Locked mfxFrameSurface1, it's OK.
Patch looks good expect need a better commit message.
If scale_qsv + enc and ONLY enc called by different thread, ONLY enc may got a Locked mfxFrameSurface1(https://github.com/Intel-FFmpeg-Plugin/Intel_FFmpeg_plugins/blob/bd1a484e986b95052f9a15d444ee747746d706aa/libavcodec/qsvenc.c#L1120) which is Locked by scale_qsv + enc's scale_qsv, and this surf would never be Unlocked, and this surf in qsv_pool(https://github.com/Intel-FFmpeg-Plugin/Intel_FFmpeg_plugins/blob/bd1a484e986b95052f9a15d444ee747746d706aa/libavutil/hwcontext_qsv.c#L379) is "leak".
If scale_qsv also localize input surf like enc, ONLY enc would never got a Locked mfxFrameSurface1, it's OK.