| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Add a menu item to quit and save the current playback position using the code
added with commit ce9a854.
Fixes #85
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mostly copied from vf_lavfi. The parts that could be shared are minor,
because most code is about setting up audio and video, which are too
different.
This won't work with Libav. I used ffplay.c as guide, and noticed too
late that their setup methods are incompatible with Libav's. Trying to
make it work with both would be too much effort. The configure test for
av_opt_set_int_list() should disable af_lavfi gracefully when compiling
with Libav.
Due to option parser chaos, you currently can't have a "," as part of
the filter graph string - not even with quoting or escaping. This will
probably be fixed later.
The audio filter chain is not PTS aware. So we have to do some hacks
to make up a fake PTS, and we have to map the output PTS back to the
filter chain's method of tracking PTS changes and buffering, by
adjusting af->delay.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Playing Youtube videos often requires an additional seek to the end of
the file. This flushes the stream cache. The reason for the seek is
reading the cues (seek index). This poses the question why Google is
muxing its files in such a way, since nothing in Matroska mandates that
cues are located at the end of the file, but we want to handle this
situation better anyway.
The seek index is not needed for normal playback, only for seeking.
This commit changes header parsing such that the index is not read on
initialization in order to avoid the additional stream-level seek.
Instead, read the index on the first demuxer-level seek, when the seek
index is actually needed.
If the cues are at the beginning of the file, they are read immediately
as part of the normal header reading process. This commit changes
behavior only if cues are outside of the header (i.e. not in the area
between EBML header and clusters), and linked by a SeekHead. Other
level 1 elements linked by the SeekHead might still cause seeks to the
end of the file, although that seems to be rare.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before this commit, the demuxer would in theory accept multiple cues
elements (and append its contents to the index in the order as
encountered during reading). According to the Matroska specification,
there can be only one cues element in the segment, so this seems like
an overcomplication.
Change it so that redundant elements are ignored, like with all other
unique header elements. This makes implementing deferred reading of the
cues element easier.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If VO deinterlacing is unavailable, try to insert vf_yadif.
If vf_lavfi is available, actually use vf_yadif from libavfilter. The
libavfilter version of this filter is faster, more correct, etc., so it
is preferred. Unfortunately vf_yadif obviously doesn't support
VFCTRL_GET/SET_DEINTERLACE, and with the current state of the
libavfilter API, it doesn't look like there is any simple way to
emulate it. Instead, we simply insert the filter with a specific label,
and if deinterlacing is to be disabled, the filter is removed again by
label.
This won't do the right thing if the user inserts any deinterlacing
filter manually (except native vf_yadif, which understands the VFCTRL).
For example, with '-vf lavfi=yadif', pressing 'D' (toggle deinterlacing)
will just insert a second deinterlacer filter. In these cases, the user
is supposed to map a command that toggles his own filter instead of
using 'D' and the deinterlace property.
The same applies if the user wants to pass different parameters to the
deinterlacer filters.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a complete filter description is passed to -vf-del, search for an
existing filter with the same label or the same name/arguments, and
delete it. The rules for filter entry equality are the same as with
the -vf-toggle option.
E.g.
-vf-add gradfun=123:gradfun=456
-vf-del gradfun=456
does what you would expect.
|
|
|
|
| |
Move the helper functions for parsing -vf, and rename some.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Can be used to refer to filters by name. Intended to be used when the
filter chain is changed at runtime.
A label can be assigned to a filter by prefixing it with '@name:', where
'name' is an user-chosen identifier. For example, a filter added with
'-vf-add @label1:gradfun=123' can be removed with '-vf-del @label1'.
If a filter with an already existing label is added, the existing filter
is replaced with the new filter (this happens for both -vf-add and
-vf-pre). If a filter is replaced, the new filter takes the position of
the old filter, instead of being appended/prepended to the filter chain
as usual. For -vf-toggle, labels are compared if at least one of the
filters has a label; otherwise they are compared by filter name and
arguments (like before). This means two filters are never considered
equal if one has a label and the other one does not.
|
|
|
|
|
|
|
|
|
|
| |
Windows
This prefers ./ on Windows if-and-only-if the file being searched for
already exists there. (If the mpv directory is non-writable, the result
is still intended behavior.) This change is transparent to most users
because the user has to move the config files there intentionally, and
if anything, not being detected would be the surprising behavior.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The sequence of avcodec_alloc_context3() / avcodec_copy_context() /
avcodec_close() / av_free() leaks some memory. So don't copy the context
and use it directly.
Originally avcodec_copy_context() was used to guarantee that libavformat
can't update the fields of the context during demuxing in order to make
things a little more robust, but it's not strictly needed, and
ffmpeg/ffplay don't do this anyway. Still might make the situation worse
should we move demuxing into a separate thread, though.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using -demuxer mpegts -correct-pts triggered the assertion in
ds_get_packet2(). This is not surprising, because the correct-pts code
was changed to accept _complete_ packets, while all the old demuxers
(including the mpegts demuxer) require you to use "partial" packet
reads, together with the video_read_frame(). (That function actually
parses video frames, so fragments of the original "packets" can be fed
to the decoder.)
However, it returns out demux_ts packet's are mostly useable. demux_ts
still adds an offset (i.e. ds->buffer_pos != 0) to the packets when
calling internal parser functions, such as in parse_es.c. While this is
unclean design due to mplayer's old video demuxing/decoding path, it can
be easily be made work by modifying the packet as returned by
ds_get_packet2(). We also have to change the packet freeing code, as
demux_packet->buffer doesn't have to point to the start of the memory
allocation anymore.
MPlayer handles this "correctly" because it doesn't have a function that
reads a complete packet.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Nobody uses this, and this is an absolute waste of time. Even the user
who reported this turned out to have produced a sample manually.
Sample produced with:
wget http://diracvideo.org/download/test-streams/raw/vts/vts.LD-8Mb.drc
mkvmerge -o dirac.mkv vts.LD-8Mb.drc
mkvmerge writes a sort of broken aspect ratio. libavformat interprets it
as 1:1 PAR, while demux_mkv thinks this is a 1:1 DAR. Maybe libavformat
is more correct here.
|
| |
|
| |
|
|
|
|
|
|
|
| |
libavcodec generally shouldn't have this problem anymore (if libavcodec
ever had it). All other video decoders are gone. In any case, if this
commit actually causes regressions, these are libavcodec bugs and should
be fixed there instead.
|
|
|
|
|
|
| |
In the long run this should be done differently. ID_... output sucks.
This commit will be reverted as soon as I have a good idea how this
should be done properly.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 02bbd87b disabled SDL linking by default. This commit followed
the ancient mplayer convention of disabling detection of compiler flags
with --enable-* switches. Unfortunately, this makes compiling with SDL
enabled a pain.
Make --enable-sdl/sdl2 use autodetection, even if it's inconsistent with
most other --enable-* switches. The same is already done for
--enable-openal, though.
Based on a pull request by qyot27.
|
| |
|
|
|
|
|
|
| |
The vf-toggle option parsing (normally used for runtime video filter
switching only) was missing comparing the parameter values. Fix this,
and also make the code a bit more robust.
|
|
|
|
|
| |
We don't bother with option verification (as it happens in profiles),
because it's barely possible.
|
|
|
|
| |
None of these were actual issues.
|
|
|
|
| |
[ci skip]
|
|
|
|
|
| |
Use YAML's anchor/reference syntax to DRY up the YAML file. Also fix a bug
that caused the IRC notification to always take place (even on success).
|
|
|
|
|
| |
This is now defined to mean to never output any frame again (except for
the first).
|
|
|
|
|
| |
also, default to 0-indexed frame counts (so by default, the 1st frame is
output). Old behaviour can be done by -vf dlopen=./framestep.so:42:41.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Travis-CI [1] is a continous integration cloud service. It is free for
open-source projects and tigthly integrated tiwh GitHub so there is really
no reason for us not use it. :)
For now we are going to do a total of 4 builds, mainly to test ffmpeg/libav
API breakage:
* ffmpeg-stable, libass-stable
* ffmpeg-git, libass-stable
* libav-stable, libass-stable
* libav-git, libass-stable
The compiler that is currently used is clang for two reasons:
* running 8 build targets would be quite wasteful and take a long time
* clang is less tested and used during development than gcc (especially on
linux)
Currently Travis doesn't support OS X environments alongside Linux ones [2].
When it will, we will add a fifth build target to test OS X compilation
breakage.
README was moved to markdown to add the little build status image. I ran some
tests with my GitHub fork and couldn't get images to show up using ReStructured
Text.
[1]: https://github.com/travis-ci/travis-ci
[2]: travis-ci/travis-ci#216
|
|
|
|
|
|
|
|
|
|
|
| |
mpv still builds with ffmpeg 1.0.x, however libswresample keeps cuasing
trouble. In older releases, libswresample simply crashed when
downmixing. In somewhat newer versions, it produces distorted output and
downmixing isn't even close to correct.
With ffmpeg release 1.1 (ffmpeg git tag n1.1), everything seems to work
fine. The release uses 0.17.102 as libswresample version, so bump the
required minimum version to that.
|
|
|
|
| |
Yeah, it doesn't work this way... Please look away.
|
|
|
|
| |
Requested by a user.
|
| |
|
|
|
|
|
|
| |
Also add a "raw" prefix for commands, which prevents property expansion.
The idea is that if the commands are generated by a program, it doesn't
have to know whether the command expands properties or not.
|
|
|
|
|
|
|
|
|
|
| |
This is more consistent, and doesn't bother the user with ordering
rules when new prefixes are added.
Will break obscure uses of legacy commands: if the command is supposed
to be translated by the legacy command bridge, and if that command uses
one of the pausing* prefixes, the command can't be parsed. Well, just
use the new commands in this case.
|
|
|
|
|
|
|
| |
This happens only if an option actually allocates memory (like strings).
Change filter API such that vf->priv is free'd by vf.c instead by the
filters. vf.c will free the option values as well.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add the "vf" command, which allows changing the video filter chain at
runtime. For example, the 'y' key could be bound to toggle deinterlacing
by adding 'y vf toggle yadif' to the input.conf.
Reconfiguring the video filter chain normally resets the VO, so that it
will be "stuck" until a new video frame is rendered. To mitigate this, a
seek to the current position is issued when the filter chain is changed.
This is done only if playback is paused, because normal playback will
show an actual new frame quickly enough.
If vdpau hardware decoding is used, filter insertion (whether it fails
or not) will break the video for a while. This is because vo_vdpau
resets decoding related things on vo_config().
|
|
|
|
|
|
|
| |
With the current semantics, there's no reason to disallow this.
(Although in my opinion, -vf should rather map to -vf-add than -vf-set,
however that is an independent issue from this change.)
|
|
|
|
|
|
|
|
| |
Works like -vf-add, except if a filter already exists and has the same
parameters, it's removed instead of added.
Not really useful on the command line itself, but will make sense for
runtime filter changing in the following commit.
|
|
|
|
|
|
| |
Until now, -vf-del required a list of indexes. This was a bit
inconvenient, so add support for using filter names too. Also simplify
the code a bit, doing the change would have been too painful otherwise.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This tried to use ctx->pic (last decoded AVFrame) for the frame bounds.
However, if av_frame_unref() on the AVFrame is called, the function will
reset _all_ AVFrame fields, even those which are not involved with
memory management. As result, mpcodecs_config_vo() was called with 0
width/height, which made the function exit early, instead of
reconfiguring the filter chain.
Go back to using mpcodecs_config_vo() directly. (That's what it did
before this VDCTRL was originally introduced; the original reason for
it disappeared.)
|
|
|
|
| |
Same thing, and VDCTRL_REINIT_VO implies more generic use.
|
|
|
|
| |
Except af_cmdline, which is too questionable.
|
|
|
|
|
|
|
|
|
|
|
|
| |
vo_vdpau actually reads past the image allocation when displaying a
non-mod 2 420p image. The vdpau API specifies that VdpVideoSurfacePutBitsYCbCr()
requires a height that is a multiple of 4, and surface allocations are
automatically rounded.
So allocate video images with rounded height. libavutil does the same,
so images coming directly from the decoder or from libavfilter are no
problem. (libavutil does this alginment explicitly, not just because the
decoded image size is aligned to macroblocks.)
|
| |
|
|
|
|
|
| |
vo_corevideo doesn't create a hidden window to perform OpenGL extensions
detection. This caused the window to always stay close.
|
|
|
|
| |
We don't need config() ;)
|
|
|
|
| |
Usage: -vf dlopen=./framestep.so:5
|
|
|
|
| |
Basically a cosmetic change. Fixes github issue #88.
|
|
|
|
|
|
|
| |
The main() function is special, and omitting the return statement would
make it always return 0. And also, mpv_main() actually never returns, it
calls exit() through exit_player() instead. But change it anyway,
because it looks misleading.
|
|
|
|
| |
This is a common convention.
|
|
|
|
|
| |
This is better for consistency, and also allows using -V as alias
for --version.
|
| |
|
|
|
|
|
| |
In connection with the previous commit, this will use the Matroska title
for the media-title property.
|
| |
|
|
|
|
|
|
|
| |
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Modified to add docs for --osd-scale option, and adjusted to the
previous commit by wm4.
|
|
|
|
|
| |
We can just update all OSD elements in these cases. This way we can also
reuse it for commands which need to update the OSD for other reasons.
|
| |
|
|
|
|
|
|
|
| |
This changes the code so that it does the same as MPlayer, mplayer2
and mpv before ref-counted AVFrame. The problem is that get_buffer2
is called with aligned frame dimensions, while get_buffer didn't. This
breaks the mpv video frame size change detection.
|
|
|
|
|
|
| |
Followup to 8df7127. This refines the condition for front ordering the
condition to account for minimized or hidden state where the window should go
to the front only as a consequnce of user interaction.
|
|
|
|
|
|
|
|
| |
FFmpeg (as well as Libav) have two layouts called "6.1":
AV_CH_LAYOUT_6POINT1 and AV_CH_LAYOUT_6POINT1_BACK. We call them "6.1"
and "6.1(back)". Change the default layout for 7 channels as well to
return the same layout as av_get_default_channel_layout(). (Looks a bit
questionable, but for now it's better to follow FFmpeg.)
|
|
|
|
|
|
|
| |
Window creation code always made mpv the front window. Fix it to make it front
only if the window is currently invisible.
Fixes #84
|
|
|
|
|
| |
This was in the original change set for the threadsafety changes but I forgot
to squash it in.
|