[FFmpeg-devel] [PATCH] Fix cmdutils.c:read_file() on Windows.
Ramiro Polla
ramiro.polla
Sat May 22 00:05:15 CEST 2010
Hi,
r22769 moved reading of the 2pass file to cmdutils.c, and removed the
re-attribution of size to the return value of fread(). On Windows, the
file size from fseek/ftell returns the total file size (with \r
characters), but the return value of fread() (and therefore the number
of bytes actually read) don't include \r characters.
I attached two possible fixes: one re-attributes size to the return
value of fread(), the other opens the file in binary mode.
I don't know if any system will choke on the extra 'b' in "rb" on the
second option, but anyways I prefer option 1...
Ramiro Polla
-------------- next part --------------
A non-text attachment was scrubbed...
Name: read_file_windows.diff
Type: application/octet-stream
Size: 353 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100521/4e643ee2/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: read_file_windows_2.diff
Type: application/octet-stream
Size: 414 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100521/4e643ee2/attachment-0001.obj>
More information about the ffmpeg-devel
mailing list