OSDN Git Service

avcodec/cuvid: fail early if GPU can't handle video resolution
authorPavel Koshevoy <pkoshevoy@gmail.com>
Sun, 22 Jan 2017 23:20:05 +0000 (16:20 -0700)
committerTimo Rothenpieler <timo@rothenpieler.org>
Mon, 23 Jan 2017 16:49:35 +0000 (17:49 +0100)
commit9ea29985865720c24f6e7ac213a7dc597f1f0453
treea5bd1283ad1a77bc69eecaff7310048013fa66be
parentc16fe1432d88f87a96be9e943e0f1229543ad61d
avcodec/cuvid: fail early if GPU can't handle video resolution

CUVID on GeForce GT 730 and GeForce GTX 1060 does not report any error when
decoding 8K h264 packets. However, it does return an error during
cuvidCreateDecoder call if the indicated video resolution is not
supported.

Given that stream resolution is typically known as a result of probing
it is better to use this information during avcodec_open2 call to fail
immediately, rather than proceeding to decode and never receiving any
frames from the decoder nor receiving any indication of decode failure.

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
libavcodec/cuvid.c