summaryrefslogtreecommitdiffstats
path: root/command.c
Commit message (Collapse)AuthorAgeFilesLines
* OSD: when switching sub/audio tracks show title of new trackUoti Urpala2011-07-031-9/+20
| | | | | | 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")'.
* commands: change property mechanism to use talloc stringsUoti Urpala2011-07-031-63/+52
|
* command.c: Add missing osdep/strsep.h #includediego2011-06-291-0/+1
| | | | | | | | 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
* Merge branch 'mplayer1_changes'Uoti Urpala2011-05-021-0/+2
|\
| * commands: Fix DVD angle cycling upreimar2011-05-021-0/+2
| | | | | | | | | | | | Patch by 侯红勋 [houhongxun gmail com] git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33317 b3059339-0415-0410-9bf9-f77b7e298cf2
* | command.c: fix sub_remove crashUoti Urpala2011-05-021-1/+8
| | | | | | | | | | The sub_remove slave command tried to access a NULL pointer when removing an external subtitle file displayed with libass. Fix.
* | audio: change external AO interface to "ao_[method](ao, ...)"Uoti Urpala2011-04-091-1/+1
|/ | | | | | | | 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.
* core, demux: fix video index handling in stream switchingUoti Urpala2011-03-311-15/+11
| | | | | | | | Fix bugs in the handling of stream index values in video stream switching. This is similar to what commit 90bedd0b872b6eea02351aafb62e did for audio. Also clean up the corresponding audio code a little bit.
* cleanup: define ROUND() macro in mpcommon.hcboesch2011-01-311-2/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32751 b3059339-0415-0410-9bf9-f77b7e298cf2
* commands: improve playback speed property/commandsUoti Urpala2011-01-281-19/+15
| | | | | | | 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.
* sub/OSD: move some related files to sub/Uoti Urpala2011-01-261-5/+5
|
* subs: use correct font aspect ratio for libass + converted subsUoti Urpala2011-01-261-3/+8
| | | | | | | | | | | | | | | | | | | | | | 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.
* subtitles: add framework for subtitle decodersUoti Urpala2011-01-181-4/+6
| | | | | | | | | | 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.
* subtitles: move global ass_track to struct osd_stateUoti Urpala2011-01-151-14/+11
|
* core: move most mpcommon.c contents to mplayer.cUoti Urpala2011-01-151-1/+1
| | | | | | | | | | | | | | | | 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.
* core: move global "subdata" and "vo_sub_last" to mpctxUoti Urpala2011-01-111-8/+9
|
* Merge branch 'hr-seek'Uoti Urpala2010-12-201-31/+60
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
| * core: add support for precise non-keyframe-limited seeksUoti Urpala2010-12-201-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * core: add struct for queued seek infoUoti Urpala2010-12-201-20/+12
| | | | | | | | | | | | | | | | 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.
| * commands: add generic option -> property wrapperUoti Urpala2010-12-181-0/+37
| | | | | | | | | | | | | | | | | | 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).
| * core: avoid using sh_video->pts as "current pts"Uoti Urpala2010-12-141-7/+5
| | | | | | | | | | | | 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).
* | commands: clean up get_metadata() and related codeUoti Urpala2010-12-201-68/+42
| | | | | | | | | | | | | | 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.
* | commands: Allow cycling subtitles backwards with 'J'reimar2010-12-161-2/+4
| | | | | | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32680 b3059339-0415-0410-9bf9-f77b7e298cf2 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32714 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Change some filename-handling code to use mp_basename()cboesch2010-12-161-8/+3
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32675 b3059339-0415-0410-9bf9-f77b7e298cf2
* | core: avoid using build_afilter_chain() directlyreimar2010-12-161-7/+7
|/ | | | | | | | | | 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
* options: more mplayer.c options moved to option structClément Bœsch2010-11-141-1/+1
| | | | | | Following options were moved: autoq, benchmark, [no]term-osd, term-osd-esc, playing-msg, [no]idle, [no]consolecontrols, list-properties.
* core: use correct demuxer with -audiofile / -subfileUoti Urpala2010-11-081-18/+18
| | | | | | | | | | | 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.
* core: move video pos/length query functions from demux to coreUoti Urpala2010-11-081-19/+11
| | | | | | | | | 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).
* cleanup: don't check for NULL before free()diego2010-11-081-4/+2
| | | | | | patch by Clément Bœsch, ubitux gmail com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32598 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add a simple capture feature (-capture)Uoti Urpala2010-11-021-0/+38
| | | | | | | | | | | | | | | | | 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
* new slave command: af_cmdline, for changing audio filter optionsreimar2010-11-021-0/+13
| | | | | | | | | Add experimental af_cmdline slave command to allow changing filter options at runtime. Patch by Adrian Stutz [adrian sttz ch] git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32505 b3059339-0415-0410-9bf9-f77b7e298cf2
* cosmetics: remove some useless braces from command.ccigaes2010-11-021-4/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32492 b3059339-0415-0410-9bf9-f77b7e298cf2
* command.c: use different field in property table for integer dataUoti Urpala2010-11-021-21/+21
| | | | | | | | | | | | | | | | | | 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).
* command.c: Change cast to avoid a warningreimar2010-11-021-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31795 b3059339-0415-0410-9bf9-f77b7e298cf2
* slave mode: Add stream_time_pos propertyreimar2010-11-021-0/+13
| | | | | | 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
* subs: Change global subtitle numbering schemereimar2010-11-021-48/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* cosmetics: "struct vf_instance* vf" -> "struct vf_instance *vf"Uoti Urpala2010-05-291-1/+1
| | | | | | | Change 'struct vf_instance' pointer arguments to more standard style as in the subject. Also some other minor formatting fixes. Patch by Diego Biurrun.
* Make audio stream index handling saner in stream switchingUoti Urpala2010-05-221-13/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Merge svn change r31134Uoti Urpala2010-05-071-1316/+1316
|\ | | | | | | Fix some search/replace errors introduced in the svn commit.
| * the great MPlayer tab removal: part IIdiego2010-05-031-1416/+1416
| | | | | | | | | | | | | | some extra indentation fixes are put in as a bonus git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31134 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r31033Uoti Urpala2010-04-261-0/+48
|\|
| * Add slave commands for loading and unloading audio filters at runtime.cehoyos2010-04-111-0/+37
| | | | | | | | | | | | | | Patch by Jehan Hysseo, hysseo zemarmot net git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31030 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Add osd_show_progression: Show progress bar and elapsed/total time.cehoyos2010-04-091-0/+11
| | | | | | | | | | | | | | Patch by Hugo Chargois, hugo D chargois A free fr git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31028 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30967Uoti Urpala2010-04-261-1/+1
|\|
| * Rename get_path.[ch] --> path.[ch].diego2010-03-201-1/+1
| | | | | | | | | | | | | | 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
* | Fix chapter handling with first chapter not at beginning of fileUoti Urpala2010-04-251-1/+1
| | | | | | | | | | | | | | | | | | | | 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 seek-reset functionality out of demuxer.cUoti Urpala2010-04-231-0/+11
| | | | | | | | | | | | | | 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.
* | Delete things related to old translation systemUoti Urpala2010-03-101-1/+0
| | | | | | | | | | Remove the help/ subdirectory, configure code to create toplevel help_mp.h, and all the '#include "help_mp.h"' lines from .c files.
* | Merge svn changes up to r30475Uoti Urpala2010-03-091-0/+18
|\|
| * Add license header to all top-level files missing them.diego2010-01-301-0/+18
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30471 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30419Uoti Urpala2010-01-251-40/