Skip to content

Commit

Permalink
#2728: show nvEncOpenEncodeSessionEx return value details
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@26133 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Apr 15, 2020
1 parent 2023828 commit a0c3f11
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/xpra/codecs/nvenc/encoder.pyx
Expand Up @@ -2783,14 +2783,20 @@ cdef class Encoder:
self.context = NULL
with nogil:
r = self.functionList.nvEncOpenEncodeSessionEx(&params, &self.context)
if DEBUG_API:
log("nvEncOpenEncodeSessionEx(..)=%s", r)
if r==NV_ENC_ERR_UNSUPPORTED_DEVICE:
last_context_failure = monotonic_time()
msg = "NV_ENC_ERR_UNSUPPORTED_DEVICE: could not open encode session (out of resources / no more codec contexts?)"
log(msg)
raise TransientCodecException(msg)
if self.context==NULL:
if r!=0:
msg = nvencStatusInfo(r)
else:
msg = "context is NULL"
last_context_failure = monotonic_time()
raise TransientCodecException("cannot open encoding session, context is NULL, %i contexts are in use" % context_counter.get())
raise TransientCodecException("cannot open encoding session: %s, %i contexts are in use" % (msg, context_counter.get()))
raiseNVENC(r, "opening session")
context_counter.increase()
context_gen_counter.increase()
Expand Down

0 comments on commit a0c3f11

Please sign in to comment.