xpra icon
Bug tracker and wiki

Ticket #2051: nvenc-h265-missing-picture.patch

File nvenc-h265-missing-picture.patch, 2.1 KB (added by Antoine Martin, 2 years ago)

ignore missing picture

  • xpra/codecs/dec_avcodec2/decoder.pyx

     
    559559        if self.actual_pix_fmt!=self.av_frame.format:
    560560            if self.av_frame.format==-1:
    561561                self.log_error(buf_len, "unknown format returned")
    562                 return None
    563             self.actual_pix_fmt = self.av_frame.format
    564             if self.actual_pix_fmt not in ENUM_TO_FORMAT:
    565                 av_frame_unref(self.av_frame)
    566                 log.error("unknown output pixel format: %s, expected %s (%s)", self.actual_pix_fmt, self.pix_fmt, self.colorspace)
    567                 return None
    568             log("avcodec actual output pixel format is %s (%s), expected %s (%s)", self.actual_pix_fmt, self.get_actual_colorspace(), self.pix_fmt, self.colorspace)
     562            else:
     563                self.actual_pix_fmt = self.av_frame.format
     564                if self.actual_pix_fmt not in ENUM_TO_FORMAT:
     565                    av_frame_unref(self.av_frame)
     566                    log.error("unknown output pixel format: %s, expected %s (%s)", self.actual_pix_fmt, self.pix_fmt, self.colorspace)
     567                    return None
     568                log("avcodec actual output pixel format is %s (%s), expected %s (%s)", self.actual_pix_fmt, self.get_actual_colorspace(), self.pix_fmt, self.colorspace)
    569569
    570570        cs = self.get_actual_colorspace()
    571571        if cs.endswith("P"):
     
    597597
    598598        if outsize==0:
    599599            av_frame_unref(self.av_frame)
    600             raise Exception("output size is zero!")
     600            options["delayed"] = True
     601            return None
     602            #raise Exception("output size is zero!")
    601603        if self.codec_ctx.width<self.width or self.codec_ctx.height<self.height:
    602604            raise Exception("%s context dimension %ix%i is smaller than the codec's expected size of %ix%i for frame %i" % (self.encoding, self.codec_ctx.width, self.codec_ctx.height, self.width, self.height, self.frames+1))
    603605