If missing, calculate width or height from bpp and

image size lowering the probe score too.

Originally committed as revision 20304 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 027e85d8
...@@ -61,6 +61,15 @@ static int mtv_probe(AVProbeData *p) ...@@ -61,6 +61,15 @@ static int mtv_probe(AVProbeData *p)
if(!(p->buf[51] && AV_RL16(&p->buf[52]) | AV_RL16(&p->buf[54]))) if(!(p->buf[51] && AV_RL16(&p->buf[52]) | AV_RL16(&p->buf[54])))
return 0; 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; return AVPROBE_SCORE_MAX;
} }
...@@ -82,6 +91,17 @@ static int mtv_read_header(AVFormatContext *s, AVFormatParameters *ap) ...@@ -82,6 +91,17 @@ static int mtv_read_header(AVFormatContext *s, AVFormatParameters *ap)
mtv->img_width = get_le16(pb); mtv->img_width = get_le16(pb);
mtv->img_height = get_le16(pb); mtv->img_height = get_le16(pb);
mtv->img_segment_size = 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); url_fskip(pb, 4);
audio_subsegments = get_le16(pb); audio_subsegments = get_le16(pb);
mtv->full_segment_size = mtv->full_segment_size =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment