changeset 31132:f5478d5be47e

Change WAV header updating in ao_pcm to allow to up to almost 4GB size. Patch by Rob McMullen [robm users sourceforge net]
author reimar
date Fri, 21 May 2010 17:19:01 +0000
parents 97488d0ea472
children b26739603191
files libao2/ao_pcm.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libao2/ao_pcm.c	Fri May 21 11:20:23 2010 +0000
+++ b/libao2/ao_pcm.c	Fri May 21 17:19:01 2010 +0000
@@ -210,9 +210,11 @@
 #endif
         if (broken_seek || fseek(fp, 0, SEEK_SET) != 0)
             mp_msg(MSGT_AO, MSGL_ERR, "Could not seek to start, WAV size headers not updated!\n");
-        else if (data_length > 0x7ffff000)
-            mp_msg(MSGT_AO, MSGL_ERR, "File larger than allowed for WAV files, may play truncated!\n");
         else {
+            if (data_length > 0xfffff000) {
+                mp_msg(MSGT_AO, MSGL_ERR, "File larger than allowed for WAV files, may play truncated!\n");
+                data_length = 0xfffff000;
+            }
             write_wave_header(fp, data_length);
         }
     }