If the played file has per-track titles for audio and subtitles show
those on the OSD when switching tracks. This changes the OSD message
from 'Audio: (2) eng' to 'Audio: (2) eng ("Director's commentary")'.
The include is needed on systems without native strsep().
based on a patch by Stephen Sheldon, sfsheldo gmail com
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33338 b3059339-0415-0410-9bf9-f77b7e298cf2
Make the outside interface of audio output handling similar to the
video output one. An AO object is first created, and then methods
called with ao_[methodname](ao, args...). However internally libao2/
still holds all data in globals, and trying to create multiple
simultaneous AO instances won't work.
Fix bugs in the handling of stream index values in video stream
switching. This is similar to what commit 90bedd0b87
did for audio.
Also clean up the corresponding audio code a little bit.
Add a definition to show the playback speed property on screen, and
change the separate commands (speed_mult etc) to use the property
mechanism. Now 'set_property_osd speed' can show the value on OSD, and
the separate commands respect the range limits of the option.
Rendering of ASS subtitles tries to be bug compatible with VSFilter
and stretches fonts when the video is anamorphic (some scripts try to
compensate for this VSFilter behavior, so trying to render them
"correctly" would give the wrong result). However this behavior is not
appropriate for subtitles we converted to ASS format ourselves for
libass rendering, as they certainly don't have VSFilter bug
workarounds. Change the code to use different behavior for "native"
ASS tracks and converted ones. It's questionable whether the
VSFilter-compatible behavior is appropriate for external .ass files
either, as there could be anamorphic and non-anamorphic versions of
the same video and the bug-compatible behavior can only be correct for
one alternative at most. However it's probably better to keep it as a
default at least, so that extracting a muxed subtitle track and using
that does not give behavior different from the original muxed one.
The aspect ratio setting is per ASS_Renderer, and changing it resets
libass caches. For that reason this commit adds separate renderer
instances to use for the "correct" and "VSFilter bug compatible"
cases.
Add a framework for subtitle decoder modules that work more like
audio/video decoders do, and change libass rendering of demuxed
subtitles to use the new framework.
The old subtitle code is messy, with details specific to handling
particular subtitle types spread over high-level code. This should
make it easier to clean things up and fix some bugs/limitations.
The contents of mpcommon.c were quite arbitrary; the most common
reason to place some functions in this file had been "MEncoder happens
to need similar code as MPlayer and we want to share some parts, but
we have no clue whatsoever how to organize things in a sensible way,
so we'll just dump those parts we want to share in mpcommon.c". As a
result of containing an essentially random subset of top-level player
functionality the mpcommon.h header required access to central structs
and was unsuitable for inclusion in lower-level code, but was
nonetheless included there for the mplayer_version symbol.
Move almost all contents from mpcommon.c to mplayer.c. mplayer.c is
already big and should perhaps be split further, but keeping a few
random functions in mpcommon.c would not be an improvement.
* hr-seek:
input: add default keybindings Shift+[arrow] for small exact seeks
input: support bindings with modifier keys for X input
core: audio: make ogg missing audio timing workaround more complex
core: add support for precise non-keyframe-limited seeks
core: add struct for queued seek info
commands: add generic option -> property wrapper
options: add "choice" option type, use for -pts-association-mode
core: remove looping in update_video(), modify command handling a bit
core: seek: use accurate seek mode with audio-only files
core: avoid using sh_video->pts as "current pts"
libvo: register X11 connection fd in input event system
core: timing: add special handling of long frame intervals
core: move central play loop to a separate function
Conflicts:
DOCS/tech/slave.txt
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.
Code in get_metadata() allocated too small a buffer for the text it
wrote (noticed by Clément Bœsch). Make the code cleaner and more
robust by changing it to use talloc_asprintf(). Also make it always
return non-NULL and remove checks on caller side.
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).
build_afilter_chain is not safe to use directly, thus make it
static and instead use reinit_audio_chain which should have
better error handling.
Fixes a crash with -af hrtf and changing speed, audio will
still stop playing though.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32648 b3059339-0415-0410-9bf9-f77b7e298cf2
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).
Various code referred to "mpctx->demuxer" where it should really have
referred to the one used for audio/subtitles in case those differ. Fix
by using "mpctx->d_audio->demuxer" etc instead. Disable the copying of
streams in demux_demuxers; that was a partial workaround for things
referring to the main demuxer (and it wasn't enough anyway).
This fixes, among other things, switching audio tracks within the file
specified by -audiofile.
Move functions to query current playback position, percentage position
and total video length from from the demuxer layer to top level. The
functions need access to playback state that doesn't belong on the
demuxing level. Make the new functions more capable and simplify some
code that can now rely on them. This fixes some errors in displayed in
OSD and slave mode information when using timeline (ordered chapters).
If a specified key is pressed during playback, the current stream is
captured to a file, similar to what -dumpstream achieves.
original patch by Pásztor Szilárd, don tricon hu
Taken from the following svn commits, but with several fixes and
modifications (one obvious user-visible difference is that the default
key binding is 'C', not 'c'):
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32524 b3059339-0415-0410-9bf9-f77b7e298cf2
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32529 b3059339-0415-0410-9bf9-f77b7e298cf2
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32530 b3059339-0415-0410-9bf9-f77b7e298cf2
The video equalizer properties plus tv_* and teletext_* ones use a
single function to handle multiple properties, with data in the struct
m_option "prop" argument indicating which property is being
handled. They all use integer data for that, but stored it in the
"priv" field of the struct which has type "void *". This caused
warnings and is not standard C (it's not guaranteed that you can cast
an arbitrary integer to "void *' and back - it'd work in the _other_
direction with intptr_t if that type exists).
Change the code to store the data in the "offset" field of the prop
struct instead. The name is not optimal for the way the functions use
it (except for gamma), but it'll do. (An alternative would be to store
a pointer in the priv field as in "(void *)&(const int){123}", but
that's somewhat ugly - the explicit (void *) cast is needed to avoid a
qualifier warning unless make it non-const data).
Patch by Paul Huwe [reicow yahoo com] with some modifications by me.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31794 b3059339-0415-0410-9bf9-f77b7e298cf2
Change numbering so that demuxers can "asynchronously" add subtitles
during playback.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31678 b3059339-0415-0410-9bf9-f77b7e298cf2
Fix calculation of global_sub_size.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31711 b3059339-0415-0410-9bf9-f77b7e298cf2
Update global_sub_pos if we auto-selected a subtitle.
This avoid strange behaviour with subtitle selection in that
case, because the subtitle selection code thinks no subtitle
was displayed while we actually did display one.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31863 b3059339-0415-0410-9bf9-f77b7e298cf2
Move function to avoid a forward declaration.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31864 b3059339-0415-0410-9bf9-f77b7e298cf2
Fix subtitle selection: make selecting -sid 0 work again by replacing the
M_PROPERTY_STEP_UP hack by M_PROPERTY_SET and set the global sub pos also
when we do not yet have a subtitle stream but do know the number of subs
from out-of-band as e.g. for DVD.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31882 b3059339-0415-0410-9bf9-f77b7e298cf2
100l, re-add vobsub_get_id_by_index call accidentally removed in
r31678.
Patch by ubitux [ubitux gmail com].
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31985 b3059339-0415-0410-9bf9-f77b7e298cf2
Change 'struct vf_instance' pointer arguments to more standard style
as in the subject. Also some other minor formatting fixes.
Patch by Diego Biurrun.
The handling of audio stream numbering was handled in the stream
selection property was a total mess. The most important issue was
confusion between values used as index for demuxer->audio_streams[]
array (consistently stored in demuxer->audio->id) and values stored
in sh_audio->aid and used as "-aid N" option values. Now demuxer audio
switch control functions and demuxer_switch_audio() are supposed to
return the new value for the "-aid" option (internal MPEG demuxers
still don't; the demuxer requirement could perhaps be dropped as it
can be easily calculated afterwards). That is also the value
returned for the "switch_audio" property. The main changes are:
- Make command.c mp_property_audio() consistently use and return the
"-aid" values. Before it used that as input but the array index as
output, with extra mess related to demuxer_switch_audio() return
value. Don't modify the audio_id option field any more.
- Make demuxer_switch_audio() always return "-aid" values (like it
takes as input). There are two changes for this: picking this
return value in case the demuxer doesn't support switching, and
overriding demuxer return value (for internal MPEG demuxers).
- Make demux_lavf return "-aid" values from DEMUXER_CTRL_SWITCH_AUDIO
code. This isn't actually necessary because of the override part
above.
Here's some history of the relevant behavior that I looked up:
* For most demuxers array index and "-aid" values are the same. At
least demux_mkv, (some of?) the internal MPEG demuxers and demux_ogg
have differed for a long time. demux_ogg doesn't matter because it
doesn't support stream switching.
* Old code seemed to assume that demuxer_switch_audio() return value was
array index, but this wasn't true at least for demux_mkv.
* In svn r19951 reimar mostly removed use of the return value.
* In r20162 ptt added mp_property_audio(). This set the global
audio_id variable (-aid option value) to the return value of
demuxer_switch_audio() and treated the global as the persistent
value of the property, apparently assuming that it would be set to
the "-aid" value, not array index. This was false for internal
MPEG.
* In r30124 reimar changed the property code so that even though it
still modified the option value it didn't use that as the value of
the property any more; instead it incorrectly used the array index.
This meant that for demux_mkv the return value didn't match -aid any
more (though input still did, so setting the property and querying
it didn't match as they used different value systems).
* In r31129 aurel made demux_lavf changes that resulted in its -aid
and array index values no longer matching either. He didn't change
the return value from audio switch when changing -aid, so it now
matched array index only. The latter part didn't cause additional
problems from r20162 though because either choice would have been
broken anyway after r30124 as long as they weren't the same value.
Before "-chapter 1" did nothing even if the first chapter didn't start
at the beginning of file. Fix it.
Before all chapter property commands (including chapter seek keys)
failed if the current playback position was before the start of the
first chapter. Now they'll work. Relative chapter seeks will go to the
first chapter (even if that's in the wrong direction for backward
seeks).
Move code for resetting decoders after seeks, chapter seeks and angle
changes out of demuxer.c. This functionality belongs on a higher
level; the demux layer can't always know what kind of reinitialization
is required.
These files now contain different functions related to path handling.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30943 b3059339-0415-0410-9bf9-f77b7e298cf2