if (!avctx->has_b_frames)
h->low_delay = 1;
- ff_h264_decode_init_vlc();
+ ret = ff_thread_once(&h264_vlc_init, ff_h264_decode_init_vlc);
+ if (ret != 0) {
+ av_log(avctx, AV_LOG_ERROR, "pthread_once has failed.");
+ return AVERROR_UNKNOWN;
+ }
if (avctx->codec_id == AV_CODEC_ID_H264) {
- if (avctx->ticks_per_frame == 1)
- h->avctx->framerate.num *= 2;
+ if (avctx->ticks_per_frame == 1) {
+ if(h->avctx->time_base.den < INT_MAX/2) {
+ h->avctx->time_base.den *= 2;
+ } else
+ h->avctx->time_base.num /= 2;
+ }
avctx->ticks_per_frame = 2;
}