]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
VMD playing error patch by (Kostya (cannonball bw-team com>)
authormichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Fri, 4 Feb 2005 03:38:33 +0000 (03:38 +0000)
committermichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Fri, 4 Feb 2005 03:38:33 +0000 (03:38 +0000)
"I recently got a game called Lighthouse from Sierra with FMV in VMD
format. Some of them played OK, some of them FFmpeg refused to open,
some caused a crash.

I investigated files which couldn't be opened by FFmpeg and it appeared
that they had no audio (and bytes 2-3 from beginning of file contained
01 00, all other have 00 00 insted). Attached patch fixes this issue."

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@3934 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavformat/sierravmd.c

index 0e268cb02c662dbac525159ca1b8f63c6c598dbb..16b6a8d4cccb9fa89a87452b07c0f96d18c6a00b 100644 (file)
@@ -185,7 +185,8 @@ static int vmd_read_header(AVFormatContext *s,
 
     /* each on-disk VMD frame has an audio part and a video part; demuxer
      * accounts them separately */
-    vmd->frame_count *= 2;
+    if(vmd->sample_rate)
+       vmd->frame_count *= 2;
     raw_frame_table = NULL;
     vmd->frame_table = NULL;
     raw_frame_table_size = vmd->frame_count * BYTES_PER_FRAME_RECORD;