Compare commits

...
37 Commits
Author SHA1 Message Date
wm4 ecd2d90190 Release 0.1.5 2013-09-07 08:56:06 +02:00
wm4 73e4094770 options: fix --volume option range, add some explanations to manpage
The --volume option accepted values up to 10000, but internally, the
value is always clipped to 0-100 range. What makes this even worse is
that --softvol-max suggests that it extends the range of --volume, which
is not the case. (And passing a volume larger than 100 to --volume
didn't even print a warning.)
2013-09-07 08:54:28 +02:00
wm4 f5572919e4 demux_lavf: workaround for broken libavformat subtitle seeking
The really funny thing about this commit is that this code is added on
top of another work around. Basically, subtitle seeking in libavformat
is completely broken. To make it useful, we have to add yet another
workaround.

The basic problem is that libavformat's subtitle seeking code always
uses the stream time base, instead of AV_TIME_BASE if stream index -1 is
passed to the avformat_seek_file() function.

Fixes github issue #216. Hopefully this will be fixed in ffmpeg too at
some point.
2013-09-07 08:52:14 +02:00
wm4 93bf6eba3b mplayer: try to resume playback only if a resume file actually exists
Well, this was dumb. The resume message was printed for every file,
whether a resume config file existed or not.
2013-09-07 08:51:36 +02:00
wm4 150aeafdd2 audio: fix playback of Musepack SV8 files
This is basically a libavcodec API oddity: it can happen that
avcodec_decode_audio4() returns 0 (meaning 0 bytes were consumed). It
requires you to feed the complete packet again to decode the full
packet, and to successfully decode the following packets.

We ignored this case with the argument that there's the danger of an
endless decode loop (because nothing of that packet is apparently
decoded, so it would retry forever), but change it in order to decode
mpc8 files correctly.

Also add some comments to explain the mess.
2013-09-04 08:50:32 +02:00
wm4 1ef0d02245 tv: attempt to support mjpeg streams
MPlayer handles this correctly, because MPlayer still has the FourCC
codec dispatch (codecs.conf). We need to handle this case specially,
because the libavformat rawvideo decoder will of course not eat mjpeg.

mjpeg is the only supported format, though. (Even MPlayer needs to
convert between V4L2 formats and MPlayer FourCCs, and mjpeg is the only
non-raw format.)
2013-09-04 01:42:52 +02:00
wm4 74be07c36d mplayer: handle --reset-on-next-file=""
The option list contains an empty string member with this option value,
so ignore that. I'm not sure whether the option list should maybe be
empty in this case, but it could be the wrong thing in case of other
options.
2013-09-04 01:42:49 +02:00
wm4 54c371a293 mplayer: don't let playback resume force options that are file local
This happens by default with pausing: if a file was paused when doing
quit_watch_later, then resume and unpause, then the file played after
that would start in paused mode. This is because the pause option is
backed up at thr wrong place, so it backs up the state from resuming,
instead of whatever it was set to before that.
2013-09-04 01:42:46 +02:00
wm4 4788b8323c configure: fix some descriptions in the help output 2013-09-04 01:41:35 +02:00
wm4 df20f8fc06 Release 0.1.4 2013-08-29 22:18:28 +02:00
wm4 c47bf17c0f input: fix --no-input-default-bindings
The option did nothing. This was probably broken with 5b38a52.
2013-08-29 19:20:17 +02:00
wm4 64faa8c66b gl_video: don't crash if no FBOs are available
This probably has been broken since bbc865a: a test was added that uses
a FBO, but it's always run, even if FBOs were not detected. On the other
hand, fbotex_init() just runs into an assert. Fix the test that
triggered this condition, and make fbotex_init() "nicer" by just failing
if FBOs are not available.
2013-08-29 19:20:14 +02:00
Stefano Pigozzi 2f26f0b052 cocoa_common: autohide dock when autohiding menubar
A cocoa bug doesn't allow to do otherwise. Will open a radar later.
2013-08-29 19:20:08 +02:00
wm4 4fef2097ce gl_video: fix odd video sizes with PBOs
Odd video sizes if pixel formats with chroma subsampling and PBOs were
used, garbage was rendered. This was because the PBO path created
buffers with an unpadded size, and then tried to upload a padded
image to it. Fix it by explicitly setting the padded size. (As with
the non-PBO path, we rely that image allocations are somehow padded,
which is normally the case.)
2013-08-29 19:20:05 +02:00
Stefano Pigozzi 669f5d42f0 configure: fix help for macosx-bundle from autodetected to disabled
The help and configure result wrongly showed this feature was autodetected,
while it is infact disabled by default.
2013-08-29 19:19:35 +02:00
wm4 f0d245ce4b Release 0.1.3 2013-08-23 15:50:04 +02:00
Stefano Pigozzi 815ad3f011 cocoa_common: avoid locking calls when not needed
cocoa_common contains some locking calls to support video outputs that support
live resizing (at this moment only vo=opengl).

These should not be used unless the VO declares it is multithreaded by
registering the resize_redraw callback used for live resizing.

Fixes #200
2013-08-23 15:43:46 +02:00
wm4 69d46b1d95 demux: check whether stream is selected in demux_get_next_pts()
Otherwise, this would just try to demux a good chunk of the file, even
though the operation can't succeed anyway.

This caused some pretty strange issues, where perfectly valid use cases
would print a "Too many packets in the demuxer packet queue..." message.
2013-08-22 21:19:40 +02:00
wm4 0440561c99 demux_raw: read multiple frames per packet
The rawaudio demuxer read one frame per packet, basically a few bytes,
which caused insane overhead. (I found this when I couldn't play raw
audio without dropouts when using -v, which printed a line per packet
read.)

Fix this and read 1 second of audio per packet. This is a regression
since cfa5712 (merging of demux_rawaudio and demux_rawvideo).
2013-08-22 21:19:34 +02:00
Stefano Pigozzi 2a172a98fd cocoa_common: fix window positioning with --geometry
Regression since ff3b98d11c. The window positioning code relied on the
visibleFrame's height without taking into account the dock's presence.

Also moved the constraining code to the proper method that overrides the
original NSWindow behaviour. This avoids having to check for border since the
constraining is performed by Cocoa only for titled windows.

Fixes #190
2013-08-22 21:19:20 +02:00
Cheng Sun 421eebc8f1 manpage: fix (again) incorrect ao_alsa example
One example in ao.rst used the old syntax with misspelling of "no-block".
2013-08-22 21:19:12 +02:00
wm4 ab3bafc750 vf_eq: fix behavior when changing parameters
Using -vf eq and changing brightness, contrast, etc. using key bindings
with e.g. "add brightness 1" didn't work well: with step width 1, the
property gets easily "stuck". This is a rounding problem: e.g. setting
gamma to 3 would actually make it report that gamma is set to 2, so
the "add" command will obviously never reach 3 with a step width of 1.
Fix this by storing the parameters as integers.

This was broken in cac7702. This commit effectively changed these
properties to use the value as reported by vf_eq, instead of the
previously set value for the "add" command. This was more robust,
but not very correct either, so we keep the new behavior and make
vf_eq report its parameters more accurately.
2013-08-22 21:19:08 +02:00
wm4 d3f7248ca9 m_option: make "add speed 0.1" command work
Was broken since the speed property was switched from float to double.
2013-08-19 22:33:39 +02:00
wm4 463b877ec0 Release 0.1.2 2013-08-19 01:12:43 +02:00
wm4 72c81aa111 vdpau: don't try to match codec profiles
Instead, do what MPlayer did all these years. It worked for them, so
there's probably no reason to change this.

Apparently fixes playback with some files, where the VDPAU decoder does
not formally support a profile, but decoding works with a more powerful
profile anyway.

Though note that MPlayer did this because it couldn't do it in a better
way (no decoder reported profiles available when creating the VDPAU
decoder), so it's not entirely clear whether this is a good idea. An
alterbative implementation might try to map the profiles exactly, and
do some fall backs if the exact profile is not available. But this
hack-solution works too.

Conflicts:
	video/decode/vdpau.c
2013-08-19 01:09:39 +02:00
wm4 9f7c014930 changes: add some things for completeness 2013-08-19 01:07:32 +02:00
wm4 97eddff865 vo_vdpau: fix screenshots if panscan is used
When panscan was used, i.e. the video is cropped to make the video fill
the screen if video and screen aspects don't match, screenshots
contained only the visible region of the source video, stretched to
original video size.
2013-08-18 05:58:33 +02:00
wm4 cf880b9070 mplayer: don't make restored options from quit_watch_later per-file local
Consider:

    mpv file1.mkv file2.mkv

and file1.mkv is restored from an earlier session when quit_watch_later
was used. Then all restored options were reset when file2.mkv is played,
even if the user changed them during playback. This affects for example
the fullscreen setting.

Make it so that after finishing a resumed file, the previously restored
settings are not reset again. (Which means only resuming will forcefully
overwrite the settings.)
2013-08-18 05:58:28 +02:00
wm4 3478575419 manpage: fix incorrect ao_alsa example, extend changes.rst
One example in ao.rst used the old syntax with mangled device names.
Fix it. Mention some shell related caveats. Explicitly mention the
change of device name syntax in changes.rst, because it seems to be
a common issue.
2013-08-15 23:46:18 +02:00
wm4 88a53309cd vdpau: fix compilation on Libav
Libav's <libavcodec/vdpau.h> header uses some libavocdec symbols without
forward-declaring them and without including the headers declaring them.
FFmpeg's header for this is fine.
2013-08-15 23:46:07 +02:00
wm4 da76eb9f14 sub: fix accidental subtitle overlaps
The fix_overlaps_and_gaps() function in dec_sub.c fixes small gaps or
overlaps between subtitle events. However, sometimes it could happen
that the corrected subtitle events could overlap by 1ms due to bad
rounding, making libass shift subtitles to reduce collisions. (The
second subtitle will be shown above the previous one, even if both
subtitles are visible only for 1ms.)

sd_ass.c rounds the timestamps when converting to integers for unknown
reasons. I think it would work fine without that rounding, but since
I have no clue why it rounds, and since it could be needed to ensure
correct timestamps with ASS subtitles demuxed from Matroska, I'd rather
not touch it. So the solution is to use already rounded timestamps to
calculate the new subtitle duration in fix_overlaps_and_gaps().

See github issue #182.
2013-08-15 23:43:36 +02:00
wm4 df6901b653 x11: fix --ontop
Apply it after mapping.
2013-08-15 23:43:33 +02:00
Stefano Pigozzi 53e4ba26b5 changes.rst: document some OSX and windows changes 2013-08-15 23:43:29 +02:00
wm4 f10a3cac0f demux: move demux_mf before demux_subreader
demux_subreader is quite aggressive, and sometimes detects random
strings in EXIF as subtitle text.
2013-08-15 23:43:11 +02:00
wm4 7370ad2120 demux_subreader: report what subtitle format has been found 2013-08-15 23:43:05 +02:00
Noble Huang ed2d819ea5 stream_bluray: fix bd:// url segfault introduced by commit bc1d61 2013-08-15 23:43:00 +02:00
wm4 4f728cfb99 Add VERSION for release
No idea what the correct workflow is for these things. In any case, we
somehow have to make the github release system to include the correct
version in its tarball. I don't think you can provide your own tarballs
either, so it has to be in git.
2013-08-12 00:18:22 +02:00
23 changed files with 186 additions and 103 deletions

No files matched your search

+6 -2
View File
@@ -17,8 +17,8 @@ in the list. Suboptions are optional and can mostly be omitted.
.. admonition:: Examples
- ``--ao=alsa,oss,`` Try the ALSA driver, then the OSS driver, then others.
- ``--ao=alsa:noblock:device=hw=0.3`` Sets noblock-mode and the device-name
as first card, fourth device.
- ``--ao=alsa:no-block:device=[hw:0,3]`` Sets noblock-mode and the
device-name as first card, fourth device.
Available audio output drivers are:
@@ -48,6 +48,10 @@ Available audio output drivers are:
``--ao=alsa:device=[plug:surround50]``
Note that the ``[`` and ``]`` simply quote the device name. With some
shells (like zsh), you have to quote the option string to prevent the
shell from interpreting the brackets instead of passing them to mpv.
``oss``
OSS audio output driver
+35 -2
View File
@@ -27,7 +27,8 @@ General Changes for MPlayer to mplayer2
* Use libass for subtitle rendering by default (better quality)
* Generally preferring ffmpeg/libav over internal demuxers and decoders
* Improvements when playing multiple files (``--fixed-vo``)
* Screenshot improvements (instant screenshots without 1-frame delay)
* Screenshot improvements (instant screenshots without 1-frame delay, allow
taking screenshots even with hardware decoding)
* Improved support for PulseAudio
* General code cleanups
* Many more changes
@@ -55,6 +56,9 @@ General Changes for mplayer2 to mpv
``screenshot`` video filter is not needed anymore, and should not be put
into the mpv config file)
* Removal of teletext support
* Removal of most builtin demuxers, using libavformat instead
* Removal of builtin network support, using libavformat instead (also,
support https via libavformat)
* Replace image VOs (``--vo=jpeg`` etc.) with ``--vo=image``
* Do not lose settings when playing a new file in the same player instance
* New location for config files, new name for the binary.
@@ -68,7 +72,35 @@ General Changes for mplayer2 to mpv
* Wayland support
* Support for precise scrolling which scales the parameter of commands. If the
input doesn't support precise scrolling the scale factor stays 1.
* General code cleanups
* OSX: Cocoa event loop is independent from mplayer's event loop, so user
actions like accessing menus and live resizing do not block the playback.
* OSX: Apple Remote support.
* OSX: Media Keys support.
* Windows: Added WASAPI audio output.
* New OSD bar with chapter marks and not positioned in the middle of the video
(though this can be customized with the ``--osd-bar-align-y`` option).
* Allow customizing whether a key binding for seeking shows the video time, the
OSD bar, or nothing (see section `Input Command Prefixes`_).
* Display list of chapters and audio/subtitle tracks on OSD (see section
`Properties`_).
* ``--keep-open`` option to stop the player from closing the window and
exiting after playback ends.
* Re-enable screensaver while the player is paused.
* Matroska edition switching at runtime.
* Support for libavfilter (for video->video and audio->audio). This allows
using most of FFmpeg's filters, which improve greatly on the old MPlayer
filters in features, performance, and correctness.
* Improved downmixing and output of surround audio. Instead of using hardcoded
pan filters to do remixing, use libavresample. Channel maps are used to
identify the channel layout, so e.g. ``3.0`` and ``2.1`` audio can be
distinguished.
* Allow resuming playback at a later point with ``Shift+q``, also see
``quit_watch_later`` input command.
* Support mapping multiple commands to one key.
* Allow changing/adjusting video filters at runtime. (This is also used to make
the ``D`` key insert vf_yadif if deinterlacing is not supported otherwise.)
* General bug fixes and removal of long-standing issues
* General code cleanups (including refactoring or rewrites of many parts)
* Many more changes
Detailed Listing of User-visible Changes
@@ -136,6 +168,7 @@ Command Line Switches
``-rawvideo ...`` ``--demuxer-rawvideo-...``
``--mixer`` AO suboptions (``alsa``, ``oss``)
``--mixer-channel`` AO suboptions (``alsa``, ``oss``)
``--ao=alsa:device=hw=0.3`` ``--ao=alsa:device=[hw:0,3]``
=========================== ========================================
.. note::
+6
View File
@@ -1927,6 +1927,12 @@
current level. With values below 100 the initial volume (which is 100%)
will be above the maximum, which e.g. the OSD cannot display correctly.
Note: the maximum value of ``--volume`` as well as the ``volume`` property
is always 100. Likewise, the volume OSD bar always goes from 0 to 100.
This means that with ``--softvol-max=200``, ``--volume=100`` means
maximum amplification, i.e. amplify by 200%. The default volume will be
``50`` in this case (meaning no amplification).
``--speed=<0.01-100>``
Slow down or speed up playback by the factor given as parameter.
+1
View File
@@ -0,0 +1 @@
0.1.5
+4 -2
View File
@@ -389,13 +389,15 @@ static int decode_new_packet(struct sh_audio *sh)
}
int got_frame = 0;
int ret = avcodec_decode_audio4(avctx, priv->avframe, &got_frame, &pkt);
if (ret > 0) {
// At least "shorten" decodes sub-frames, instead of the whole packet.
// At least "mpc8" can return 0 and wants the packet again next time.
if (ret >= 0) {
ret = FFMIN(ret, mpkt->len); // sanity check against decoder overreads
mpkt->buffer += ret;
mpkt->len -= ret;
mpkt->pts = MP_NOPTS_VALUE; // don't reset PTS next time
}
if (mpkt->len == 0 || ret <= 0) {
if (mpkt->len == 0 || ret < 0) {
talloc_free(mpkt);
priv->packet = NULL;
}
Vendored
+8 -9
View File
@@ -316,16 +316,16 @@ Optional features:
--disable-bluray disable Blu-ray support [autodetect]
--disable-dvdread disable libdvdread [autodetect]
--disable-enca disable ENCA charset oracle library [autodetect]
--enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
--enable-macosx-bundle enable Mac OS X bundle file locations [disabled]
--disable-pthreads disable Posix threads support [autodetect]
--disable-libass disable subtitle rendering with libass [autodetect]
--disable-libass-osd disable OSD rendering with libass [autodetect]
--enable-rpath enable runtime linker path for extra libs [disabled]
--disable-libpostproc disable postprocess filter (vf_pp) [autodetect]
--disable-libavdevice enable libavdevice demuxers [autodetect]
--disable-libavfilter enable libavfilter [autodetect]
--disable-vf-lavfi enable vf_lavfi libavfilter bridge [audodetect]
--disable-af-lavfi enable af_lavfi libavfilter bridge [audodetect]
--disable-libavdevice disable libavdevice demuxers [autodetect]
--disable-libavfilter disable libavfilter [autodetect]
--disable-vf-lavfi disable vf_lavfi libavfilter bridge [audodetect]
--disable-af-lavfi disable af_lavfi libavfilter bridge [audodetect]
Codecs:
--enable-mng enable MNG input support [autodetect]
@@ -474,7 +474,7 @@ _cdda=auto
_coreaudio=auto
_corevideo=auto
_cocoa=auto
_macosx_bundle=auto
_macosx_bundle=no
_enca=auto
_pthreads=auto
_ass=auto
@@ -709,7 +709,6 @@ for ac_option do
--enable-cocoa) _cocoa=yes ;;
--disable-cocoa) _cocoa=no ;;
--enable-macosx-bundle) _macosx_bundle=yes ;;
--disable-macosx-bundle) _macosx_bundle=no ;;
--enable-manpage) _build_man=yes ;;
--disable-manpage) _build_man=no ;;
@@ -1550,11 +1549,11 @@ echores "$_sys_sysinfo"
if darwin; then
echocheck "Mac OS X Bundle file locations"
def_macosx_bundle='#undef CONFIG_MACOSX_BUNDLE'
test "$_macosx_bundle" = auto
if test "$_macosx_bundle" = yes ; then
extra_ldflags="$extra_ldflags -headerpad_max_install_names"
def_macosx_bundle='#define CONFIG_MACOSX_BUNDLE 1'
else
def_macosx_bundle='#undef CONFIG_MACOSX_BUNDLE'
fi
echores "$_macosx_bundle"
+4 -4
View File
@@ -77,12 +77,12 @@ const demuxer_desc_t *const demuxer_list[] = {
#endif
&demuxer_desc_matroska,
&demuxer_desc_lavf,
&demuxer_desc_subreader,
&demuxer_desc_mf,
#ifdef CONFIG_MNG
&demuxer_desc_mng,
#endif
// auto-probe last, because it checks file-extensions only
&demuxer_desc_mf,
// Pretty aggressive, so should be last.
&demuxer_desc_subreader,
/* Please do not add any new demuxers here. If you want to implement a new
* demuxer, add it to libavformat, except for wrappers around external
* libraries and demuxers requiring binary support. */
@@ -466,7 +466,7 @@ struct demux_packet *demux_read_packet(struct sh_stream *sh)
// packets from the queue.
double demux_get_next_pts(struct sh_stream *sh)
{
if (sh) {
if (sh && sh->ds->selected) {
ds_get_packets(sh);
if (sh->ds->head)
return sh->ds->head->pts;
+23 -4
View File
@@ -863,12 +863,31 @@ static void demux_seek_lavf(demuxer_t *demuxer, float rel_seek_secs,
// API by default, because there are some major issues.
// Set max_ts==ts, so that demuxing starts from an earlier position in
// the worst case.
int r = avformat_seek_file(priv->avfc, -1, INT64_MIN,
priv->last_pts, priv->last_pts, avsflags);
// To make this horrible situation even worse, some lavf demuxers have
// broken timebase handling (everything that uses
// ff_subtitles_queue_seek()), and always uses the stream timebase. So
// we use the timebase and stream index of the first enabled stream
// (i.e. a stream which can participate in seeking).
int stream_index = -1;
AVRational time_base = {1, AV_TIME_BASE};
for (int n = 0; n < priv->num_streams; n++) {
struct sh_stream *stream = priv->streams[n];
AVStream *st = priv->avfc->streams[n];
if (stream && st->discard != AVDISCARD_ALL) {
stream_index = n;
time_base = st->time_base;
break;
}
}
int64_t pts = priv->last_pts;
if (pts != AV_NOPTS_VALUE)
pts = pts / (double)AV_TIME_BASE * av_q2d(av_inv_q(time_base));
int r = avformat_seek_file(priv->avfc, stream_index, INT64_MIN,
pts, pts, avsflags);
// Similar issue as in the normal seeking codepath.
if (r < 0) {
avformat_seek_file(priv->avfc, -1, INT64_MIN,
priv->last_pts, INT64_MAX, avsflags);
avformat_seek_file(priv->avfc, stream_index, INT64_MIN,
pts, INT64_MAX, avsflags);
}
}
}
+4 -1
View File
@@ -35,6 +35,7 @@
struct priv {
int frame_size;
int read_frames;
double frame_rate;
};
@@ -107,6 +108,7 @@ static int demux_rawaudio_open(demuxer_t *demuxer, enum demux_check check)
*p = (struct priv) {
.frame_size = samplesize * sh_audio->channels.num,
.frame_rate = samplerate,
.read_frames = samplerate,
};
return 0;
@@ -191,6 +193,7 @@ static int demux_rawvideo_open(demuxer_t *demuxer, enum demux_check check)
*p = (struct priv) {
.frame_size = imgsize,
.frame_rate = fps,
.read_frames = 1,
};
return 0;
@@ -203,7 +206,7 @@ static int raw_fill_buffer(demuxer_t *demuxer)
if (demuxer->stream->eof)
return 0;
struct demux_packet *dp = new_demux_packet(p->frame_size);
struct demux_packet *dp = new_demux_packet(p->frame_size * p->read_frames);
dp->pos = stream_tell(demuxer->stream) - demuxer->movi_start;
dp->pts = (dp->pos / p->frame_size) / p->frame_rate;
+2
View File
@@ -1341,6 +1341,8 @@ static int d_open_file(struct demuxer *demuxer, enum demux_check check)
if (!res)
return -1;
demuxer->filetype = sr.name;
sub_data *sd = sub_read_file(demuxer->stream, &sr);
if (!sd)
return -1;
+2
View File
@@ -1269,6 +1269,8 @@ static struct cmd_bind *find_any_bind_for_key(struct input_ctx *ictx,
struct active_section *s = &ictx->active_sections[i];
struct cmd_bind *bind = find_bind_for_key_section(ictx, s->name, n, keys);
if (bind) {
if (bind->is_builtin && !ictx->default_bindings)
goto skip;
struct cmd_bind_section *bs = bind->owner;
for (int x = 0; x < n; x++) {
if (MP_KEY_DEPENDS_ON_MOUSE_POS(keys[x]) && bs->mouse_area_set &&
+1
View File
@@ -651,6 +651,7 @@ const m_option_type_t m_option_type_double = {
.pretty_print = print_double_f3,
.copy = copy_opt,
.clamp = clamp_double,
.add = add_double,
};
#undef VAL
+22 -18
View File
@@ -739,12 +739,12 @@ static void load_per_output_config(m_config_t *conf, char *cfg, char *out)
* Tries to load a config file (in file local mode)
* @return 0 if file was not found, 1 otherwise
*/
static int try_load_config(m_config_t *conf, const char *file)
static int try_load_config(m_config_t *conf, const char *file, bool local)
{
if (!mp_path_exists(file))
return 0;
mp_tmsg(MSGT_CPLAYER, MSGL_INFO, "Loading config '%s'\n", file);
m_config_parse_config_file(conf, file, M_SETOPT_BACKUP);
m_config_parse_config_file(conf, file, local ? M_SETOPT_BACKUP : 0);
return 1;
}
@@ -767,14 +767,14 @@ static void load_per_file_config(m_config_t *conf, const char * const file,
char dircfg[MP_PATH_MAX];
strcpy(dircfg, cfg);
strcpy(dircfg + (name - cfg), "mpv.conf");
try_load_config(conf, dircfg);
try_load_config(conf, dircfg, true);
if (try_load_config(conf, cfg))
if (try_load_config(conf, cfg, true))
return;
}
if ((confpath = mp_find_user_config_file(name)) != NULL) {
try_load_config(conf, confpath);
try_load_config(conf, confpath, true);
talloc_free(confpath);
}
@@ -888,8 +888,10 @@ exit:
static void load_playback_resume(m_config_t *conf, const char *file)
{
char *fname = get_playback_resume_config_filename(file);
if (fname) {
try_load_config(conf, fname);
if (fname && mp_path_exists(fname)) {
// Never apply the saved start position to following files
m_config_backup_opt(conf, "start");
try_load_config(conf, fname, false);
unlink(fname);
}
talloc_free(fname);
@@ -4149,6 +4151,19 @@ static void play_current_file(struct MPContext *mpctx)
mpctx->add_osd_seek_info &= OSD_SEEK_INFO_EDITION;
if (opts->reset_options) {
for (int n = 0; opts->reset_options[n]; n++) {
const char *opt = opts->reset_options[n];
if (opt[0]) {
if (strcmp(opt, "all") == 0) {
m_config_backup_all_opts(mpctx->mconfig);
} else {
m_config_backup_opt(mpctx->mconfig, opt);
}
}
}
}
load_per_protocol_config(mpctx->mconfig, mpctx->filename);
load_per_extension_config(mpctx->mconfig, mpctx->filename);
load_per_file_config(mpctx->mconfig, mpctx->filename, opts->use_filedir_conf);
@@ -4166,17 +4181,6 @@ static void play_current_file(struct MPContext *mpctx)
load_per_file_options(mpctx->mconfig, mpctx->playlist->current->params,
mpctx->playlist->current->num_params);
if (opts->reset_options) {
for (int n = 0; opts->reset_options[n]; n++) {
const char *opt = opts->reset_options[n];
if (strcmp(opt, "all") == 0) {
m_config_backup_all_opts(mpctx->mconfig);
} else {
m_config_backup_opt(mpctx->mconfig, opt);
}
}
}
// We must enable getch2 here to be able to interrupt network connection
// or cache filling
if (opts->consolecontrols && !opts->slave_mode) {
+1 -1
View File
@@ -550,7 +550,7 @@ const m_option_t mp_opts[] = {
{"auto", SOFTVOL_AUTO})),
OPT_FLOATRANGE("softvol-max", softvol_max, 0, 10, 10000),
OPT_INTRANGE("volstep", volstep, 0, 0, 100),
OPT_FLOATRANGE("volume", mixer_init_volume, 0, -1, 10000),
OPT_FLOATRANGE("volume", mixer_init_volume, 0, -1, 100),
OPT_CHOICE("mute", mixer_init_mute, M_OPT_OPTIONAL_PARAM,
({"auto", -1},
{"no", 0},
+2 -6
View File
@@ -65,12 +65,8 @@ struct bluray_priv_s {
char *cfg_device;
};
static const struct stream_priv_s {
int title;
char *device;
} bluray_stream_priv_dflts = {
BLURAY_DEFAULT_TITLE,
NULL
static struct bluray_priv_s bluray_stream_priv_dflts = {
.cfg_title = BLURAY_DEFAULT_TITLE
};
#define OPT_BASE_STRUCT struct bluray_priv_s
+6 -2
View File
@@ -729,8 +729,12 @@ static int demux_open_tv(demuxer_t *demuxer, enum demux_check check)
/* get IMAGE FORMAT */
int fourcc;
funcs->control(tvh->priv, TVI_CONTROL_VID_GET_FORMAT, &fourcc);
sh_video->gsh->codec = "rawvideo";
sh_video->format = fourcc;
if (fourcc == MP_FOURCC_MJPEG) {
sh_video->gsh->codec = "mjpeg";
} else {
sh_video->gsh->codec = "rawvideo";
sh_video->format = fourcc;
}
/* set FPS and FRAMETIME */
+6 -1
View File
@@ -302,6 +302,8 @@ static void multiply_timings(struct packet_list *subs, double factor)
}
}
#define MS_TS(f_ts) ((int)((f_ts) * 1000 + 0.5))
// Remove overlaps and fill gaps between adjacent subtitle packets. This is done
// by adjusting the duration of the earlier packet. If the gaps or overlap are
// larger than the threshold, or if the durations are close to the threshold,
@@ -322,7 +324,10 @@ static void fix_overlaps_and_gaps(struct packet_list *subs)
if (fabs(next->pts - end) <= threshold && cur->duration >= keep &&
next->duration >= keep)
{
cur->duration = next->pts - cur->pts;
// Conceptually: cur->duration = next->pts - cur->pts;
// But make sure the rounding and conversion to integers in
// sd_ass.c can't produce overlaps.
cur->duration = (MS_TS(next->pts) - MS_TS(cur->pts)) / 1000.0;
}
}
}
+9 -23
View File
@@ -18,6 +18,7 @@
#include <stddef.h>
#include <assert.h>
#include <libavcodec/avcodec.h>
#include <libavcodec/vdpau.h>
#include <libavutil/common.h>
@@ -41,33 +42,22 @@ struct priv {
struct profile_entry {
enum AVCodecID av_codec;
int ff_profile;
VdpDecoderProfile vdp_profile;
int maxrefs;
};
#define PE(av_codec_id, ff_profile, vdp_dcoder_profile, maxrefs) \
#define PE(av_codec_id, vdp_dcoder_profile, maxrefs) \
{AV_CODEC_ID_ ## av_codec_id, \
FF_PROFILE_ ## ff_profile, \
VDP_DECODER_PROFILE_ ## vdp_dcoder_profile, \
maxrefs}
static const struct profile_entry profiles[] = {
PE(MPEG1VIDEO, UNKNOWN, MPEG1, 2),
PE(MPEG2VIDEO, MPEG2_SIMPLE, MPEG2_SIMPLE, 2),
PE(MPEG2VIDEO, UNKNOWN, MPEG2_MAIN, 2),
PE(H264, H264_BASELINE, H264_BASELINE, 16),
PE(H264, H264_CONSTRAINED_BASELINE, H264_BASELINE, 16),
PE(H264, H264_MAIN, H264_MAIN, 16),
PE(H264, UNKNOWN, H264_HIGH, 16),
PE(WMV3, VC1_SIMPLE, VC1_SIMPLE, 2),
PE(WMV3, VC1_MAIN, VC1_MAIN, 2),
PE(WMV3, UNKNOWN, VC1_ADVANCED, 2),
PE(VC1, VC1_SIMPLE, VC1_SIMPLE, 2),
PE(VC1, VC1_MAIN, VC1_MAIN, 2),
PE(VC1, UNKNOWN, VC1_ADVANCED, 2),
PE(MPEG4, MPEG4_SIMPLE, MPEG4_PART2_SP, 2),
PE(MPEG4, UNKNOWN, MPEG4_PART2_ASP,2),
PE(MPEG1VIDEO, MPEG1, 2),
PE(MPEG2VIDEO, MPEG2_MAIN, 2),
PE(H264, H264_HIGH, 16),
PE(WMV3, VC1_MAIN, 2),
PE(VC1, VC1_ADVANCED, 2),
PE(MPEG4, MPEG4_PART2_ASP,2),
};
// libavcodec absolutely wants a non-NULL render callback
@@ -123,15 +113,11 @@ static bool create_vdp_decoder(struct lavc_ctx *ctx)
const struct profile_entry *pe = NULL;
for (int n = 0; n < MP_ARRAY_SIZE(profiles); n++) {
if (profiles[n].av_codec == ctx->avctx->codec_id &&
(profiles[n].ff_profile == ctx->avctx->profile ||
profiles[n].ff_profile == FF_PROFILE_UNKNOWN))
{
if (profiles[n].av_codec == ctx->avctx->codec_id) {
pe = &profiles[n];
break;
}
}
if (!pe) {
mp_msg(MSGT_VO, MSGL_ERR, "[vdpau] Unknown codec!\n");
goto fail;
+14 -4
View File
@@ -72,6 +72,8 @@ typedef struct vf_priv_s {
unsigned buf_w[3];
unsigned buf_h[3];
unsigned char *buf[3];
int gamma_i, contrast_i, brightness_i, saturation_i;
} vf_eq2_t;
@@ -381,18 +383,22 @@ int control (vf_instance_t *vf, int request, void *data)
if (strcmp (eq->item, "gamma") == 0) {
set_gamma (vf->priv, exp (log (8.0) * eq->value / 100.0));
vf->priv->gamma_i = eq->value;
return CONTROL_TRUE;
}
else if (strcmp (eq->item, "contrast") == 0) {
set_contrast (vf->priv, (1.0 / 100.0) * (eq->value + 100));
vf->priv->contrast_i = eq->value;
return CONTROL_TRUE;
}
else if (strcmp (eq->item, "brightness") == 0) {
set_brightness (vf->priv, (1.0 / 100.0) * eq->value);
vf->priv->brightness_i = eq->value;
return CONTROL_TRUE;
}
else if (strcmp (eq->item, "saturation") == 0) {
set_saturation (vf->priv, (double) (eq->value + 100) / 100.0);
vf->priv->saturation_i = eq->value;
return CONTROL_TRUE;
}
break;
@@ -400,19 +406,19 @@ int control (vf_instance_t *vf, int request, void *data)
case VFCTRL_GET_EQUALIZER:
eq = (vf_equalizer_t *) data;
if (strcmp (eq->item, "gamma") == 0) {
eq->value = (int) (100.0 * log (vf->priv->gamma) / log (8.0));
eq->value = vf->priv->gamma_i;
return CONTROL_TRUE;
}
else if (strcmp (eq->item, "contrast") == 0) {
eq->value = (int) (100.0 * vf->priv->contrast) - 100;
eq->value = vf->priv->contrast_i;
return CONTROL_TRUE;
}
else if (strcmp (eq->item, "brightness") == 0) {
eq->value = (int) (100.0 * vf->priv->brightness);
eq->value = vf->priv->brightness_i;
return CONTROL_TRUE;
}
else if (strcmp (eq->item, "saturation") == 0) {
eq->value = (int) (100.0 * vf->priv->saturation) - 100;
eq->value = vf->priv->saturation_i;
return CONTROL_TRUE;
}
break;
@@ -503,9 +509,13 @@ int vf_open(vf_instance_t *vf, char *args)
eq2->gamma_weight = par[7];
set_gamma (eq2, par[0]);
eq2->gamma_i = (int) (100.0 * log (vf->priv->gamma) / log (8.0));
set_contrast (eq2, par[1]);
eq2->contrast_i = (int) (100.0 * vf->priv->contrast) - 100;
set_brightness (eq2, par[2]);
eq2->brightness_i = (int) (100.0 * vf->priv->brightness);
set_saturation (eq2, par[3]);
eq2->saturation_i = (int) (100.0 * vf->priv->saturation) - 100;
}
return 1;
+12 -13
View File
@@ -523,7 +523,7 @@ int vo_cocoa_check_events(struct vo *vo)
void vo_cocoa_fullscreen(struct vo *vo)
{
if (![NSThread isMainThread]) {
if (![NSThread isMainThread] && resize_callback_registered(vo)) {
// This is the secondary thread, unlock since we are going to invoke a
// method synchronously on the GUI thread using Cocoa.
vo_cocoa_set_current_context(vo, false);
@@ -535,7 +535,7 @@ void vo_cocoa_fullscreen(struct vo *vo)
waitUntilDone:YES];
if (![NSThread isMainThread]) {
if (![NSThread isMainThread] && resize_callback_registered(vo)) {
// Now lock again!
vo_cocoa_set_current_context(vo, true);
}
@@ -657,7 +657,11 @@ int vo_cocoa_cgl_color_size(struct vo *vo)
NSApplicationPresentationDefault;
if ([s->fs_screen hasMenubar])
popts |= NSApplicationPresentationAutoHideMenuBar;
// Cocoa raises an exception when autohiding the menubar but
// not the dock. They probably got bored while programming the
// multi screen support and took some shortcuts (tested on 10.8).
popts |= NSApplicationPresentationAutoHideMenuBar |
NSApplicationPresentationAutoHideDock;
if ([s->fs_screen hasDock])
popts |= NSApplicationPresentationAutoHideDock;
@@ -762,20 +766,15 @@ int vo_cocoa_cgl_color_size(struct vo *vo)
CGFloat dx = (f.size.width - ns.width) / 2;
CGFloat dy = (f.size.height - ns.height - [self titleHeight]) / 2;
NSRect nf = NSRectFromCGRect(CGRectInset(NSRectToCGRect(f), dx, dy));
struct vo *vo = self.videoOutput;
if (!(vo && !vo->opts->border)) {
NSRect s = [[self screen] visibleFrame];
if (nf.origin.y + nf.size.height > s.origin.y + s.size.height)
nf.origin.y = s.size.height - nf.size.height;
}
[self setFrame:nf display:NO animate:NO];
}
- (NSRect)constrainFrameRect:(NSRect)rect toScreen:(NSScreen *)screen
- (NSRect)constrainFrameRect:(NSRect)nf toScreen:(NSScreen *)screen
{
return rect;
NSRect s = [[self screen] visibleFrame];
if (nf.origin.y + nf.size.height > s.origin.y + s.size.height)
nf.origin.y = s.origin.y + s.size.height - nf.size.height;
return nf;
}
@end
+10 -4
View File
@@ -433,7 +433,6 @@ static bool fbotex_init(struct gl_video *p, struct fbotex *fbo, int w, int h,
GL *gl = p->gl;
bool res = true;
assert(gl->mpgl_caps & MPGL_CAP_FB);
assert(!fbo->fbo);
assert(!fbo->texture);
@@ -446,6 +445,9 @@ static bool fbotex_init(struct gl_video *p, struct fbotex *fbo, int w, int h,
MP_VERBOSE(p, "Create FBO: %dx%d\n", fbo->tex_w, fbo->tex_h);
if (!(gl->mpgl_caps & MPGL_CAP_FB))
return false;
gl->GenFramebuffers(1, &fbo->fbo);
gl->GenTextures(1, &fbo->texture);
gl->BindTexture(GL_TEXTURE_2D, fbo->texture);
@@ -1499,6 +1501,10 @@ static bool get_image(struct gl_video *p, struct mp_image *mpi)
struct video_image *vimg = &p->image;
// See comments in init_video() about odd video sizes.
// The normal upload path does this too, but less explicit.
mp_image_set_size(mpi, vimg->planes[0].w, vimg->planes[0].h);
for (int n = 0; n < p->plane_count; n++) {
struct texplane *plane = &vimg->planes[n];
mpi->stride[n] = mpi->plane_w[n] * p->image_desc.bytes[n];
@@ -1709,10 +1715,10 @@ static void check_gl_features(struct gl_video *p)
}
// fruit dithering mode and the 3D lut use this texture format
if ((p->opts.dither_depth >= 0 && p->opts.dither_algo == 0) ||
p->use_lut_3d)
if (have_fbo && ((p->opts.dither_depth >= 0 && p->opts.dither_algo == 0) ||
p->use_lut_3d))
{
// doesn't disalbe anything; it's just for the log
// doesn't disable anything; it's just for the log
MP_VERBOSE(p, "Testing GL_R16 FBO (dithering/LUT)\n");
test_fbo(p, GL_R16);
}
+5 -4
View File
@@ -206,7 +206,8 @@ static uint64_t convert_to_vdptime(struct vo *vo, uint64_t t)
static int render_video_to_output_surface(struct vo *vo,
VdpOutputSurface output_surface,
VdpRect *output_rect)
VdpRect *output_rect,
VdpRect *video_rect)
{
struct vdpctx *vc = vo->priv;
struct vdp_functions *vdp = vc->vdp;
@@ -238,7 +239,7 @@ static int render_video_to_output_surface(struct vo *vo,
vdp_st = vdp->video_mixer_render(vc->video_mixer, VDP_INVALID_HANDLE,
0, field, 2, past_fields,
bv[dp/2].surface, 1, future_fields,
&vc->src_rect_vid, output_surface,
video_rect, output_surface,
NULL, output_rect, 0, NULL);
CHECK_ST_WARNING("Error when calling vdp_video_mixer_render");
return 0;
@@ -250,7 +251,7 @@ static int video_to_output_surface(struct vo *vo)
return render_video_to_output_surface(vo,
vc->output_surfaces[vc->surface_num],
&vc->out_rect_vid);
&vc->out_rect_vid, &vc->src_rect_vid);
}
static int next_deint_queue_pos(struct vo *vo, bool eof)
@@ -1261,7 +1262,7 @@ static struct mp_image *get_screenshot(struct vo *vo)
}
VdpRect rc = { .x1 = vc->vid_width, .y1 = vc->vid_height };
render_video_to_output_surface(vo, vc->screenshot_surface, &rc);
render_video_to_output_surface(vo, vc->screenshot_surface, &rc, &rc);
struct mp_image *image = read_output_surface(vc, vc->screenshot_surface,
vc->vid_width, vc->vid_height);
+3 -3
View File
@@ -1040,9 +1040,6 @@ void vo_x11_config_vo_window(struct vo *vo, XVisualInfo *vis, int x, int y,
if (flags & VOFLAG_HIDDEN)
return;
if (opts->ontop)
vo_x11_setlayer(vo, x11->window, opts->ontop);
bool reset_size = !(x11->old_dwidth == width && x11->old_dheight == height);
if (x11->window_hidden) {
x11->nofs_x = x;
@@ -1075,6 +1072,9 @@ void vo_x11_config_vo_window(struct vo *vo, XVisualInfo *vis, int x, int y,
}
}
if (opts->ontop)
vo_x11_setlayer(vo, x11->window, opts->ontop);
vo_x11_fullscreen(vo);
XSync(x11->display, False);