[Ffmpeg-devel] FFMPEG RTSP for Windows

Aurelien Jacobs aurel
Thu Mar 30 23:29:49 CEST 2006


On Thu, 30 Mar 2006 14:44:20 -0600 (CST)
"Michael A. Kohn" <mike at mikekohn.net> wrote:

> On Thu, 30 Mar 2006, Rich Felker wrote:
> 
> > However I'm still skeptical since you explicitly stated your test was
> > in MSVC.
> 
> If you're referring to this test:
> 
> main() { sleep(500); }
> 
> I didn't do that test on MSVC.  That won't even compile on MSVC since
> sleep isn't defined.  The code above on Linux takes 500 seconds to return
> while on Windows with MingW it takes 500 milliseconds.  In stdlib.h in
> MingW there is an explaination that sleep() is obsolete in Windows and
> Sleep is its replacement.

I remember seeing this behavior when using mingw, few years ago.

> > > > +#undef rand
> > > > +#define random rand
> > > > random is not allowed in libav*. If it's used this is a bug and must
> > > > be corrected.
> > >
> > > notice above these lines i wrote:
> > >
> > > > +/* I'm sure the next two lines are evil in some way, but I'm not sure
> > > > +   how else to do that right now */
> > >
> > > the way it is right now does not compile.  i was hoping someone could have
> > > been nice enough to explain why instead of you coming around and insulting
> > > me...  i'm sorry if what i did is so horrible, but that was the only way
> > > that was going to compile..
> >
> > Well if there's buggy code you need to fix it, not pile workarounds on
> > top of it that hide the bugs.
> 
> Well, I'm not sure how to take care of random() since it doesn't seem to
> exist in MingW.  Do you or anyone else on this mailing list have a good
> suggestion?

Yes. Just update your ffmpeg copy to latest CVS.
It doesn't use random() anymore ;-)

> > > > +#ifdef CONFIG_WIN32
> > > > +        getsockopt (fd, SOL_SOCKET, SO_ERROR, (char FAR *)&ret, (int
> > > FAR
> > > > *)&optlen);
> > >
> > > > The use of the FAR pointer qualifier is ABSOLUTELY WRONG!
> > > > This is win16 code!!
> > >
> > > According to MSDN Libaray that came with the Visual Studio I use when I
> > > have to do VC++ things:
> >
> > Again MSVC is _not supported_. This is intentional due to noncompliant
> > broken things exactly like what you've described here.
> 
> I don't use MSVC.  I'm not a Windows guy at all, I only program Windows at
> work and when cross compiling my own programs for others to use. I used
> MSDN's documentation every once in a while for looking up function
> prototypes and such since MingW as I understand it is supposed to be the
> GCC compiler working with Microsoft libraries and such.
> 
> Anyway, my question is, would you or anyone else like to me make these
> changes and resubmit a patch?  or should I just leave this code to myself?

Your changes seem desirable, if you are able to provide them in a
cleaner way (not so much #ifdef everywhere).
So yes, an updated patch could be nice.
Maybe spliting the patch would be even better (one patch for sleep,
one for the socket things, etc...)

Aurel





More information about the ffmpeg-devel mailing list