# HG changeset patch # User kostya # Date 1278772613 0 # Node ID 9ba7d2a5b20a280ecc24243b8d684528c7c0e154 # Parent 3581c6b92f70b8410fe3d017d35202bdcf55163e Make WMV3 decoder print more errors when decoding beta WMV9 files. As a side effect it will also decode a lot of P-frames from those. diff -r 3581c6b92f70 -r 9ba7d2a5b20a vc1.c --- a/vc1.c Sat Jul 10 14:26:37 2010 +0000 +++ b/vc1.c Sat Jul 10 14:36:53 2010 +0000 @@ -388,7 +388,7 @@ // av_log(avctx, AV_LOG_ERROR, // "0 for reserved RES_RTM_FLAG is forbidden\n"); av_log(avctx, AV_LOG_ERROR, - "Old WMV3 version detected, only I-frames will be decoded\n"); + "Old WMV3 version detected, some frames may be decoded incorrectly\n"); //return -1; } //TODO: figure out what they mean (always 0x402F) diff -r 3581c6b92f70 -r 9ba7d2a5b20a vc1dec.c --- a/vc1dec.c Sat Jul 10 14:26:37 2010 +0000 +++ b/vc1dec.c Sat Jul 10 14:36:53 2010 +0000 @@ -1996,7 +1996,9 @@ if(ttblk == TT_4X4) { subblkpat = ~(get_vlc2(gb, ff_vc1_subblkpat_vlc[v->tt_index].table, VC1_SUBBLKPAT_VLC_BITS, 1) + 1); } - if((ttblk != TT_8X8 && ttblk != TT_4X4) && (v->ttmbf || (ttmb != -1 && (ttmb & 8) && !first_block))) { + if((ttblk != TT_8X8 && ttblk != TT_4X4) + && ((v->ttmbf || (ttmb != -1 && (ttmb & 8) && !first_block)) + || (!v->res_rtm_flag && !first_block))) { subblkpat = decode012(gb); if(subblkpat) subblkpat ^= 3; //swap decoded pattern bits if(ttblk == TT_8X4_TOP || ttblk == TT_8X4_BOTTOM) ttblk = TT_8X4; @@ -3212,11 +3214,6 @@ } } - if(s->pict_type != FF_I_TYPE && !v->res_rtm_flag){ - av_free(buf2); - return -1; - } - // for hurry_up==5 s->current_picture.pict_type= s->pict_type; s->current_picture.key_frame= s->pict_type == FF_I_TYPE;