The OSErr type on Mac OS X is int16_t, not int32_t (see
http://developer.apple.com/mac/library/documentation/QuickTime/Reference/QTRef_DataTypes/Reference/reference.html).
The upper 16 bits will typically be something random (they're entirely
undefined). Change the type so it's right; a few places tried to compensate
for this by masking out the upper bits, but a few places also missed them,
which made for unpredictable behavior.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30854 b3059339-0415-0410-9bf9-f77b7e298cf2
Implement Win32 mutexes; they used to just be mapped on top of events, which
is not the same thing at all.
The implementation is pretty much the obvious one, similar to the
current critical section implementation and the semaphore implementation;
a single lock count protected by a pthread mutex, and an event lockers can
sleep on to know when the mutex is available.
Also make CreateMutexA and ReleaseMutex available even if QuickTime codecs
support is not configured.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30853 b3059339-0415-0410-9bf9-f77b7e298cf2
Two simple bugfixes for semaphores in WaitForSingleObject:
First, semaphore count should be decreased on loading the semaphore, not
increased. The case for duration=0 had this wrong (duration=-1 was fine).
Second, the code for duration=-1 forgot to set the return value, so it
would always return WAIT_FAILED.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30852 b3059339-0415-0410-9bf9-f77b7e298cf2
loader/win32.c contains a global linked list of all existing mutexes
(whose head is called mlist), which is accessed from multiple threads,
and as such needs to be protected by a mutex. Fixed.
Same thing for the global linked list of all existing threads, whose
head is called list.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30851 b3059339-0415-0410-9bf9-f77b7e298cf2
in other places.
This removes platform specific checks and prevents repeated definitions
of O_BINARY.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30850 b3059339-0415-0410-9bf9-f77b7e298cf2
Enable ASS/SSA rendering through libass in mencoder. This duplicates a
bit of code (to parse font attachments, for example). Additionally, add
a filter "fixpts" that generates PTS, simulating fixed fps. PTS
generated by this filter are then used for subtitle timing.
Original patch by Nicolas George. (nicolas.george normalesup.org)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30849 b3059339-0415-0410-9bf9-f77b7e298cf2
Some codecs, and more recently Microsoft's CRT library, expect GetModuleHandle(NULL)
to return a pointer to the program's PE header mapped in memory. Thus, just returning
0x0 or 0x1 won't do it anymore, so create a minimal PE header and return that.
Patch originally by Gianluigi Tiesi ( mplayer (at) netfarm (dot) it ).
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30848 b3059339-0415-0410-9bf9-f77b7e298cf2
This avoids the fopen call which could end up creating a /dev/tty file
if it did not exist.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30846 b3059339-0415-0410-9bf9-f77b7e298cf2
Some extra changes snuck into my commit; they'll probably be reviewed
and committed to Subversion eventually, but were not part of the fix
for WaitForSingleObject on thread handles.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30844 b3059339-0415-0410-9bf9-f77b7e298cf2
Some codecs need this for clean shutdown (as opposed to a crash); we don't
really support timed wait since POSIX doesn't, but it doesn't seem necessary.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30843 b3059339-0415-0410-9bf9-f77b7e298cf2
converter with support for rgb444 output format.
Patch by Janusz Krzysztofik jkrzyszt chez tis icnet pl
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30841 b3059339-0415-0410-9bf9-f77b7e298cf2
libswscale.
Patch by Alexis Ballier, alexis D ballier A gmail
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30840 b3059339-0415-0410-9bf9-f77b7e298cf2
Earlier, cs->locked was accessed outside the mutex to get around
the problem that default pthread mutexes are not recursive
(ie., you cannot do a double-lock from the same thread), causing
a thread-safety problem, as both detected by Helgrind and showing
up in some multithreaded codecs.
The ideal solution here would be to simply use recursive pthread
mutexes, but there were concerns about reduced debuggability and
possibly portability. Thus, instead, rewrite the critical sections
to be a simple lock count (with owner) protected by a regular mutex.
Whenever a thread wants to enter the critical section and lock_count
is not 0, it sleeps on a special event that tells it when the
critical section is available.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30837 b3059339-0415-0410-9bf9-f77b7e298cf2
CreatePalette had problems for me, and looking at the code it was quite
obvious why; someone had reversed the order of the two elements of the
LOGPALETTE struct, causing it to allocate and copy a bogus amount of memory.
Why on earth anybody would want to do that is beyond me; whoever did it even
left a comment, but it wasn't very helpful, as it crashed nevertheless. :-)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30832 b3059339-0415-0410-9bf9-f77b7e298cf2
Events have a “reset” member that specify if they flag is automatically
set back on read/wait. However, this was populated by bManualReset, so the
flag was inverted and once an event was set, it would forever be counted
as so. Fixed by inverting the flag.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30831 b3059339-0415-0410-9bf9-f77b7e298cf2
These were simply inverted compared to what they should be.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30830 b3059339-0415-0410-9bf9-f77b7e298cf2
2. Define SetPriorityClass() and GetCurrentProcess() in osdep.h
3. Include osdep.h in priority.c
This removes OS2-platform check in priority.c
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30828 b3059339-0415-0410-9bf9-f77b7e298cf2
127.32L to me, beware when using git svn dcommit for committing stuff
to svn...
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30827 b3059339-0415-0410-9bf9-f77b7e298cf2
case where the source format is PIX_FMT_GRAY8.
This is required as PIX_FMT_GRAY8 has been declared as a paletted
format in FFmpeg r22191, fix GRAY8 -> RGB conversion.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30826 b3059339-0415-0410-9bf9-f77b7e298cf2
format.
Make swscale-test only perform the test from the input to the output
format rather than perform all.
Also implement swscale-test-all.sh, for performing all the tests.
Improve flexibility of the swscale-test tool, this way is simpler to
perform only a subset of tests.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30825 b3059339-0415-0410-9bf9-f77b7e298cf2
mpcodecs_config_vo so we need to query it afterwards.
Still try to set a more sensible, codec-dependant preferred format even
though it is currently ignored.
Fixes bug #1659, based on patch by Andrew Wason [rectalogic rectalogic com]
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30824 b3059339-0415-0410-9bf9-f77b7e298cf2
gives the correct behaviour - before placement would depend on the
original movie size instead of the one scaled according to -geometry.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30823 b3059339-0415-0410-9bf9-f77b7e298cf2
screen borders with -geometry.
Based on patch by Melchior FRANZ [melchior franz gmail com].
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30822 b3059339-0415-0410-9bf9-f77b7e298cf2