[x264-devel] Re: x264 can't read large file
Måns Rullgård
mru at inprovide.com
Fri Jul 15 10:40:51 CEST 2005
Ikseong Bae said:
> x264 can't read large file if the file size is greater than 2^31 (2 gbyte),
> I modifed the source code enable to read large files.
>
> ==> modified code
> static int get_frame_total_yuv( hnd_t handle, int i_width, int i_height )
> {
> int i_frame_total = 0;
> int fh;
> int64_t n64Size, n64Pos;
> if( (fh = _open(gnp08FileName, _O_RDONLY )) != -1 )
> {
> n64Pos = _lseeki64 ( fh, 0L, SEEK_END );
> if( n64Pos == -1L )
> perror( "_lseek to end failed" );
> n64Size = _telli64( fh );
> i_frame_total = (int)(n64Size / ( i_width * i_height * 3 / 2 ));
> _close( fh );
> }
> return i_frame_total;
> }
No good. That won't build on a Unix system. The proper way is to use
fopen64, fseek64, etc, or build with _LARGEFILE_SOURCE and _FILEOFFSET_BITS=64.
--
Måns Rullgård
mru at inprovide.com
--
This is the x264-devel mailing-list
To unsubscribe, go to: http://developers.videolan.org/lists.html
More information about the x264-devel
mailing list