Win32 Binary Stdout - Mod please read

Feature requests for VLC.
Polyphem
Blank Cone
Blank Cone
Posts: 15
Joined: 14 Nov 2005 09:35

Win32 Binary Stdout - Mod please read

Postby Polyphem » 21 Nov 2005 19:48

Hello VLC-Team,

in this Post viewtopic.php?t=14066 I reported some problems with the stdout under Windows.

Neither can I code C nor I have setup a compiling environment. Nevertheless maybe I have found out what went wrong. Maybe it is possible for anyone with a Win32 compilation environment already set-up to verfiy this (maybe the code has also to be tweaked).

My assumption what is going wrong under Win32 is the different Line-Break handling. I think Unix uses something like \n and Win32 something like \r\n for line-breaks.

So I guess something in the
https://trac.videolan.org/vlc/file/trun ... put/file.c
has to be changed.
From:
=====================
if( !strcmp( p_access->psz_name, "-" ) )
{
p_access->p_sys->i_handle = STDOUT_FILENO;
msg_Dbg( p_access, "using stdout" );
}
=====================

To:
=====================
if( !strcmp( p_access->psz_name, "-" ) )
{
if defined(MSDOS) || defined(OS2) || defined(WIN32)
SET_BINARY_MODE(stdout) setmode(fileno(stdout), O_BINARY)
else
define SET_BINARY_MODE(stdout)
endif
p_access->p_sys->i_handle = STDOUT_FILENO;
msg_Dbg( p_access, "using stdout" );
}
=====================

I extracted the code from the cUrl Project.

Can anyone confirm this and (if working) maybe include it in one of the next nightly builds? Thanks a lot and cheers.

Best Regards
Polyphem
Last edited by Polyphem on 29 Nov 2005 08:51, edited 1 time in total.

Guest

Postby Guest » 22 Nov 2005 20:11

Tried to compile myself with no luck, run into an error
"windres: share/vlc_win32_rc.rc:15: syntax error"
during final make :(...

Changed this file in the source
https://trac.videolan.org/vlc/file/trun ... put/file.c
From:
==============================
if( !strcmp( p_access->psz_name, "-" ) )
{
p_access->p_sys->i_handle = STDOUT_FILENO;
msg_Dbg( p_access, "using stdout" );
}
==============================

To:
==============================
if( !strcmp( p_access->psz_name, "-" ) )
{
#if defined(MSDOS) || defined(OS2) || defined(WIN32)
setmode (STDOUT_FILENO, O_BINARY);
#endif
p_access->p_sys->i_handle = STDOUT_FILENO;
msg_Dbg( p_access, "using stdout" );
}
==============================

Maybe anyone else can give it a try and report the outcome? Would be thankful.

Best Regards
Polyphem

Polyphem
Blank Cone
Blank Cone
Posts: 15
Joined: 14 Nov 2005 09:35

Postby Polyphem » 23 Nov 2005 18:15

After reading this
Additional changes required:

In share/vlc_win32_rc.rc, delete lines 15&16:
PRODUCTVERSION VERSION_NUMBER
FILEVERSION VERSION_NUMBER

Likewise in activex/axvlc_rc.rc, delete lines containing:
PRODUCTVERSION VERSION_NUMBER
FILEVERSION VERSION_NUMBER
here
viewtopic.php?t=12493
finally my VLC Nightly compiled correctly under Cygwin..... and the correction I mentioned in my second posting above WORKS (Hell, I can code C :) )!!! The file-stream to stdout under WIN32 / WindowsXP is now working for me.

This should be changed in
https://trac.videolan.org/vlc/file/trun ... put/file.c
From:
==============================
if( !strcmp( p_access->psz_name, "-" ) )
{
p_access->p_sys->i_handle = STDOUT_FILENO;
msg_Dbg( p_access, "using stdout" );
}
==============================

To:
==============================
if( !strcmp( p_access->psz_name, "-" ) )
{
#if defined(WIN32)
setmode (STDOUT_FILENO, O_BINARY);
#endif
p_access->p_sys->i_handle = STDOUT_FILENO;
msg_Dbg( p_access, "using stdout" );
}
==============================
Maybe a Moderator can copy this to the bug-reporting, that it is going to be fixed? Should have no impact on other OS.

Best Regards
Polyphem

Polyphem
Blank Cone
Blank Cone
Posts: 15
Joined: 14 Nov 2005 09:35

Postby Polyphem » 29 Nov 2005 08:52

Please add this one to the Bug-Reporting, Thanks.

Regards
Polypehm

dionoea
Cone Master
Cone Master
Posts: 5157
Joined: 03 Dec 2003 23:09
Location: Paris, France

Postby dionoea » 29 Nov 2005 15:44

Applied. Could i have your name (and email) to add in the THANKS file ?
Antoine Cellerier
dionoea
(Please do not use private messages for support questions)


Return to “VLC media player Feature Requests”

Who is online

Users browsing this forum: No registered users and 28 guests