Add support for binding commands to modifier+key combinations like
"Shift+Left" or "Ctrl+Alt+x", and support reading such combinations
from the output window of X VOs.
The recognized modifier names are Shift, Ctrl, Alt and Meta. Any
combination of those and then a non-modifier key name, separated by
'+', is accepted as a key name in input.conf. For non-special keys
that produce characters shift is ignored as a modifier. For example
"A" is handled as a key without modifiers even if you use shift to
write the capital letter; 'a' vs 'A' already distinguishes the
combinations with a normal keymap, and having separate 'a', 'Shift+A'
and 'A' (written with caps lock for example) would bring more
confusion than benefit.
Currently reading the modifier+key combinations is only supported in
the output window of those VOs that use x11_common.c event
handling. It's not possible to input the key combinations in other VOs
or in a terminal window.
After the addition of exact seeking the code to work around missing
audio timestamps with ogg/ogm needs improvement. Now it's normal to
need adjustment at stream start time 0 (seeking to a position after
start of video but before second keyframe) with any video format, and
for exact seeks with ogg it's now more important not to skip the
sync. Make the check to detect the problem case more precise to avoid
affecting most other formats, and try to decode a second of audio
(hoping to get timestamps for those packets) before giving up.
Add support for seeking to an arbitrary non-keyframe position by
decoding video starting from the previous keyframe. Whether to use
this functionality when seeking is controlled by the new option
-hr-seek and a new third argument to the "seek" command. The default
is to use it for absolute seeks (like chapter seeks) but not for
relative ones. Because there's currently no support for cutting
encoded audio some desync is expected if encoded audio passthrough is
used. Currently precise seeks always go to the first frame with
timestamp equal to or greater than the target position; there's no
support for "matching or earlier" backwards seeks at frame level.
To prepare for the addition of exact seek support, add a struct for
queued seek state and a helper function to update its state. It would
have been cumbersome to update additional state (showing whether the
seek is forced to be exact or non-exact) manually at every point that
handles seeks.
Add mp_property_generic_option(), a property function that can be used
for generic option-based properties that do not require any action
beyond manipulating the value of the option variable. Currently it
directly implements GET and SET, plus STEP_UP for "choice" options
only. Use it to add a property for -pts-association-mode (not
particularly useful in normal use, but serves as a test).
Add a "choice" option type. Options of this type take a string as
input and set an int option variable to the value corresponding to the
string. The string->int mapping is option-specific and is given in the
option definition. Strings not found in the mapping are rejected as
invalid option values.
Change the option -pts-association-mode to use this new option type
and accept values "auto, decoder, sort" instead of "0, 1, 2". The
change in accepted values shouldn't cause problems as this option is
not appropriate to use in normal user config files.
Let higher-level code call update_video() again instead of looping
inside it until there's a frame ready to show. Change the conditions
for running user commands somewhat. Overall effect shouldn't be that
big. Now other commands can be executed after a seek before a video
frame is decoded; in this case the seek target time may be used as the
"current position".
Add a new field "video_pts" to mpctx. It records the time of the last
frame flipped visible on VO. Change various code which used
sh_video->pts to use either the new field or get_current_time(mpctx).
Register the X11 connection fd in the input system so that
mp_input_get_cmd() can immediately wake up and handle keyboard or
other X events. The callback calls vo_check_events() and tells the
input system to handle any input possibly recorded during that. Before
this was done for vo_xv only; this commit generalizes it to all VOs
that call vo_x11_create_vo_window() - those are hopefully ones that
will handle all X events in check_events().
The callback is only kept registered while the vo is properly
configured. At other times calling check_events() would not clear
pending input and so could lead to a busy loop.
Add separate handling for the case where the time to flip the next
frame on the VO is more than 50 ms away. In that case don't update OSD
contents yet, but wait for possible changes until 50 ms before the
frame. Sleep until that time in mp_input_get_cmd(), so the sleep is
done in select() and input events can be responded to immediately.
Also raise the limit on audio out delay used to limit sleep.
The wrong variable was used as a function argument, and as a result
the code modified the usage_count field of non-refcounted mp_image
types. This error did not have any effect on visible behavior as no
code cares about the field value in the affected case.
-novideo is the right way to disable video, and should also work in
more cases now that lavf is used as the default demuxer for more formats
(like AVI; internal AVI demuxer fails with -novideo).
Also change the man page description of -novideo a bit to make it
sound less negative about the chances of the option working.
Some Matroska files have inaccurate ordered chapter endpoints, and so
parts where one chapter should end and the next begin at the same
timestamp were not merged. This resulted in an unnecessary seek over a
minimal distance. Add a heuristic to merge parts with a minimal gap or
overlap between them.
Based on patch by Hector Martin <hector@marcansoft.com>.
ogg/ogm demuxers can give first audio packets without timestamp after
a seek. Due to some backwards compatibility code this results in the
sync code getting audio timestamp 0. In this case a lot of audio was
dropped unnecessarily when seeking to a position later in the file, as
the code saw audio starting from 0, video from something larger.
Make the code more robust in two ways. First, add a special case to
not try syncing if we get audio timestamp <= 0 (hopefully there aren't
many files where we'd really get audio starting from 0 and video from
a later timestamp). Second, when throwing audio away, make the code
recalculate from scratch the amount of bytes that still need to be
thrown away after every decode call. This limits the amount of damage
initial too-small timestamps can do, as the code will see the better
timestamps after a while.
Use the value of the OutputSamplingFrequency element instead of the
SamplingFrequency element as the "container samplerate". In most cases
this only removes a warning, as those typically differ for SBR AAC
files and there was already a special case detecting this in
ad_ffmpeg.
The implementation adds a new "container_out_samplerate" field to the
sh_audio struct. Reusing the existing "samplerate" field and the
equivalent inside the 'wf' struct and just setting those to the new
value instead would probably work (at least I'm not aware of any codec
that would need the original SamplingFrequency for initialization).
However using a separate field also avoids some ugliness: the 'wf'
struct may not exist (though most demuxers create it), and the
'samplerate' field is overwritten to reflect the final value decided
by codec when decoding is first initialized.
Add definitions for DisplayUnit, OutputSamplingFrequency and
FileDescription in matroska.py. Regenerate the C template files to
allow using all current definitions in code.
Commit 91ea30c585 ("demux_lavf: use lavf for all formats except those
listed") broke handling of files whose type libavformat couldn't
recognize at all. Fix the demux_lavf probe function to correctly
return failure in that case.
Commit 3c2cfee488 ("demux: improve -alang / -slang track choosing
logic") had a copy/paste error which left the subtitle code using
audio variables and broke initial subtitle track selection. Fix.
I actually realized soon after creating the original commit that I'd
forgotten to change the variables and went back to fix it, but then
somehow thought that it was already OK and didn't change it...
When loading automatically enabled profiles (like "[extension.avi]")
flag options were handled as on the command line; for example "fs=no"
was interpreted like "-fs" on command line, ignoring the "no" part.
Fix the parsing to treat them the same as other config file entries.
Due to a bug created back in 2006 when SimpleBlock support was added,
demux_mkv demuxed one audio packet from the initial file position
after a seek, then skipped the following ones until a video keyframe
was found. This wasn't very noticeable earlier, but it had bad effects
after the recently added -initial-audio-sync code as the extra packet
with an earlier timestamp confused timing calculations and resulted in
desync after seeking. Fix.
Commit fc66c94360 ("demux_mkv: seek: with no track-specific index
entries use any") used uint64_t for a variable that should have been
int64_t. Fix. The practical effects of this error were minor; mainly
it made the player unnecessarily read the file contents between the
previous index entry and the correct one when seeking.
If audio_block_size is 0 that is a bug (and will result in a division by 0
in one case that does not check this), thus remove all checks for it.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32623 b3059339-0415-0410-9bf9-f77b7e298cf2
[ Note: the questionable changes in svn that triggered this problem
were never included in git, and so this commit is not strictly
necessary here. It's included to reduce the differences between git
and svn demux_avi versions. ]
Fix possible division by 0 if -aid is used for AVI files.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32622 b3059339-0415-0410-9bf9-f77b7e298cf2
This makes MPlayer handle it the same way as curl, and it also is the
only method that works with http_proxy://...http://user:password@...
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32621 b3059339-0415-0410-9bf9-f77b7e298cf2
Select a stereo pixel format for window when Quadbuffer OpenGL was
selected as 3D mode.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32620 b3059339-0415-0410-9bf9-f77b7e298cf2
Make the file protocol read up to 64 KiB at once when the cache is used,
assuming that files will generally be readable with high bandwidth.
This should improve performance when playing e.g. from high-latency
network shares.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32616 b3059339-0415-0410-9bf9-f77b7e298cf2
Use fist(p)s instead of fist(p), fixes compilation with clang.
Patch by İsmail Dönmez, ismail namtrac org
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32613 b3059339-0415-0410-9bf9-f77b7e298cf2
Some indentation fixes.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32611 b3059339-0415-0410-9bf9-f77b7e298cf2
Simplify: Use early return instead of large if block.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32612 b3059339-0415-0410-9bf9-f77b7e298cf2
FFmpeg's AAC decoder is much faster than libfaad2. The only known
exception is libfaad2 compiled in fixed-point mode on systems with
slow FPUs. Now that LATM support in FFmpeg is complete, FFmpeg's AAC
decoder has a similar feature set as libfaad2. This leaves no reason
not to use FFmpeg by default.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32605 b3059339-0415-0410-9bf9-f77b7e298cf2
Playing AVI files containing B-frames with demux_lavf printed two
"decreasing pts" info messages at the start of the file. We know the
timestamps from AVI won't be valid pts, so add a demuxer field to
convey that information to the timing code and make that not even try
to use the timestamps as valid pts.
lavf demuxers are mostly better and receive more maintenance,
therefore it makes sense to prefer them in most cases. Change the
"preferred" logic from listing all formats for which lavf is preferred
to listing exceptions for which it isn't. Currently there are 3
exceptions: Matroska, FLAC and RealMedia (.rm).
Add code to enforce matching pts with video when (re)starting the
audio stream, by either cutting away the first samples or inserting
silence at the beginning. New option -noinitial-audio-sync can be used
to disable this and return to old behavior.
demuxer_get_current_chapter() accessed sh_video/sh_audio pts fields to
determine playback position. demux layer shouldn't access those and
the values used weren't quite correct anyway. Give the playback
position as a parameter to the demux layer function instead. Also
change the top-level get_current_chapter() to use get_current_time()
in the timeline case where it didn't refer to demux layer.
If the option is enabled and all audio has been buffered to the AO,
then the player will move to the next file without waiting for the
buffered audio to drain, while leaving the AO initialized. If the
playback of the next file starts quickly enough (before the AO buffer
empties) then it should continue writing audio to the same AO with no
gap in between.