Commit Graph

33856 Commits

Author SHA1 Message Date
Kovensky 22481e75c0 .gitignore: ignore .exe files 2012-09-30 15:17:37 +02:00
Kovensky 077b41971b windows support: set -mwin32 when building on Cygwin
This makes cygwin define _WIN32 / WIN32, which it doesn't otherwise
define.
2012-09-30 15:16:59 +02:00
Kovensky bc63957551 windows support: include io.h when building on Cygwin 2012-09-30 15:16:53 +02:00
Kovensky 5fca3a6ea5 windows support: define WINVER to 0x0500
This means that we require Windows 2000 or later.
2012-09-30 15:16:48 +02:00
Anton Khirnov 60496c9e99 vf_lavc: fix compilation with latest libav
Remove a pointless and broken check for avctx->codec->encode.

1) The check does not test for anything useful.
2) AVCodecContext.encode is a private field and is not supposed to be
   accessed from outside of lavc.
2a) AVCodecContext.encode does not exist anymore in latest libavcodec,
    so this block fails to build.
2012-09-29 19:56:13 +02:00
wm4 6fb0e6bf1c build: use "python" instead of "python3" as interpreter name
This works regardless whether "python" starts a Python 2 or Python 3
interpreter.
2012-09-29 16:22:01 +02:00
wm4 0ee09dcdbe build: make Python scripts compatible with Python 2.x
They were originally written for Python 3.x. Changing them to work on
Python 2.x as well is trivial. Tested with Python 2.7.3 and 3.2.3.
2012-09-29 15:53:54 +02:00
Rudolf Polzer 327a5d0ecf encode: add options --ovfirst and --oafirst
This allows to define which stream is to be used as first output stream.
This is useful because dvdauthor refuses VOB files where the audio
stream is the first stream.
2012-09-29 15:04:40 +02:00
Rudolf Polzer 53c6a7480f encode: update to current ffmpeg API
This gets rid of some quite ugly code.
2012-09-29 15:04:25 +02:00
Rudolf Polzer a89a6f40c7 encode: fix -ocopyts with certain DVD images
When timestamps jump by more than 30 seconds, assume an unexpected
discontinuity. Fixes encoding aborts (i.e. no more frames written) at
DVD cell switches.
2012-09-29 15:02:36 +02:00
Rudolf Polzer c22482e08d TOOLS: fix first frame pts for dlopen/telecine.so
When the first frame of a telecine pattern did not generate an output
frame (because it is a 0 or a 1), this could lead to the first two
output frames getting equal pts values.

When the first frame of a telecine pattern generates exactly one output
frame (i.e. when the telecine pattern starts with 2 or 3), then the
output was correct before this comment, and still is unchanged.

When the first frame of a telecine pattern generates more than one
output frame (i.e. when it starts with 4 to 9), then output pts are
still broken. This is not really solvable without knowing the frame
duration, or delaying output by one frame.
2012-09-28 13:43:59 +02:00
Rudolf Polzer 65ea69f564 encoding examples: refuse upscaling when the target is an iPhone
This is ok, because the iPhone can handle any resolution. So there is no
need to waste space on upscaling the iPhone can do at playback time as
well.
2012-09-24 16:41:37 +02:00
Rudolf Polzer 5a3045f1a2 vf_scale: do the upscale detection AFTER calculating dimensions
Otherwise it heavily violates the manpage's description, and describing
what it did before in the documentation is something too complicated to
describe in the English language.
2012-09-24 16:41:12 +02:00
wm4 bcbc30e487 mp_msg: make MSGL_STATUS use the same color as MSGL_INFO
The green status line is annoying.
2012-09-23 15:25:01 +02:00
wm4 b2ba73c7b6 demuxer: fix crash with demux_rawvideo
rawvideo is a rather primitive demuxer that doesn't implement track
switching. The problem was that during track switching the demuxer
implementations normally set the stream IDs in order to do the switch,
and since rawvideo obviously didn't do that, so the current stream in
ds->sh / demuxer->video->sh was set to NULL. (The frontend always
assumes track switching is successful, which is a reasonable
assumption - failing due to missing video codecs etc. is in separate
codepaths.) Later, demux_rawvideo_fill_buffer() in demux_rawvideo.c
tried to dereference the NULL stream and crashed.

Other trivial single-stream demuxers worked fine, because they didn't
try to access ds->sh.
2012-09-23 15:15:43 +02:00
wm4 397eb9364b options: handle alias options differently
When setting an alias option, its value is not saved in the file-local
options case. The ensure_backup function in m_config.c exits if it
encounters an aliased option, because it should not be saved
additionally to the original option. However, the original option is
likely never saved in this case.

Change it so that ensure_backup always accesses the original option.
The original option is the one that first appears in the option list.
2012-09-23 14:58:56 +02:00
wm4 bfc3dbae88 options: simplify somewhat by introducing a union for option values
The m_option_value union is supposed to contain a field for each
possible option type (as long as it actually stores data). This helps
avoiding silly temporary memory alocations. Using a pointer to an union
and to a field of the union interchangeably should be allowed by
standard C.
2012-09-23 14:58:31 +02:00
wm4 7fe56f1602 options: accept "yes" and "no" only for flags
This removes the alternative values like "off", "0", "false" etc., and
also the non-English versions of these.

This is done for general consistency. It's better to have a single way
of doing things when multiple ways don't add singificant value.

Also update some choices for consistency.
2012-09-23 14:58:21 +02:00
wm4 f360f492d6 commands: fix parsing bug
When tabs are used as whitespace between command and the first string
parameter, the string is not correctly terminated.
2012-09-23 14:57:41 +02:00
wm4 85a64b76cc ao_pulse: extend maximum settable volume beyond 100%
The old maximum is 100%. Raise it to PA_VOLUME_UI_MAX, which is about
150%. PA_VOLUME_UI_MAX is the PulseAudio recommended UI-settable
maximum volume, so it seems to be a good idea to use that.
2012-09-23 14:57:37 +02:00
wm4 425ac31a3b softvol, ao_pulse: prefer ao_pulse volume control by default
--softvol is enabled by default. For most audio outputs, this is a good
thing, as they have either their own (bad) soft volume implementation,
or control the system mixer. With ao_pulse, the situation is a bit
different: it supports per-application volume (i.e. volume control is
not really global). More importantly, ao_pulse uses a rather large audio
buffer, and changing the volume with mplayer's volume filter has a large
delay. With the native ao_pulse volume control, it's instant, because
PulseAudio's audio filtering happens at a later stage in its processing
pipeline (inaccessible for mplayer).

This means native volume control should really be allowed for ao_pulse,
while it's the reverse for other audio outputs. Make --softvol a choice
option, and add a new "auto" choice. This is default and will use PA's
volume control with ao_pulse, and mplayer's volume filter otherwise
(i.e. the old softvol behavior).
2012-09-23 14:57:01 +02:00
wm4 c57883b71b configure: make --enable-openal use auto detection
OpenAL is disabled by default, because it supposedly inteferes with
some other configure tests and makes them fail silently.

Previously, --enable-openal followed configure's utterly braindead
semantics and disabled auto detection. However, since OpenAL was
disabled by default, there was no easy way to enable OpenAL at all,
even if it was explicitly requested. Solve this by making
--enable-openal use auto detection.
2012-09-23 14:56:49 +02:00
wm4 af14474879 options: make cache option always per-file
When playing a network stream, the cache is automatically enabled. We
don't want the cache to stay enabled when playback ends. (For example,
the next file to be played could be a local file, and even if that is
relatively contrieved, we want to do the right thing.)

Introduced the flag M_OPT_LOCAL to force an option to be always file
local. This allows enabling the old mplayer semantics on a per option
basis.
2012-09-23 14:56:30 +02:00
wm4 5a617d02d9 mplayer: fix abort command handling
Now it actually aborts, even if the abort command is not the first
command.

Make a policy change: commands before the abort command are silently
thrown away. Previously, normal commands were run after the abort
command finished (so they were run out of order). I'm not sure which
way is the best, all things considered, but the new way is simpler.
2012-09-23 14:56:24 +02:00
Rudolf Polzer a70adbfe65 getch2: request at least 1 byte of input each read
fixes issue with | less, where mplayer broke less's terminal
expectations and made less quit

Note this means that read() will be blocking again. Should be ok, as we
always check via select() before reading.
2012-09-19 14:57:35 +02:00
Rudolf Polzer 020a954b60 mp_msg: use stdout for all output except status; put status on stderr
improves interaction with | less, | grep, ...
2012-09-19 14:57:32 +02:00
Rudolf Polzer 2f1bc6beb6 mp_msg: enable --msgcolor by default; force it off if stdout is no tty 2012-09-19 14:57:29 +02:00
wm4 65adad50ab mplayer: unbreak OSD with CONFIG_ENCODING undefined
Basically, the encoding code path wanted to set osdlevel=0 as default,
while normal playback needs osdlevel=1. For this purpose, osdlevel was
set to -1 (i.e. invalid) initially to detect whether the --osdlevel
option was explicitly set. When encoding was not configured
(CONFIG_ENCODING undefined), the osdlevel value was not set from
-1 to 1 properly, and the OSD remained invisible by default.

Fix this by getting rid of this logic. It shouldn't be needed, since
osdlevel=1 never shows any OSD messages without user interaction.
Should this ever change, we could still check whether encoding is in
progress, or add another option to allow OSD rendering during encoding.
2012-09-18 21:08:20 +02:00
wm4 f5f0c66d1f options: rename noconfig to no-config, nocache to no-cache
This how it's supposed to be. The manpage has the correct names.
2012-09-18 21:08:20 +02:00
Stefano Pigozzi 09c5324314 cocoa_common: make fullscreen menubar/dock hiding conditional
cocoa_common was hiding the dock and menubar unconditionally when
going fullscreen. This means they were hidden even if they weren't on
the screen mplayer2 was going fullscreen on, resulting in poor user
experience.

Change the fullscreen function in the cocoa backend to check that
mplayer2 is on the same screen as the menubar/dock before hiding them.
2012-09-18 21:08:20 +02:00
Rudolf Polzer f5b8b6ac12 encode: video encoding now supported using mencoder-like options 2012-09-18 21:08:20 +02:00
Rudolf Polzer 5617bf483e TOOLS: add a new file identifier tool
It can provide properties of a file to the user on stdout, or when sourced by a
script, put them into its variables.
2012-09-18 21:08:20 +02:00
wm4 b248692034 commands: allow printing raw properties
Extend m_properties_expand_string() so that it can print properties as
unformatted string. Normally, properties will be pretty-printed
(intended for OSD and user interface purposes). Add the '=' modifier to
the format string syntax that disables pretty-printing and returns them
"raw".

For example, "${=switch_audio}" will print the track number, instead of
returning an OSD friendly string containing additional information like
track title and language.
2012-09-18 21:08:20 +02:00
Rudolf Polzer 416c03417e vf_rectangle: remove as it is very dirty and we have a replacement now 2012-09-18 21:08:20 +02:00
Rudolf Polzer 6371787b89 vf_dlopen: vf_rectangle filter moved to dlopen (unix only)
It is unix only, because vf_dlopen filters have no way to receive input (yet)
2012-09-18 21:08:20 +02:00
Rudolf Polzer 9343c1d3ab vf_dlopen: improve performance for 1-frame-for-1-frame filters
This is done by requesting a buffer from the next filter in the chain, instead
of always allocating our own. This allows the next filter to e.g. ensure its
own preferred memory layout.
2012-09-18 21:08:20 +02:00
wm4 c32082a1a7 mplayer: selectively reset track selection when playing multiple files
Normally, video/audio/sub track selection is persistent across files
played in the same mplayer instance. This is wanted, because settings
should not be reset across files in general. However, if the track
layout of a file is completely different from the previous, this will
essentially select random tracks. In this case, keeping the track
selection is confusing and unwanted.

Reset the track selection to default if the track layout changes. The
track layout is determined by number of tracks, track order, default
flag, whether the track is an external subtitle, and track language.
If a track layout change is detected when playing a new file, the -sid,
-aid and -vid options are reset to "auto".

This behavior is enabled only if the user selects tracks manually (via
keybinds and the "switch_audio" slave properties etc.). If no user
interactions take place, options specified on the command line will
follow the old behavior.
2012-09-18 21:08:20 +02:00
wm4 c8154630bf ad_dvdpcm: add back PCM decoder for DVD
This is needed by demux_mpg (and possibly by demux_ts) for PCM playback.
The decoder does the mapping from MPEG headers to the actual PCM format,
and also unpacks sample data for 20/24 bit formats.
2012-09-18 21:08:14 +02:00
Stefano Pigozzi 70e7d63ba0 core, timeline: cache external ordered chapter files too
Previously, Matroska source files other than the initially opened one
were always accessed without caching. Enable cache for extra files
too. A separate cache process/thread is started for each file, which
is less than optimal but probably better than no caching if the user
explicitly enabled cache. This commit only implements caching for
Matroska ordered chapters (not for EDL timeline).

To build the timeline we need to demux the files in the current
directory to look for segments with matching uuid. This first demux is
done with no cache since we don't need to read a lot of the stream. If
the file is recognized as one of the needed sources it's reopened with
cache enabled.

Also move the stream_cache_size global variable to the options struct.

Conflicts:
	cfg-mplayer.h
	mplayer.c
	stream/stream.h
	timeline/tl_matroska.c
2012-09-18 21:07:30 +02:00
Uoti Urpala 1959ba006c subs, vo_vdpau: support RGBA color for PGS subtitles
Support passing bitmap subtitles to VOs in full RGBA color, and
implement this for libavcodec-decoded subtitle formats on decoding
side and vo_vdpau on display side. Currently this is enabled for PGS
(blu-ray) and DVB subtitles.

VDPAU seems to have sampling issues similar to known GL ones when
drawing a sub-rectangle from a larger texture with scaling, where
adjacent pixels outside the specified source rectangle affect the
result. As the bitmap subtitles may be scaled, add padding support to
the bitmap packer code.

In principle, this could be used for colored DVD subtitles too.
However, the libavcodec DVD decoder lacks parts of the resolution and
palette handling that are present in spudec.c.

Conflicts:
	libvo/vo_gl.c
	sub/dec_sub.h
	sub/sd_lavc.c
2012-09-18 21:07:30 +02:00
wm4 ae9c3d530c libmpdemux: add back demux_ts
Someone wanted this. Apparently both libavformat's TS demuxer and
demux_ts are crap, and work/fail in different cases.

This demuxer has been removed in 1fde09db6f. All code added comes
from the revision before that. Some required bits have been added in
the commit before this one (re-adding demux_mpg), in particular the
changes to video.c.

stream_dvb will use this demuxer by default, otherwise demux_lavf is
preferred (as it has been before).

Some TS related command line options are not re-added.

Closed captions might not work.
2012-09-18 21:07:30 +02:00
wm4 c323592c3a libmpdemux: add back demux_mpg
Apparently this was needed for good DVD playback.

This demuxer has been removed in 1fde09db6f. All code added comes
from the revision before that. Some other bits have been removed in
later commits, and are added back as well.

Usage of memalign() is replaced by av_malloc(). As far as I can tell,
this memory is never free'd or reallocated, so no calls to av_free()
have been added.

The code re-added to video.c is plain horrible, full of code
duplication, full of demuxer/codecs specifics, but apparently needed.

Unrelated to re-adding the demuxer, re-add one codepath for
DEMUXER_TYPE_TV, which was accidentally removed in the same commit
demux_mpg was removed.

The closed captions decoder is not re-added.
2012-09-18 21:07:30 +02:00
wm4 b94cdc4baf options: change --vid, --aid, --sid options
The --vid, --aid, --sid options now accept the values 'off' and 'auto',
instead of having the user deal with the numeric values -2 and -1. The
numeric values are not allowed anymore.

Remove the --audio option. It was probably meant as compensation option
for --no-audio. There are no such options for sub/video, and it was not
documented, so just remove it. The replacement is "--aid=auto".

Also do some updates to the manpage.
2012-09-18 21:07:30 +02:00
wm4 c955549204 options: change --loop option, and extend choice option type
The --loop option takes slightly different parameters now. --loop=0
used to mean looping forever. Now it means looping is disabled (this is
more logical: 2 means playing 2 more times, 1 means playing 1 more time,
and 0 should mean playing not again).

Now --loop=inf must be used to enable looping forever.

Extend choice types to allow an optional range of integers as values.
If CONF_RANGE is added to the flags of a m_option_type_choice option,
m_option.min/max specify a range of allowed integer values. This can be
used to remove "special" values from make integer range options. These
special values are unintuitive, and sometimes expose mplayer internals
to the user. The (internal) choice values can be freely mixed with the
specified integer value range. If there are overlaps, the choice values
are preferred for conversion to/from strings.

Also make sure the extension to choice options works with properties.
Add the ability to step choice properties downwards, instead of just
upwards.
2012-09-18 21:07:29 +02:00
wm4 d29d4df634 options: remove M_OPT_IMPLICIT_DEFAULT
This was to make an option without value use the option's default value
(e.g. --term-osd is the same as --term-osd=auto). Make it simpler by
handling this case as an empty choice.

The flag was probably needed when option handling still did ambiguous
argument parsing.
2012-09-18 21:07:29 +02:00
wm4 f97a85595b options: remove -subalign
It can't be re-implemented, because this isn't supported by libass. The
-subalign option and the associated sub-align slave property did
nothing. Remove them.
2012-09-18 21:07:29 +02:00
wm4 130beda407 configure: add version check for libquvi
I do not know what exactly is the minimum working version. Require the
latest version currently released, which is about half a year old.
2012-09-18 21:07:29 +02:00
wm4 b28c6d0ba5 options: fix "--"
Handling this was accidentally forgotten when command line parsing was
refactored. The added recursive call should be a tail recursion with
all reasonable compilers, and it shouldn't be possible to provoke a
stack overflow.
2012-09-18 21:07:29 +02:00
wm4 1ba5a8f283 rawaudio: use mplayer audio format for format option
The rawaudio demuxer had a rather hard to use way to set the audio
format with the --rawaudio=format=value option. The user had to pass a
numeric value, which then was set as wFormatTag member in the
WAVEFORMATEX header.

Make it use the mplayer audio format (the same as --af=format=value).
Add a new internal pseudo audio codec tag, which is hopefully unused,
which makes ad_pcm use the value in wFormatTag as internal mplayer
audio format.

Playing non-PCM formats is disabled. (At least AC3 can be played
directly.)
2012-09-18 21:07:29 +02:00
wm4 1f5635d02c dec_audio: do not overwrite sh_audio->wf->wFormatTag
No decoder actually used this value (except ad_acm, which was removed a
while ago), so this change shouldn't have any bad consequences.
ad_ffmpeg passes wf to libavcodec decoders, but only the extra data
portion.

This change is needed by the next commit.
2012-09-18 21:06:40 +02:00