Commit Graph

35528 Commits

Author SHA1 Message Date
wm4 a0f7fa4ac5 README: copy paragraph about --enable-* from configure
This issue hits users way too often. Copy the explanation printed by the
configure script to the README to give it more visibility.

We will fix this properly once we have a new build system.
2013-07-16 00:03:51 +02:00
wm4 cde55d4c34 w32_common: don't use aspdat.asp for aspect
aspdat.asp is a problem, because it's updated when the VO calls
vo_get_src_dst_rects(). Nothing guarantees that the value has been
updated when the w32 code accesses it.

Instead, use the aspect vo_w32_config() was called with.
2013-07-16 00:03:51 +02:00
wm4 f77d243a68 mp_common: add MPMAX/MPMIN macros
From now on, usage of these macros is encouraged over using FFMAX and
FFMIN. FFMAX and FFMIN are perfectly fine, and the added macros are
actually exactly the same as the FFMAX and FFMIN definitions. But they
require including libavutil headers, and certain differences between
Libav and FFmpeg very often introduced breakages if these macros were
somehow not defined because a header was not recursively included.
Defining this macro on our own is the best way to escape from this
annoying issue.
2013-07-15 23:53:58 +02:00
wm4 853b468023 README: small addition to encoding dependencies 2013-07-15 21:43:14 +02:00
wm4 0a6654ce2f configure: add /usr/local on FreeBSD, also NetBSD/DragonFly
In my opinion this should be unneeded and unclean, which is why I
removed it some time ago. But apparently this is a convenience for BSD
users (so they don't have to use --extra-cflags), so add it back.
2013-07-15 21:31:15 +02:00
wm4 2599729e96 stream: remove unused vcd functions
Gets rid of warnings.
2013-07-15 21:29:25 +02:00
wm4 75dc7cbe0c demux_subreader: make clang happy to fix warning
Clang warns here, probably because it's easy to confuse with the usual
((a=b)) pattern.
2013-07-15 21:28:58 +02:00
wm4 eb98e43c0f Fix build on Libav stable (dammit)
The previous commit fixed Libav git, but it was still broken on
Libav 9.8.

Also, while we're at it, add a note to lavc_dr1.c and its status.
2013-07-15 03:24:12 +02:00
wm4 ee013bd969 Fix build on Libav (again)
....

This time actually tested with an actual Libav copy.
2013-07-15 03:00:58 +02:00
wm4 978831c8e3 Fix build on Libav
Sigh, why does this happen all the time...
2013-07-15 02:28:46 +02:00
wm4 169b3abd78 sd_ass: scale blur by original video size if requested 2013-07-15 02:01:37 +02:00
wm4 af55db654b sd_add: add terrible hack for (xy-)vsfilter compatibility
Much has been said about this topic, we don't need to say even more.

See additions to options.rst.
2013-07-15 02:01:37 +02:00
wm4 cb8f638292 vd: add VDCTRL_GET_PARAMS
This is probably going to be unused, but might help with debugging and
such. It returns the image parameters as determined by the video
decoder.
2013-07-15 01:49:26 +02:00
wm4 0ecd57d4b2 video: unify colorspace setup
Guess the colorspace directly in mpcodecs_reconfig_vo(), instead of in
set_video_colorspace(). The difference is that the latter function just
makes the video filter chain (and VOs) force the detected colorspace,
and then throws it away, while the former is a bit more general and
central. Not really a big difference and it doesn't matter much in
practice, but it guarantees that there is no internal disagreement about
the colorspace.
2013-07-15 01:49:26 +02:00
wm4 88e813aae6 vf: add vf_control wrapper
Slightly cleaner, although rather redundant. But still, why wasn't this
added 10 years ago?
2013-07-15 01:49:26 +02:00
wm4 17ab38bc66 dec_video: add vd_control wrapper
Slightly cleaner.
2013-07-15 01:49:26 +02:00
wm4 5f0fc0e914 mp_image: explicitly forbid using RGB colorspace with YUV formats
This probably has more potential for breakage than it would be of use.
2013-07-15 01:49:26 +02:00
wm4 5b01ef4572 mp_image: refactor colorspace guessing/fallback
This actually handles XYZ too.
2013-07-15 00:00:43 +02:00
wm4 65d8709152 demux_lavf: add terrible hack to make DVD playback just work
DVD playback had some trouble with PTS resets: libavformat's genpts
feature would try reading until EOF (worst case) to find a new usable
PTS in case a packet's PTS is not set correctly. Especially with slow
DVD access, this would make the player to appear frozen.

Reimplement it partially in demux_lavf.c, and use that code in the DVD
case. This is heavily "inspired" by the code in av_read_frame from
libavformat/utils.c. The difference is that we stop reading if no PTS
has been found after 50 packets (consider this a heuristic). Also, we
don't bother with the PTS wrapping and last-frame-before-EOF handling.
Even with normal PTS wraps, the player frontend will go to hell for the
duration of a frame anyway, and should recover quickly after that.

The terribleness of this commit is mostly that we duplicate libavformat
functionality, and that we suddenly need a packet queue.
2013-07-14 23:44:50 +02:00
wm4 e18ffd6b99 Merge branch 'remove_old_demuxers'
The merged branch doesn't actually just remove old demuxers, but also
includes a branch of cleanups and some refactoring.

Conflicts:
	stream/stream.c
2013-07-14 17:59:26 +02:00
wm4 5ead20bdb3 demux_raw: uncrustify
Should have been done before doing all the changes...
2013-07-14 17:55:54 +02:00
wm4 5ad42d0caf tech-overview.txt: minor changes and additions 2013-07-14 17:49:05 +02:00
James Ross-Gowan 3e7d483ac8 w32: update manifest for high DPI and Windows 8.1
Since Windows Vista, when running at 144 DPI or higher with composition
switched on, applications that don't declare themselves to be DPI aware
are stretched by the window manager, kind of like low resolution apps in
OSX.

To avoid this, declare DPI awareness in the manifest. Since mpv is
practically resolution independent this shouldn't cause any trouble. The
'True/PM' value declares per-monitor DPI awareness in Windows 8.1, so
that the mpv isn't shrunk when moved from a high DPI screen to one with
a lower DPI.

Also, avoid compatibility shims by declaring compatibility with all
Windows versions from Vista to 8.1 and add the missing uiAccess
attribute to the requestedExecutionLevel element.
2013-07-14 16:10:23 +02:00
wm4 5e6b96f1ff getch2-win: uncrustify 2013-07-14 16:08:27 +02:00
wm4 4b1ce17e23 input: never wait if there are new events in the input queue
Move the reading loop from read_all_fd_events to read_events. If
got_new_events is set when calling read_events, don't actually wait
and set the timeout to 0.

(Note that not waiting is sort of transparent to the caller: the caller
is just supposed to execute the event loop again, and then it will
actually wait. mplayer.c handles this correctly.)

This might reduce latency with some input sources.
2013-07-14 15:52:32 +02:00
wm4 38ce825091 input: invert negated boolean field 2013-07-14 15:38:04 +02:00
wm4 b2cbcbfc16 input: use only one array for input sources
Removes some code duplication. Also restructure the input waiting code
a bit: split the select() loop into a input_wait_read() function. On
systems which do not have POSIX select(), this function has an alternate
implementation, which waits unconditionally.
2013-07-14 15:27:55 +02:00
James Ross-Gowan ea7e54cb34 w32: silence some warnings 2013-07-13 14:43:54 +02:00
Stefano Pigozzi 58c92bce69 mp_ring: improve documentation
This improves some lacking areas of the documentation based on some remarks
and questions I got on IRC from @jon-y.
2013-07-13 10:33:07 +02:00
Stefano Pigozzi 9d9bcfa4f3 mp_ring: make mp_ring_read_cb provide an exact amount of bytes
The previous code would pass down `len` instead of `read_len` which, in theory,
could be more than what was available in the buffer.
2013-07-13 10:25:39 +02:00
Jonathan Yong dc4dcf34e5 stream_vcd: use intptr_t cast for _open_osfhandle in accordance to MSDN 2013-07-13 04:08:04 +02:00
Jonathan Yong e94fc5ee66 configure: fix vcd detection on Windows 2013-07-13 04:07:40 +02:00
wm4 84b69dcda5 demux_mkv: remove weird i_bps calculation code
Useless, as i_bps isn't really used for anything anymore.
2013-07-12 23:35:26 +02:00
wm4 666cb2dac2 mplayer: remove generic duration calculation
This was useless for anything but the raw demuxers. In most cases, this
would most likely lead to display of bogus duration values, because the
bitrates used are per-track, not the total file bitrate. There was
actually no case left where this code was helpful.

Note that demux_lavf has its own code for this using the total file
bitrate. Also, mplayer.c can calculate the playback percentage from
current file position / current file size. This is not removed.
2013-07-12 23:11:04 +02:00
wm4 32b828e442 demux_raw: calculate duration 2013-07-12 23:09:45 +02:00
wm4 cfa571253a demux_rawvideo/demux_rawaudio: move both demuxers to demux_raw.c
This allows them to share some trivial code. Both demuxers are still
separate from user perspective.
2013-07-12 23:06:53 +02:00
wm4 6c1e9e4a45 demux: make claiming accurate seek the default
Enables hr-seek for raw audio/video demuxers.
2013-07-12 22:29:34 +02:00
wm4 5de4a3ecc0 demux_rawvideo: fix timestamps in correct-pts mode 2013-07-12 22:25:52 +02:00
wm4 879c7a101b demux: assume correct-pts mode by default
All demuxers make a reasonable effort to set packet timestamps, and thus
support correct-pts mode. This commit also implicitly switches
demux_rawvideo to correct-pts mode.

We still allow demuxers to disable correct-pts mode in theory.
2013-07-12 22:16:27 +02:00
wm4 6c414f8c7a demux: remove useless author/comment fields
Same deal as with previous commit.
2013-07-12 22:16:27 +02:00
wm4 f406482d84 stream: remove useless author/comment fields
These were printed only with -v. Most streams had them set to useless
or redundant values, so it's just badly maintained bloat.

Since we remove the "author" field too, and since this may have
copyright implications, we add the contents of the author fields to
the file headers, except if the name is already part of the file header.
2013-07-12 22:16:27 +02:00
wm4 6d8f8fc4f0 stream: remove unused functions
These were used by old demuxers.
2013-07-12 22:16:27 +02:00
wm4 f63193f58f stream: remove fd member
Stream implementations could set this to a unix file descriptor. The
generic stream code could use it as fallback for a few things. This
was confusing and insane. In most cases, the stream implementations
defined all callbacks, so setting the fd member didn't have any
advantages, other than avoiding defining a private struct to store it.

It appears that even if the stream implementation used close() on the
fd (or something equivalent), stream.c would close() it a second time
(and on windows, even would call closesocket()), which should be proof
for the insanity of this code.

For stream_file.c, additionally make sure we don't close stdin or
stdout if "-" is used as filename.

For stream_vcd.c, remove the control() code. This code most likely
didn't make the slightest sense, because it used a different type
for stream->priv. It also leaked memory. Maybe it worked, but it's
incorrect and insignificant anyway, so kill it. This code was added
with commit 9521c19 (svn commit 31019).

Untested for all protocols other than stream_file.c.
2013-07-12 22:16:26 +02:00
wm4 b66c609b48 stream: use talloc for some string members
Minor simplification.
2013-07-12 22:16:26 +02:00
wm4 5c1b8d4aa1 stream: don't require streams to set a type
Set the type only for streams that have special treatment in other parts
of the code.
2013-07-12 22:16:26 +02:00
wm4 cb45b1c65b Cleanup some include statements 2013-07-12 22:16:26 +02:00
wm4 3269bd1780 demux: rewrite probing and demuxer initialization
Get rid of the strange and messy reliance on DEMUXER_TYPE_ constants.
Instead of having two open functions for the demuxer callbacks (which
somehow are both optional, but you can also decide to implement both...),
just have one function. This function takes a parameter that tells the
demuxer how strictly it should check for the file headers. This is a
nice simplification and allows more flexibility.

Remove the file extension code. This literally did nothing (anymore).

Change demux_lavf so that we check our other builtin demuxers first
before libavformat tries to guess by file extension.
2013-07-12 22:16:26 +02:00
wm4 311d2f199a mplayer: minor memory leak in error handling code 2013-07-12 21:57:27 +02:00
wm4 52c3eb6976 core: change open_stream and demux_open signature
This removes the dependency on DEMUXER_TYPE_* and the file_format
parameter from the stream open functions.

Remove some of the playlist handling code. It looks like this was
needed only for loading linked mov files with demux_mov (which was
removed long ago).

Delete a minor bit of dead network-related code from stream.c as well.
2013-07-12 21:56:40 +02:00
Jonathan Yong 27d352afbd ao_wasapi0: use new mp_ring buffer 2013-07-12 20:01:23 +02:00