summaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2010-07-10 14:36:53 +0000
committerKostya Shishkov <kostya.shishkov@gmail.com>2010-07-10 14:36:53 +0000
commit42ff9d7a586c93bf145a11fe1d54410d8fe0fa1b (patch)
tree548610fe88472351869da3e29ac8fae22a412f81 /libavcodec
parent42d1e7a287f0395a7c00c6ff5b288e5324062dd1 (diff)
downloadffmpeg-streaming-42ff9d7a586c93bf145a11fe1d54410d8fe0fa1b.zip
ffmpeg-streaming-42ff9d7a586c93bf145a11fe1d54410d8fe0fa1b.tar.gz
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. Originally committed as revision 24161 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/vc1.c2
-rw-r--r--libavcodec/vc1dec.c9
2 files changed, 4 insertions, 7 deletions
diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index 7d00072..cca345d 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -388,7 +388,7 @@ int vc1_decode_sequence_header(AVCodecContext *avctx, VC1Context *v, GetBitConte
// 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 --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 3c596be..e547c26 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -1996,7 +1996,9 @@ static int vc1_decode_p_block(VC1Context *v, DCTELEM block[64], int n, int mquan
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 @@ static int vc1_decode_frame(AVCodecContext *avctx,
}
}
- 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;
OpenPOWER on IntegriCloud