Commit Graph

34547 Commits

Author SHA1 Message Date
Rudolf Polzer 5a412bfa09 demux_lavf: implement DEMUXER_CTRL_RESYNC
This makes -chapter work with stream_dvd by telling ffmpeg to flush its
internal buffers after a stream_dvd seek.
2013-01-07 17:39:55 +01:00
wm4 413b2e3b0f vo_xv: fix compilation when shared memory header files are not available
This is an extremely obscure situation, but can actually happen
on OpenBSD.
2013-01-06 21:44:15 +01:00
wm4 9b3bf76d27 ao_alsa: do not call snd_pcm_delay() when paused
This causes trouble when a hw device is used:

    pcm_hw.c:514:(snd_pcm_hw_delay) SNDRV_PCM_IOCTL_DELAY failed (-77): File descriptor in bad state

when running mpv test.mkv --ao=alsa:device=iec958,alsa and pausing
during playback.

Historically, mplayer usually did not call snd_pcm_delay() (which is
called by get_delay()) while paused, so this problem never showed up.
But at least mpv has changes that cause get_delay() to be called when
updating the status line (see commit 3f949cf).

It's possible that calling snd_pcm_delay() is not always legal when the
audio is paused, and at least fails with the error message mentioned
above is the device is a hardware device. Change get_delay() to return
the last delay before the audio was paused. The intention is to get a
continuous playback status display, even when pausing or frame stepping,
otherwise we could just return the audio buffer fill status in
get_delay() or even just 0 when paused.
2013-01-06 19:28:08 +01:00
wm4 67ee79283b cleanup: ass_mp.h: remove dummy declarations 2013-01-06 16:22:50 +01:00
wm4 5b56864ff0 sub: use correct fallback font for subtitles
Accidentally still used the OSD font.
2013-01-06 16:06:34 +01:00
wm4 fe8d3e70b2 ao_sdl: fix compilation with Libav
On Libav, <libavutil/fifo.h> doesn't recursively include common.h, but
the code in ao_sdl.c uses some macros defined by this header.
2013-01-06 16:04:17 +01:00
wm4 55b2f0847f manpage: document the dangers of some subtitle options
Setting some subtitle options may lead to incorrect rendering of complex
ASS subtitle scripts, such as displaced signs or visual artifacts. The
user should be made aware that this can happen.

In theory, libass could make using some of these options relatively
safe, but it doesn't.

Note that there are potentially much more options that could in theory
break subtitle rendering, but add a warning only to the most fragile
ones.
2013-01-05 14:21:04 +01:00
wm4 ca9c81b0d3 sub: add --sub-text-* options to unstyled text subtitles font
Before this commit, the --osd-* options (like --osd-font-size etc.)
configured both the OSD and subtitle font. Make them separate, and add
--sub-text-* options (like --sub-text-size etc.). Now --osd-* affects
the OSD font only, and --sub-text-* unstyled text subtitles only.
2013-01-05 14:11:56 +01:00
wm4 e65778ca6c manpage: sort --osd-* options
They were more or less grouped by usefulness, but since everything
else in the manpage is sorted alphabetically, it's better to be
consistent and sort these options as well.
2013-01-04 16:04:08 +01:00
wm4 f394a25e7b Update copyright year 2013-01-04 15:23:23 +01:00
Stefano Pigozzi 59868da7a1 cocoa_common: add support for `--no-border`
Draw a window with style NSBorderlessWindow when the user uses `--no-border`.
2012-12-31 14:20:49 +01:00
Rudolf Polzer 56e18d99aa vo_sdl: support -geometry properly
Now the x and y origin options (-geometry WxH+X+Y) are supported too.
2012-12-31 08:44:53 +01:00
Rudolf Polzer a313af3d02 vo_sdl: some OSD optimizations
The premultiplied-alpha hack is changed:

- The first stage now uses a colormod of black with an unmodified
  texture. This saves on applying the AND mask of 0xFF000000 to keep
  alpha only.

- The second stage no longer uses an AND mask, but only an OR mask of
  0xFF000000 to cancel out alpha.

- The texture uploads are no longer done using SDL_LockTexture,
  SDL_ConvertPixels, SDL_UnlockTexture when the mpv pixel format matches
  the OSD's pixel format. Instead, SDL_UploadTexture is used, which
  saves a copy when using the "opengl" renderer.
2012-12-28 14:27:12 +01:00
wm4 0db55cd86a stream_lavf: warn if protocol not found
If ffmpeg returns AVERROR_PROTOCOL_NOT_FOUND, print a warning that
ffmpeg should be compiled with network support. Note that stream_lavf.c
itself includes a whitelist of directly supported ffmpeg protocols, so
it can't happen that a completely unknown/madeup protocol triggers
this message. (Unless the ffmpeg:// or lavf:// prefixes are used.)
2012-12-28 14:23:29 +01:00
wm4 973f34bb56 vf_scale: prefer 420P10 -> YV12 instead of 444P
Strictly speaking, 444P is higher quality than YV12, but doing this is
not very useful when playing 10 bit video with -vo opengl-old on a GPU
that doesn't support 16 bit textures.
2012-12-28 14:23:29 +01:00
wm4 d78bde15ab vo_opengl_old: reject 9-15 bit formats if textures have less than 16 bit
For 9-15 bit material, cutting off the lower bits leads to significant
quality reduction, because these formats leave the most significant bits
unused (e.g. 10 bit padded to 16 bit, transferred as 8 bit -> only
2 bits left). 16 bit formats still can be played like this, as cutting
the lower bits merely reduces quality in this case.

This problem was encountered with the following GPU/driver combination:

OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) 915GM x86/MMX/SSE2
OpenGL version string: 1.4 Mesa 9.0.1

It appears 16 bit support is rather common on GPUs, so testing the
actual texture depth wasn't needed until now. (There are some other Mesa
GPU/driver combinations which support 16 bit only when using RG textures
instead of LUMINANCE_ALPHA. This is due to OpenGL driver bugs.)
2012-12-28 14:23:29 +01:00
wm4 1e56e68701 gl_common: properly reject old OpenGL versions
The extension checking logic was broken, which reported OpenGL 3 if the
OpenGL .so exported OpenGL 3-only symbols, even if the reported OpenGL
version is below 3.0. Fix it and simplify the code a bit. Also never
fail hard if required functions are not found. The caller should check
the capability flags instead. Give up on the idea that we should print
a warning if essential functions are not found (makes loading of ancient
legacy-only extensions easier).

This was experienced with the following version strings:

OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) 915GM x86/MMX/SSE2
OpenGL version string: 1.4 Mesa 9.0.1

(Possibly reports a very old version because it has no GLSL support,
and thus isn't even GL 2.0 compliant.)
2012-12-28 14:23:29 +01:00
wm4 56382c91e4 core: fix crash if VO init fails 2012-12-28 14:21:25 +01:00
wm4 527b39cafa manpage: minor improvements 2012-12-28 13:44:01 +01:00
wm4 1cf5a4dbd7 DOCS: document EDL format
This is taken from the commit message of 968154ba77, with some fixes
to make it valid RST.
2012-12-28 13:43:59 +01:00
wm4 97ed31fd8e audio: make de-planarization faster
Uses the same trick as the planarization code to turn per-sample memcpy
calls into mov instructions. Makes decoding a ~25min 48000Hz 2ch floatle
audio file faster from 3.8s to 2.7s.
2012-12-28 13:43:55 +01:00
nand b32f2ef0d3 vo_opengl: use more precise gamma for BT.709 with color management
Change from gamma 2.2 to the slightly more precise 1/0.45 as per BT.709.

https://www.itu.int/rec/R-REC-BT.709-5-200204-I/en mentions a value of
γ=0.45 for the conceptual non-linear precorrection of video signals.

This is approximately the inverse of 2.22, and not 2.20 as the code had
been using until now.
2012-12-28 13:43:24 +01:00
Rudolf Polzer 6be50fa773 sdl, encode_lavc: fix copyright headers
Some of them had changes in 2012; extend their header.

Fix project name.
2012-12-28 11:41:30 +01:00
Rudolf Polzer fd64003c2a encoding-example-profiles: fix "oac" typo
Fixes issue #10.
2012-12-28 11:21:35 +01:00
Rudolf Polzer 73900ca1c3 vdpau: silence a clang warning
It's just some braces...
2012-12-28 10:46:02 +01:00
Rudolf Polzer 671ca2a570 demux_mpg, ass_mp: fix warnings
The warnings in demux_mpg were silenced by additional no-operation
casts.

A variable in ass_mp was used only for some versions of libass; now the
declaration is in that version #ifdef too to avoid a compiler warning.
2012-12-28 08:40:40 +01:00
Rudolf Polzer c3cc38e4c4 vo/ao: SDL 1.2+ audio driver, SDL 2.0+ accelerated video driver
This mainly serves as a fallback for platforms where nothing better is
available; also as a debugging help. Both the audio and video driver are
not first class - the audio driver lacks delay detection, and the video
driver only supports a single YUV color space.

Configure options: --disable-sdl2 to disable SDL 2.0+ detection,
--disable-sdl to disable SDL 1.2+ detection. Both options need to be
specified to turn off SDL support entirely.
2012-12-28 08:40:28 +01:00
Rudolf Polzer e830b00458 vf_scale: support more pixel formats
The RGBA, ARGB, BGRA, ABGR were previously not always supported,
depending on system endianness.
2012-12-28 08:31:58 +01:00
wm4 844bba6645 sub: add ASS to RGBA conversion
This makes implementing new VOs easier, because they don't have to
support the ASS format.
2012-12-28 08:30:15 +01:00
Rudolf Polzer f3374eecad stream_dvd: fix angle math
Stop changing the dvd_angle variable while opening a DVD. Fixes issues
with multiple dvd:// URLs on one command line.
2012-12-22 10:00:00 +01:00
Rudolf Polzer 3ea3f72967 configure: clean up use of extra_ldflags and libs_mplayer
Now, extra_ldflags ought to only consider LDFLAGS, and all libraries
shall go into libs_mplayer. In the end, the command line first contains
extra_ldflags, and then libs_mplayer.

So altogether this change has the effect that libraries get added to the
linker command line in the order the configure script checks them.
Previously there was some reordering due to some checks adding libraries
to libs_mplayer and some to extra_ldflags.
2012-12-19 13:01:56 +01:00
Rudolf Polzer 7d0a20954f core: make WAKEUP_PERIOD overridable by the vo
This is better than having just the operating system type decide the
wakeup period, as e.g. when compiling for Win32/cygwin, a wakeup period
of 0.5 would work perfectly fine.

Instead, the default wakeup period is now only decided by availability
of a working select() system call (which is the case on cygwin but not
mingw and MSVC) AND a vo that can provide an event file descriptor or a
similar hack (vo_corevideo). vos that cannot do either need polling for
event handling and now can set the wakeup period to 0.02 in the vo code.
2012-12-19 12:58:52 +01:00
Stefano Pigozzi 51c98619c8 osxbundle: print meaningful error when a dylib is missing
If one of the bundled libraries is pointing to a missing dylib stop the
bundling and exit with an error. This can happen if the user uninstalled a
dependency after he built the binary/libraries.
2012-12-16 10:56:25 +01:00
Stefano Pigozzi 4c95f545d3 osxbundle: add fonts.conf to distributed bundle
The osxbundle target creates a bundle that is supposed to be distributable
to third parties. As they may not have fontconfig installed they miss a
fonts.conf pointing to the usual fonts directories in OSX.

For people installing from source and using from the terminal this commit
changes nothing. You just have to make sure that your fontconfig is installed
with a sane configuration (XQuartz does). If you are installing fontconfig from
source you can force a sane OSX default using `--with-add-fonts`. For example:

  `./configure --with-add-fonts=/Library/Fonts,~/Library/Fonts`

Homebrew already addressed this with mxcl/homebrew@b242883
2012-12-15 17:38:00 +01:00
Stefano Pigozzi fab9febdc3 path: add mp_find_config_file and reorganize some of the code
Add `mp_find_config_file` to search different known paths and use that in
ass_mp to look for the fontconfig configuration file.

Some incidental changes spawned by this feature where:

 * Buffer allocation for the strings containing the paths is now performed
   with talloc. All of the allocations are done on a NULL context, but it still
   improves readability of the code.
 * Move the OSX function for lookup inside of a bundle: this code path was
   currently not used by the bundle generated with `make osxbundle`. The plan
   is to use it again in a future commit to get a fontconfig config file.
2012-12-15 17:38:00 +01:00
Stefano Pigozzi c7bf5111c7 core: path: run uncrustify
Even if this is not so bad as other files, I need to add some stuff so...
why not!?

`uncrustify -l C -c TOOLS/uncrustify.cfg --no-backup --replace core/path.h`
`uncrustify -l C -c TOOLS/uncrustify.cfg --no-backup --replace core/path.c`

The header was unchanged by the tool.
2012-12-15 14:16:24 +01:00
Stefano Pigozzi 9201cfe2bd ass_mp: allow to use a custom fontconfig configuration file
This allows to use a fontconfig fonts.conf that is customized for mpv. The
configuration file is assumed to be located at `~/.mpv/fonts.conf`. If not
found the default fcontconfig config file is used.
2012-12-15 14:16:23 +01:00
wm4 5f999d94df video: silence warnings for missing libavutils pixel formats
Using vf_screenshot on Libav printed useless/misleading error messages
when playing 10 bit h264 with a VO that supports 8 bit yuv420p only:

    Unsupported format 444p14le
    Unsupported format 444p14be
    ...

The cause of this is that vf_scale is inserted to handle the format
conversion, and tries to find a pixel format with best quality. This
includes the 14 bit and 12 bit formats, which don't exist on Libav.
vf_screenshot tries to query whether Libav's libswscale supports it,
resulting in these error messages. (In theory, vf_scale is missing this
check, but it doesn't matter in practice.)

Since this warning is rather useless anyway, because all input video
comes from libavcodec, and only the conversion into the other could
possibly fail. Silence the warning by raising it to verbose message
level.

Closes #7.
2012-12-14 21:34:56 +01:00
wm4 e288af5df4 sd_ass: free external subtitle tracks 2012-12-14 19:59:30 +01:00
Rudolf Polzer 925c3af928 ao_lavc: stop using av_get_alt_sample_fmt
Use av_get_planar_sample_fmt instead.
2012-12-13 12:58:16 +01:00
wm4 61aef3fff9 Fix compilation with ffmpeg 1.0
AVPROBE_SCORE_RETRY was too new, and doesn't even exist in Libav. Go
back to using the value explicitly.
2012-12-13 12:49:27 +01:00
wm4 c3f8c9a58e options: move -ass-bottom-margin/-ass-top-margin options to vf_sub
These options might be useful sometimes, but they are not that
important, and work with vf_sub only. Make them vf_sub sub-options.
2012-12-12 23:35:34 +01:00
wm4 69e1338834 vf_sub: fix aspect ratio when using margins 2012-12-12 23:35:24 +01:00
wm4 b0558e48b1 cleanup: remove ao.brokenpts
This field was used by ao_v4l2, and is now unused.
2012-12-12 23:05:57 +01:00
wm4 306136a287 options: handle -v during pre-parsing command line
Otherwise -v is honored too late, and some output will be missing. In
particular, this prevented printing of the libav* library versions.
2012-12-12 23:02:03 +01:00
wm4 962a97a2db sd_lavc: keep subs on subtitle track switching
Keep the currently displayed subtitles even when the user cycles through
subtitle tracks, and the subtitle is decoded by libavcodec (such as
vobsubs). Do this by not clearing the subtitles on reset(). reset() is
also called on seek, so check the start PTS whether the subtitle should
really be displayed (there's already an end PTS). Note that sd_ass does
essentially something similar.

The existing code has checks for whether the PTS reported by the demuxer
is invalid (MP_NOPTS_VALUE). I don't know under what circumstances this
can happens, so fall back to the old behavior if the PTS is invalid.
2012-12-12 22:56:41 +01:00
wm4 0fba387f72 Fix compilation with Libav
Doesn't define AVPROBE_SCORE_RETRY for some reason. They use
AVPROBE_SCORE_MAX/4 directly internally. AV_DISPOSITION_ATTACHED_PIC
is not defined with the most recent Libav release.

AVIOContext.av_class exists in Libav, but is apparently disabled in
old releases. Disable it for now until people stop torturing me with
old crap releases.
2012-12-11 15:26:02 +01:00
wm4 c6fbf91a89 manpage: mark HTTP related options as deprecated/broken
Commit c02f25 switched the "http://" protocol to use ffmpeg's HTTP
implementation (stream_lavf.c), instead of the mplayer internal one
(http.c). Unfortunately, it turns out that there are some network
related options that are not respected by stream_lavf.c, and
consequently do not work anymore for "http://" URLs. This might be
fixed later. Mark them as deprecated for now, as it might take
arbitrarily long until this is taken care of.
2012-12-11 01:04:13 +01:00
wm4 3f949cf50b mplayer: prefer audio PTS over video PTS for status line
This slightly improves display of the current playback time in files
with sparse video packets (like video tracks containing a slow MJPG
slideshows as in [1]), or audio files with cover art image attachments.
While the video PTS is always "stuck" at the last frame displayed or
the last seek, audio is usually continuous. Given sane samplerates and
working audio drivers (to query how much of the current audio buffer has
been played), the audio PTS should always be more reliable.

[1] http://www.podtrac.com/pts/redirect.mp3/traffic.libsyn.com/rtpodcast/Rooster_Teeth_Podcast_191.m4a
2012-12-11 00:37:55 +01:00
reimar 4a40eeda94 demux: fix behavior with files that have sparse video packets
Improve EOF handling in ds_fill_buffer for the case where one stream ends
much earlier than the others, in particular make sure the "too many ..."
message is not printed over and over.

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

Conflicts:
	libmpdemux/demuxer.c

Try to improve seeking in files with only few video packets,
in particular files with cover art.

This might cause issues with badly interleaved files, particularly
together with -audio-delay, even though I did not see issues
in my very limited testing.

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

Conflicts:
	libmpdemux/demuxer.c
	libmpdemux/demuxer.h

Fix code that detects streams temporarily lacking data to work
properly with e.g. DVDs.

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

Conflicts:
	libmpdemux/demuxer.c

Make stream eof detection less sensitive.

Fixes bug #2111.

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

Conflicts:
	libmpdemux/demuxer.c
2012-12-11 00:37:55 +01:00