[FFmpeg-devel] Windows deprecated stdin reading method

Peter dravorek at googlemail.com
Sat Mar 7 16:51:39 CET 2015


So trying to compile on VS2015 now works fine for the libraries.
However the command-line tool does not compile successfully.

The issue is this patch
https://github.com/FFmpeg/FFmpeg/commit/ca4d71b149ebe32aeaf617ffccf362624b9aafb1
which uses a member of the FILE struct which is not available in the
new C runtime (it's now just a struct with a void*).

I do not quite know the semantics of the stdin->_cnt > 0 check.

So I tried a few approaches, like using the deprecated function that is called
after the #ifdef block anyway:
https://github.com/Bigpet/FFmpeg/commit/b167e17e6f8839e1b4ce0edad2708ff4237e4aec
(I'm kind of worried about this since using "read(0, &ch, 1);" instead
of "getch" with that if
condition actually blocks in some cases, so it's not 100% equivalent)

Or trying to understand what the non-deprecated Win32 API calls would look like:
https://github.com/Bigpet/FFmpeg/commit/8d9cae13f389ab7dddc736ecac3feb01843ca094

But in the end I don't understand the purpose of the original piece of
code, so it's
hard to know what it should be replaced by. And finding documentation
on it seems
fruitless as well, since it used a non-public API to begin with.

Any help from people knowledgeable about the windows API would be appreciated.


More information about the ffmpeg-devel mailing list