Commit Graph

34567 Commits

Author SHA1 Message Date
wm4 a55a61762e mplayer: print "Cache:" instead of "C:" on the status line
Hasn't been done before because there wasn't enough space, but this
changed recently.
2013-02-17 21:06:34 +01:00
wm4 5ce8acbca3 osd: show cache state on the playback progression display by default
This affects the "show_progress" command, by defualt on the 'P' key.

If there are complaints, I'll probably remove it again. (It looks
relatively annoying, but it also valueable information... sort of.)
2013-02-17 21:06:28 +01:00
wm4 8a60122f80 command: add "cache" read-only property 2013-02-17 21:06:28 +01:00
wm4 32500b5e11 demux_mf: fix breakage after commit 4d016a9 2013-02-17 21:06:26 +01:00
wm4 80e9b3c0f2 cleanup: remove duplicated function, move escape parsing function 2013-02-16 23:24:46 +01:00
wm4 6b3e7740f1 osd: add --osd-status-msg option for custom OSD status 2013-02-16 22:31:29 +01:00
wm4 bd835cdeea mplayer: use talloc instead of malloc for status line 2013-02-16 22:04:43 +01:00
wm4 2107d58694 command: give feedback on the OSD if a property is unavailable
Until now, setting a property that is not available (e.g. deinterlacing
if not using vdpau and no deinterlacing filter is inserted) silently
failed (except for a messager on the terminal). Instead show on the OSD
that the property is unavailable.
2013-02-16 21:41:24 +01:00
wm4 6d7e044ead osd: add --no-osd-bar option to disable the OSD bar
In addition to disabling the OSD bar physically, also add some fallbacks
to OSD text in places the OSD bar would have been used.
2013-02-16 21:41:24 +01:00
wm4 f897138c2d osd: always update already visible OSD bar on seeks
Seeks can be performed with OSD bar invisible (e.g. "osd-msg seek ..."
command), and then an already visible bar won't be updated. But the bar
will stick around until the OSD text is hidden. This is confusing, so
change it that the bar is updated. (Making the bar disappear on such
seeks would require much more changes, so we're lazy and go with this
commit.)
2013-02-16 20:50:05 +01:00
wm4 57879a2200 options: change handling of "no-" options yet again
Commit 4a40eed "options: change handling of "no-" options" generally
improved the handling of automatically added negation options
(recognizing "--no-opt", even though only "--opt" is declared in the
option list).

Unfortunately, one corner case was missed, which broke the option
"--input=no-default-bindings" (other suboptions, e.g. VO suboptions,
were not affected, and this is the only option where this mattered).

Instead of increasing the complexity further, use a completely different
approach: add the "--no-" options at runtime, and make them behave like
real options. This approach could be considered slightly less elegant,
because the code now has to worry about some option implementation
details rather than leaving it to the parser, but all in all the new
code is simpler and there are less weird corner cases to worry about.
2013-02-16 19:57:57 +01:00
wm4 e8181ed9fb osd: add --osd-bar-align-x/y options to control OSD bar position 2013-02-14 20:45:44 +01:00
wm4 e4d52330af vo_xv: fix green border on the right 2013-02-14 20:41:09 +01:00
wm4 ac82c73224 demux: apply sparse video hack only to demux_lavf and demux_mkv
Apparently this cuases trouble for legacy demuxers. demux_mpg stopped
doing PCM audio. (The problem was probably that it read a bunch of
video packets on detection, and then the sparse video hack prevented
audio packets from being read, because it looked like there were no
more audio packets. With sparse video, this normally helps not reading
too many audio packets.)

Since the legacy demuxers do not need this hack, enable it for
demux_lavf and demux_mkv only.

Some additional hacks that were needed to handle legacy demuxers can be
removed, making the code simpler.

Also see commit 4a40eed.
2013-02-14 19:53:15 +01:00
wm4 e6307997d2 demux: restructure code that warns about packet buffer overflows
There should be no functional changes, except that way how avoiding
spamming the terminal with the overflow warning is handled changes a
bit.

The removed check for ds->eof looks suspicious, but it should be
redundant now.
2013-02-14 19:53:06 +01:00
wm4 55e4f76ce8 demux_mpg: fix setting codec
This made one case of DVD PCM audio not work. It still doesn't work,
but that will be fixed with the following two commits.
2013-02-14 19:52:34 +01:00
wm4 af6639500f Fix compilation with Libav 2013-02-14 19:52:18 +01:00
wm4 f9a259e5d5 mplayer: fix seek display during seeking when playing ordered chapters
The seek bar appeared to be "stuck" to the start of the current chapter.
This is a regression from 630a2b1. This commit assumed that hrseek_pts
would always contain the hrseek target time (when hrseek_active==true).
But this is not always the case: when playing timeline stuff (e.g.
ordered chapters), hrseek framedropping is abused to handle an obscure
corner case, and then hrseek_pts contains something completely unrelated
to the current playback time. See the added comment in mplayer.c and
commit c1232c9.

Fix this by trying something else to get a correct time "during"
hr-seeks. mpctx->restart_playback looks ideal, because it's set while
audio is being synced / audio buffers being filled, so we know that the
audio time is probably bogus while it is set. Let's hope this is
correct.
2013-02-13 13:22:12 +01:00
wm4 9e85d2ac13 dec_video: fix bogus assert
Basically a typo. Made playing ordered chapters crash.
2013-02-13 13:21:58 +01:00
wm4 75e6584ab3 Prefix keycode defines with MP_
Do this to reduce conflicts with <linux/input.h>, which contains some
conflicting defines.

This changes the meaning of MP_KEY_DOWN:

  KEY_DOWN is renamed to MP_KEY_DOWN (cursor down key)
  MP_KEY_DOWN is renamed to MP_KEY_STATE_DOWN (modifier for key down state)
2013-02-12 10:27:00 +01:00
wm4 3ded26ccba mp_common: silence warning
int64_t was accidentally used with "%lld" format specifiers, which is
incorrect (even though long long int is always 64 bits, the type behind
int64_t can be different, e.g. it can be long int on 64 bit platforms).
2013-02-12 10:20:50 +01:00
wm4 517d6dbfca demux: fix video with demux_mpg (DVD playback)
Commit 4d016a9 changed how demuxers report the codec of each stream.
Some of that was missed in video.c, which is important for legacy
demuxers (demux_mpg was broken by this, which is needed for DVD
playback).

Not sure about the ASF/AVI related change, but this is also a legacy
demuxers only codepath.
2013-02-12 10:16:38 +01:00
Martin 1f7decc1a0 Rename af_volnorm to af_drc
The previous name of this filter was misleading, because it doesn’t actually
normalize volume levels. What it does is closer to performing low-quality
dynamic range compression, hence it is now called af_drc.
2013-02-12 09:53:33 +01:00
wm4 f7636474eb configure: fix recently added tests
Commit 4d016a9 added some configure tests using statement_check.
They wrongly used $_ld_tmp, which causes random failure, depending on
whether the previous test using $_ld_tmp was successful. This happened
because I blindly copied the statement_checks from somewhere else.
Fix them.
2013-02-11 01:08:48 +01:00
wm4 01869d1391 demux_lavf, ad_lavc, vd_lavc: pass codec header data directly
Instead of putting codec header data into WAVEFORMATEX and
BITMAPINFOHEADER, pass it directly via AVCodecContext. To do this, we
add mp_copy_lav_codec_headers(), which copies the codec header data
from one AVCodecContext to another (originally, the plan was to use
avcodec_copy_context() for this, but it looks like this would turn
decoder initialization into an even worse mess).

Get rid of the silly CodecID <-> codec_tag mapping. This was originally
needed for codecs.conf: codec tags were used to identify codecs, but
libavformat didn't always return useful codec tags (different file
formats can have different, overlapping tag numbers). Since we don't
go through WAVEFORMATEX etc. and pass all header data directly via
AVCodecContext, we can be absolutely sure that the codec tag mapping is
not needed anymore.

Note that this also destroys the "standard" MPlayer method of exporting
codec header data. WAVEFORMATEX and BITMAPINFOHEADER made sure that
other non-libavcodec decoders could be initialized. However, all these
decoders have been removed, so this is just cruft full of old hacks that
are not needed anymore. There's still ad_spdif and ad_mpg123, bu neither
of these need codec header data. Should we ever add non-libavcodec
decoders, better data structures without the past hacks could be added
to export the headers.
2013-02-10 17:25:57 +01:00
wm4 dd61fac943 demux_lavf, ad_lavc, vd_lavc: refactor, cleanup
Rearrange some code to make it easier readable. Remove some dead code,
and stop printing AVI headers in demux_lavf. (These are not actual AVI
headers, just for internal use.)

There should be no functional changes, other than reducing output in
verbose mode.
2013-02-10 17:25:57 +01:00
wm4 a0987186b9 demux_lavf: remove code duplication
Also move the lang field into the general stream header. (SH_COMMON is
an old hack to "share" code between audio/video/sub headers.)

There should be no functional changes, other than not printing stream
info in verbose mode or with slave mode. (The frontend already prints
stream info, and this is just a leftover when individual demuxers did
this, and slave mode remains broken.)
2013-02-10 17:25:57 +01:00
wm4 4d016a92c8 core: redo how codecs are mapped, remove codecs.conf
Use codec names instead of FourCCs to identify codecs. Rewrite how
codecs are selected and initialized. Now each decoder exports a list
of decoders (and the codec it supports) via add_decoders(). The order
matters, and the first decoder for a given decoder is preferred over
the other decoders. E.g. all ad_mpg123 decoders are preferred over
ad_lavc, because it comes first in the mpcodecs_ad_drivers array.
Likewise, decoders within ad_lavc that are enumerated first by
libavcodec (using av_codec_next()) are preferred. (This is actually
critical to select h264 software decoding by default instead of vdpau.
libavcodec and ffmpeg/avconv use the same method to select decoders by
default, so we hope this is sane.)

The codec names follow libavcodec's codec names as defined by
AVCodecDescriptor.name (see libavcodec/codec_desc.c). Some decoders
have names different from the canonical codec name. The AVCodecDescriptor
API is relatively new, so we need a compatibility layer for older
libavcodec versions for codec names that are referenced internally,
and which are different from the decoder name. (Add a configure check
for that, because checking versions is getting way too messy.)

demux/codec_tags.c is generated from the former codecs.conf (minus
"special" decoders like vdpau, and excluding the mappings that are the
same as the mappings libavformat's exported RIFF tables). It contains
all the mappings from FourCCs to codec name. This is needed for
demux_mkv, demux_mpg, demux_avi and demux_asf. demux_lavf will set the
codec as determined by libavformat, while the other demuxers have to do
this on their own, using the mp_set_audio/video_codec_from_tag()
functions. Note that the sh_audio/video->format members don't uniquely
identify the codec anymore, and sh->codec takes over this role.

Replace the --ac/--vc/--afm/--vfm with new --vd/--ad options, which
provide cover the functionality of the removed switched.

Note: there's no CODECS_FLAG_FLIP flag anymore. This means some obscure
container/video combinations (e.g. the sample Film_200_zygo_pro.mov)
are played flipped. ffplay/avplay doesn't handle this properly either,
so we don't care and blame ffmeg/libav instead.
2013-02-10 17:25:56 +01:00
wm4 bb8da97205 dec_audio: uncrustify 2013-02-09 19:00:22 +01:00
wm4 a1be0e1aec options: change --no-config option, make it apply to input.conf as well
Simplify --no-config and make it a normal flag option, and doesn't take
an argument anymore. You can get the same behavior by using --no-config
and then --include to explicitly load a certain config file.

Make --no-config work for input.conf as well. Make it so that
--input:conf=file still works in this case. As a  technically unrelated
change, the file argument now works as one would expect, instead of
making it relatively to "~/.mpv/". This makes for simpler code and
easier to understand option semantics. We can also print better error
messages.
2013-02-09 00:21:18 +01:00
wm4 c1ddfb5907 Check return values of some mp_find_..._config_file function calls for NULL 2013-02-09 00:21:18 +01:00
wm4 a36e03781c mplayer: remove seconds/centiseconds display from terminal status line
Doesn't have much of a purpose for normal playback. You can get
milliseconds display with --osd-fractions. It's also possible to build
a custom status line with --status-msg.

This gives more space on the status line and, in my opinion, is a bit
less annoying.
2013-02-09 00:21:17 +01:00
wm4 88d843f909 cleanup: replace OPT_FLAG_ON and OPT_MAKE_FLAGS with OPT_FLAG
OPT_MAKE_FLAGS() used to emit two options (one with "no" prefixed),
but that has been long removed by special casing flag options in the
option parser. OPT_FLAG_ON() used to imply that there's no "no-"
prefixed option, but this hasn't been the case for a while either.
(Conceptually, it has been replaced by OPT_FLAG_STORE().)

Remove OPT_FLAG_OFF, which was unused.
2013-02-09 00:21:17 +01:00
wm4 267a889cc2 options: unify single dash and double dash options
There were two option syntax variations:

    "old":  -opt value
    "new": --opt=value

"-opt=value" was invalid, and "--opt value" meant "--opt=" followed by
a separate option "value" (i.e. interpreted as filename). There isn't
really any reason to do this. The "old" syntax used to be ambiguous
(you had to call the option parser to know whether the following
argument is an option value or a new option), but that has been removed.
Further, using "=" in the option string is always unambiguous.

Since the distinction between the two option variants is confusing,
just remove the difference and allow "--opt value" and "-opt=value".

To make this easier, do some other cleanups as well (e.g. avoid having
to do a manual lookup of the option just to check for M_OPT_PRE_PARSE,
which somehow ended up with finally getting rid of the m_config.mode
member).

Error reporting is still a mess, and we opt for reporting too many
rather than too few errors to the user.

There shouldn't be many user-visible changes. The --framedrop and
--term-osd options now always require parameters.

The --mute option is intentionally made ambiguous: it works like a flag
option, but a value can be passed to it explicitly ("--mute=auto"). If
the interpretation of the option is ambiguous (like "--mute auto"), the
second string is interpreted as separate option or filename. (Normal
flag options are actually ambiguous in this way too.)
2013-02-09 00:21:17 +01:00
wm4 5412993724 config: do not require option value
Now setting a value with "=" is not required anymore in config files.
This should work analogous to command line arguments. Putting an entry
"opt=value" into the config file is like "--opt=value" on the command
line, and "opt" is like "--opt=" and "--opt".
2013-02-09 00:21:17 +01:00
wm4 830560979c options: change handling of "no-" options
Normally, all flag options can be negated by prepending a "no-", for
example "--no-opt" becomes "--opt=no". Some flag options can't actually
be negated, so add a CONF_TYPE_STORE option type to disallow the "no-"
fallback.

Do the same for choice options. Remove the explicit "no-" prefixed
options, add "no" as choice.

Move the handling of automatic "no-" options from parser-mpcmd.c to
m_config.c, and use it in m_config_set_option/m_config_parse_option.
This makes these options available in the config file. It also
simplifies sub-option parsing, because it doesn't need to handle "no-"
anymore.
2013-02-09 00:21:16 +01:00
wm4 ae070a6f1e audio/out, video/out: hide encoding VO/AO
mpv -ao help and mpv -vo help shouldn't show the encoding outputs (named
"lavc" on both cases). Also make it impossible to select these manually
when not encoding.
2013-02-06 23:04:18 +01:00
wm4 4628ea3c46 video/out: change autoprobe order
Basically, move vo_opengl above the other VOs (except vo_vdpau). This
changes preferences on Windows and Linux.

Move vo_opengl_old further down and make it the last fallback (before
vo_x11).

vo_caca is crap (no pun intended), and should never be autoprobed.
2013-02-06 23:04:18 +01:00
wm4 13d97077ec audio/out: prefer ao_dsound over ao_portaudio
On Linux, ao_portaudio has weird freezing issues (possibly specific to
the ALSA backend, though). Also ao_dsound is more likely to get multi-
channel audio output right, and ao_portaudio probably mangles these.
2013-02-06 23:04:18 +01:00
wm4 7a6d26370c mixer: prefer AO softvol control over volume filter
This partially reverts earlier decisions, when I thought it would
always be better to prefer the audio volume filter over the AO's,
because the AO's relies on the underlying audio-API, which could
be broken or exhibit unusual behavior (like it happened with ao_dsound).

However, since the audio buffer can be quite large (500 ms), and we
don't attempt to flush & refilter the audio on volume changes, always
prefer AO volume control (as long as the AO mixer doesn't control the
system mixer).

Also document what the mixer.c related AO fields mean (hopefully not
too brief).
2013-02-06 23:04:18 +01:00
wm4 94f72b1e59 ao_dsound: support 6.1 and 7.1 channel configurations
Instead of doing the channel reordering manually, use the existing
support in reorder_ch.c.

Untested.
2013-02-06 23:04:12 +01:00
wm4 37c5c114af Remove BSD legacy TV/radio support (BT848 stuff)
FreeBSD actually supports V4L2, and V4L2 supports this chip. Also,
this chip is from 1997. Farewell.
2013-02-06 23:03:39 +01:00
wm4 c5340512dd core: remove --edlout functionality
This could write .edl files in MPlayer's format. Support for playing
these files has been removed from mplayer2 quite a while ago. (mplayer2
can play its own, "new" .edl format, but does not support writing it.)

Since this is a rather obscure functionality, and it's not really clear
how it should behave (e.g. what should it do if a new file is played),
and wasn't all that great to begin with (what if you made a mistake?
the "edl_mark" command sucks for editing), get rid of it.

Suggestions how to reimplement this in a nicer way are welcome. If it's
just about retrieving timecodes, this in input.conf will do:

    KEY print_text "position: ${=time-pos}"
2013-02-06 23:03:39 +01:00
wm4 74817a77d4 command: add command to show playlist on OSD 2013-02-06 23:03:39 +01:00
wm4 314a07e787 version.sh: fix git rev. generation (.git is not always a directory)
It appears git submodule handling recently changed, changing the .git
directory to a regular file containing submodule specific information.
This means that version.sh would generate "#define VERSION "git-UNKNOWN""
if the checkout is a submodule, because it explicitly checks for a .git
directory using test -d. Change it to -e so that this case is handled
correctly.
2013-02-06 23:03:37 +01:00
wm4 630a2b195a mplayer: don't show bogus audio PTS during hr-seek
This fixes a problem that happened with syncplay.pl [1] when ad_mpg123
was in use, and get_current_time() returning a bogus time position.
This only happens during seeking; the reported time is correct after the
seek is done.

The audio PTS as returned by playing_audio_pts() is simply bogus during
hr-seek. With ad_ffmpeg, it was actually set to MP_NOPTS_VALUE during
seeking, so get_current_time() did a fallback to the video PTS. However,
ad_mpg123 is different and explicitly decodes some audio when resetting
on seek (reasons why it does this unknown and uninvestigated; apparently
it's to reinit libmpg123). As a result, the audio PTS was set to the
start position of the seek (or something similar), which could be very
different from the seek target time.

This confused syncplay. It got the bogus time because it spams the
player with read commands to the "time-pos" property, so this corner
case was hit.

Fix this by making get_current_time() return the seek target time if
hr-seek is active. This should make behavior the same as before commit
3f949cf "mplayer: prefer audio PTS over video PTS for status line".

[1] http://syncplay.pl
2013-02-05 18:32:26 +01:00
wm4 cd08785aab mplayer: properly handle framestep when showing last video frame
When doing a framestep while there is no more video, nothing happened,
and audio continued to play. When advancing to the next file, the player
was paused. Fix it so that it always pauses (except on very low frame
rate video, which is yet another corner case).

We also change the meaning of framestepping a bit: in audio only mode,
framstepping unpauses for a single playloop iteration. This is probably
not useful at all, but makes the code a bit more simpler/uniform.

Just like the previous commit, this matters most for audio files with
cover art, for which this special case is the normal case.
2013-02-03 21:08:26 +01:00
wm4 d302ac285f mplayer: reset audio/video delay if there's no next video frame
mpctx->delay is used to control audio/video sync. If more audio than
video has been played, it grows larger, meaning A/V desync is happening.

This logic is a bit broken when video has ended, and audio is still
playing. In that case, it tries to read additional video frames from the
video decoder (because even if you don't feed new packets to the
decoder, it could still return delayed frames). For that, the code to
determine whether frames should be dropped is invoked
(check_framedrop()). This function detects that video is behind audio (mpctx-
>delay growing big),
and attempts to issue a framedrop.

Reset mpctx->delay if there's no more video.

This fixes the the frame drop display "counting up" on each playloop
iteration when playing audio files with cover art. These files are
basically audio+video files with a single video frame. When playing
these files the the corner case of having run out of video while audio
is still playing is the normal case.

Also reset mpctx->last_av_difference. This is not updated anymore if
video ends (since update_avsync() sets it, but it's not called if
video_left is false). This removes the "stuck" A/V sync value when video
ends. With audio files containing cover art we would display a
meaningless value over the duration of the whole file otherwise.
2013-02-03 21:08:26 +01:00
wm4 cc5cf98348 input: free all queued/allocated commands on exit
These were memory leaks in theory, though not in practice (all memory is
free'd on exit anyway). However, it was still annoying when leak
reporting is enabled.

I'm not sure if there was an actual leak in check_autorepeat(), maybe
not.
2013-02-03 21:08:26 +01:00
cehoyos 738a5af586 vf_stereo3d: add support for green-magenta and yellow-blue dubois
Add more vf_stereo3d output formats.

Adds high quality green-magenta and yellow-blue dubois
anaglyph 3D output support.

Patch by thomas schorpp, thomas.schorpp gmail

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35906 b3059339-0415-0410-9bf9-f77b7e298cf2

Conflicts:
	video/filter/vf_stereo3d.c
2013-02-03 21:08:25 +01:00