[MPlayer-dev-eng] [PATCH] wav max filesize should be 4G, not 2G

Rob McMullen robm at users.sourceforge.net
Sat May 1 18:47:44 CEST 2010


On Sat, May 1, 2010 at 12:12 AM, Reimar Döffinger
<Reimar.Doeffinger at gmx.de> wrote:
> No, I think you also changed the "default" value that will be used when
> streaming, the other part I think is ok if it works independently.
> Or what do you think?

I see what you're saying.  You'd rather the default to be left at
0x7ffff000, but if the file pointer is seekable (and therefore a file
and not a pipe) it's OK to update the wave header to the full unsigned
size.

How about this patch?

Rob
-------------- next part --------------
Index: libao2/ao_pcm.c
===================================================================
--- libao2/ao_pcm.c	(revision 31027)
+++ libao2/ao_pcm.c	(working copy)
@@ -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);
         }
     }


More information about the MPlayer-dev-eng mailing list