diff --git a/mythtv/libs/libavcodec/h263.c b/mythtv/libs/libavcodec/h263.c
index 057428a..2603098 100644
a
|
b
|
void ff_mpeg4_encode_video_packet_header(MpegEncContext *s) |
3209 | 3209 | * @return 0 if not |
3210 | 3210 | */ |
3211 | 3211 | static inline int mpeg4_is_resync(MpegEncContext *s){ |
3212 | | int bits_count= get_bits_count(&s->gb); |
3213 | | int v= show_bits(&s->gb, 16); |
| 3212 | const int bits_count= get_bits_count(&s->gb); |
3214 | 3213 | |
3215 | 3214 | if(s->workaround_bugs&FF_BUG_NO_PADDING){ |
3216 | 3215 | return 0; |
3217 | 3216 | } |
3218 | 3217 | |
3219 | | while(v<=0xFF){ |
3220 | | if(s->pict_type==B_TYPE || (v>>(8-s->pict_type)!=1) || s->partitioned_frame) |
3221 | | break; |
3222 | | skip_bits(&s->gb, 8+s->pict_type); |
3223 | | bits_count+= 8+s->pict_type; |
3224 | | v= show_bits(&s->gb, 16); |
3225 | | } |
3226 | | |
3227 | 3218 | if(bits_count + 8 >= s->gb.size_in_bits){ |
3228 | | v>>=8; |
| 3219 | int v= show_bits(&s->gb, 8); |
3229 | 3220 | v|= 0x7F >> (7-(bits_count&7)); |
3230 | 3221 | |
3231 | 3222 | if(v==0x7F) |
3232 | 3223 | return 1; |
3233 | 3224 | }else{ |
3234 | | if(v == ff_mpeg4_resync_prefix[bits_count&7]){ |
| 3225 | if(show_bits(&s->gb, 16) == ff_mpeg4_resync_prefix[bits_count&7]){ |
3235 | 3226 | int len; |
3236 | 3227 | GetBitContext gb= s->gb; |
3237 | 3228 | |
… |
… |
end: |
4550 | 4541 | |
4551 | 4542 | /* per-MB end of slice check */ |
4552 | 4543 | if(s->codec_id==CODEC_ID_MPEG4){ |
| 4544 | #if 0 //http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_IEC_14496-4_2004_Conformance_Testing/video_conformance/version_1/simple/ERROR.ZIP/mit025.m4v needs this but its unclear if the mpeg4 standard allows this at all (MN) |
| 4545 | if(s->pict_type != B_TYPE){ |
| 4546 | while(show_bits(&s->gb, 9 + (s->pict_type == P_TYPE)) == 1) |
| 4547 | skip_bits(&s->gb, 9 + (s->pict_type == P_TYPE)); |
| 4548 | } |
| 4549 | #endif |
4553 | 4550 | if(mpeg4_is_resync(s)){ |
4554 | 4551 | const int delta= s->mb_x + 1 == s->mb_width ? 2 : 1; |
4555 | 4552 | if(s->pict_type==B_TYPE && s->next_picture.mbskip_table[xy + delta]) |