History

avcodec/libtheora: fix setting keyframe_mask

t_info.keyframe_granule_shift is set to the library default of 6, which is ok for gop sizes up to 63. Since there's apparently no way to query the updated value after having forced a gop value with TH_ENCCTL_SET_KEYFRAME_FREQUENCY_FORCE, calculate it manually instead. Fixes ticket #11454.

James Almer committed 1 year ago

Commit 22aa71d1 parent eb3d5071 file · +1 −1Browse files

Unified · Split

libavcodec/libtheoraenc.c+1−1
@@ -234,7 +234,7 @@ static av_cold int encode_init(AVCodecContext* avc_context) · 233 unmodified lines
234 return AVERROR_EXTERNAL;234 return AVERROR_EXTERNAL;
235 }235 }
236 236
237 h->keyframe_mask = (1 << t_info.keyframe_granule_shift) - 1;237 h->keyframe_mask = (1 << av_ceil_log2(avc_context->gop_size)) - 1;
238 /* Clear up theora_info struct */238 /* Clear up theora_info struct */
239 th_info_clear(&t_info);239 th_info_clear(&t_info);
240 240

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t