[vlc-devel] [PATCH] Win32: define fstat as well as stat

Naohiro KORIYAMA nkoriyama at gmail.com
Thu Feb 2 01:13:14 CET 2012


This patch also fix abnormal termination on quitting current win32 build.
vlc-2.1.0-git-20120202-0009-win32-debug.7z always receives signal
SIGTRAP when quitting.


warning: HEAP[vlc.exe]:
warning: Heap block at 045AF7C8 modified at 045AF7D1 past requested size of 1


Program received signal SIGTRAP, Trace/breakpoint trap.
0x76ff04e5 in ntdll!TpWaitForAlpcCompletion () from
C:\Windows\system32\ntdll.dll
(gdb) bt
#0  0x76ff04e5 in ntdll!TpWaitForAlpcCompletion () from
C:\Windows\system32\ntdll.dll
#1  0x0028fb00 in ?? ()
#2  0x76fd5732 in ntdll!RtlLargeIntegerDivide () from
C:\Windows\system32\ntdll.dll
#3  0x045af7c8 in ?? ()
#4  0x76fb29fa in ntdll!RtlCopyExtendedContext () from
C:\Windows\system32\ntdll.dll
#5  0x00000000 in ?? ()
(gdb)


2012/2/2 Naohiro KORIYAMA <nkoriyama at gmail.com>:
> 2012/2/2 Naohiro KORIYAMA <nkoriyama at gmail.com>:
>> I noticed this issue when I played TS file on win32 build and VLC
>> showed time as 0:00:00.
>> It showed properly on Win64, Mac OS X builds.
>>
>> So, I debugged with TS file 2.78GB(2,993,376,420).
>>
>> At module/demux/ts.c:1996
>
> line no 1996 is wrong, 1970 is true.
>
>> int64_t i_size = stream_Size( p_demux->s );
>>
>> using fstat:
>> i_size = 4611686018427387904
>>
>> using _fstati64:
>> i_size = 2993376420
>>
>>
>> 2012/2/2 Naohiro KORIYAMA <nkoriyama at gmail.com>:
>>> Fix wrong result of stream_Size() on win32 build.
>>>
>>> ---
>>>  include/vlc_fs.h |    3 +++
>>>  1 files changed, 3 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/include/vlc_fs.h b/include/vlc_fs.h
>>> index d5b78e2..94b8515 100644
>>> --- a/include/vlc_fs.h
>>> +++ b/include/vlc_fs.h
>>> @@ -69,6 +69,9 @@ static inline void vlc_rewinddir( DIR *dir )
>>>  #  ifndef stat
>>>  #   define stat _stati64
>>>  #  endif
>>> +#  ifndef fstat
>>> +#   define fstat _fstati64
>>> +#  endif
>>>  # endif
>>>  #endif
>>>
>>> --
>>> 1.7.8.3
>>
>>
>>
>> --
>> KORIYAMA, Naohiro
>> nkoriyama at gmail.com
>
>
>
> --
> KORIYAMA, Naohiro
> nkoriyama at gmail.com



-- 
KORIYAMA, Naohiro
nkoriyama at gmail.com



More information about the vlc-devel mailing list