# HG changeset patch # User reynaldo # Date 1255910160 0 # Node ID a011470132caa1d9161d8607b0153b0da5706fab # Parent c6028d6c93b08f7ce74139c987c32b0fcf6d3f8b If missing, calculate width or height from bpp and image size lowering the probe score too. diff -r c6028d6c93b0 -r a011470132ca mtv.c --- a/mtv.c Sun Oct 18 23:27:23 2009 +0000 +++ b/mtv.c Sun Oct 18 23:56:00 2009 +0000 @@ -61,6 +61,15 @@ if(!(p->buf[51] && AV_RL16(&p->buf[52]) | AV_RL16(&p->buf[54]))) return 0; + /* If width or height are 0 then imagesize header field should not */ + if(AV_RL16(&p->buf[52]) && AV_RL16(&p->buf[54])) + { + if(!!AV_RL16(&p->buf[56])) + return AVPROBE_SCORE_MAX/2; + else + return 0; + } + return AVPROBE_SCORE_MAX; } @@ -82,6 +91,17 @@ mtv->img_width = get_le16(pb); mtv->img_height = get_le16(pb); mtv->img_segment_size = get_le16(pb); + + /* Calculate width and height if missing from header */ + + if(!mtv->img_width) + mtv->img_width=mtv->img_segment_size / (mtv->img_bpp>>3) + / mtv->img_height; + + if(!mtv->img_height) + mtv->img_height=mtv->img_segment_size / (mtv->img_bpp>>3) + / mtv->img_width; + url_fskip(pb, 4); audio_subsegments = get_le16(pb); mtv->full_segment_size =