h->next_outputed_poc = INT_MIN;
}
} else {
- h->next_outputed_poc = out->poc;
+ if (out_idx == 0 && pics > 1 && h->delayed_pic[0]->f.key_frame) {
+ h->next_outputed_poc = INT_MIN;
+ } else {
+ h->next_outputed_poc = out->poc;
+ }
}
h->mmco_reset = 0;
}else{
int consumed;
int dst_length;
int bit_length;
- const uint8_t *ptr;
+ uint8_t *ptr;
int i, nalsize = 0;
int err;
}
if (h->is_avc && (nalsize != consumed) && nalsize){
+ // set trailing bits in the last partial byte to zero
+ if (bit_length & 7)
+ ptr[bit_length >> 3] = ptr[bit_length >> 3] & (0xff << 8 - (bit_length & 7));
av_log(h->s.avctx, AV_LOG_DEBUG, "AVC: Consumed only %d bytes instead of %d\n", consumed, nalsize);
}