# HG changeset patch # User michaelni # Date 1033079853 0 # Node ID f69f9cb461bc49a77f906a6af16419de084ccd2e # Parent e050a053e259b121c43a6e96e934b949f13ccb81 automatically detect broken opendivx codec and workaround, so bug=1 shouldnt be needed anymore for mpeg4 files, if there still are files which need bug=1 then tell me ... diff -r e050a053e259 -r f69f9cb461bc h263.c --- a/h263.c Thu Sep 26 09:16:23 2002 +0000 +++ b/h263.c Thu Sep 26 22:37:33 2002 +0000 @@ -4147,8 +4147,9 @@ } s->scalability= get_bits1(&s->gb); - if(s->workaround_bugs==1) s->scalability=0; + if (s->scalability) { + GetBitContext bak= s->gb; int dummy= s->hierachy_type= get_bits1(&s->gb); int ref_layer_id= get_bits(&s->gb, 4); int ref_layer_sampling_dir= get_bits1(&s->gb); @@ -4157,6 +4158,17 @@ int v_sampling_factor_n= get_bits(&s->gb, 5); int v_sampling_factor_m= get_bits(&s->gb, 5); s->enhancement_type= get_bits1(&s->gb); + + if( h_sampling_factor_n==0 || h_sampling_factor_m==0 + || v_sampling_factor_n==0 || v_sampling_factor_m==0 || s->workaround_bugs==1){ + + fprintf(stderr, "illegal scalability header (VERY broken encoder), trying to workaround\n"); + s->scalability=0; + + s->gb= bak; + goto redo; + } + // bin shape stuff FIXME printf("scalability not supported\n"); }