OSDN Git Service

nvenc: generate dts properly
authorAnton Khirnov <anton@khirnov.net>
Fri, 8 Jan 2016 16:08:39 +0000 (17:08 +0100)
committerAnton Khirnov <anton@khirnov.net>
Tue, 12 Jan 2016 08:23:38 +0000 (09:23 +0100)
commitc59fec783d6540dd96540b079d753ee4a6ad2e58
tree0e1428c34d28a4e69dbcc83f3db942a209017248
parent9d36cab4c0dc5089c023661aef9aeb8b009048fd
nvenc: generate dts properly

When there is a non-zero decoding delay due to reordering, the first dts
should be lower than the first pts (since the first packet fed to the
decoder does not produce any output).

Use the same scheme used in mpegvideo_enc (which comes from x264
originally) -- wait for first two timestamps and extrapolate linearly to
the past to produce the first dts value.
libavcodec/nvenc.c
libavcodec/nvenc.h