diff options
author | Aman Gupta <aman@tmm1.net> | 2017-11-15 12:50:31 -0800 |
---|---|---|
committer | Aman Gupta <aman@tmm1.net> | 2017-11-20 10:23:43 -0800 |
commit | 259dc4e01381c0d01fb1dbb8509c5087d621a0d7 (patch) | |
tree | 1c26b885ca1ce11a0aafa18e9270eccd4dee0f6e /libavdevice/avdevice.h | |
parent | 9302d77525da43b98b919cc78443768fc1798961 (diff) | |
download | ffmpeg-259dc4e01381c0d01fb1dbb8509c5087d621a0d7.tar.gz |
libavcodec/videotoolbox: fix decoding of h264 streams with minor SPS changes
Previously the codec kept an entire copy of the SPS, and restarted the VT decoder
session whenever it changed. This fixed decoding errors in [1], as
described in 9519983c. On further inspection, that sample features an SPS change
from High/4.0 to High/3.2 while moving from one scene to another.
Yesterday I received [2], which contains minor SPS changes where the
profile and level do not change. These occur frequently and are not associated with
scene changes. After 9519983c, the VT decoder session is recreated unnecessarily when
these are encountered causing visual glitches.
This commit simplifies the state kept in the VTContext to include just the first three
bytes of the SPS, containing the profile and level details. This is populated initially
when the VT decoder session is created, and used to detect changes and force a restart.
This means minor SPS changes are fed directly into the existing decoder, whereas
profile/level changes force the decoder session to be recreated with the new parameters.
After this commit, both samples [1] and [2] playback as expected.
[1] https://s3.amazonaws.com/tmm1/videotoolbox/spschange.ts
[2] https://s3.amazonaws.com/tmm1/videotoolbox/spschange2.ts
Signed-off-by: Aman Gupta <aman@tmm1.net>
Diffstat (limited to 'libavdevice/avdevice.h')
0 files changed, 0 insertions, 0 deletions