summaryrefslogtreecommitdiffstats
path: root/mpvcore
Commit message (Collapse)AuthorAgeFilesLines
* command: add sub_seek input commandwm42013-10-023-6/+18
| | | | | | | Essentially reuses the sub_step command, and is subject to the same restrictions. Seems to behave a bit strange sometimes, but generally works.
* input: remove strange offset from commands enumwm42013-10-021-1/+1
| | | | A leftover from 10 years of refactoring.
* command: don't let "avsync" property print NOPTS valuewm42013-10-021-0/+2
| | | | | | Can happen when seeking in audio files with attached picture. MP_NOPTS_VALUE doesn't really make sense outside of mpv internals, so don't return it.
* mplayer: osd bar depends on VO, not video decodingwm42013-10-021-1/+1
| | | | The OSD bar wasn't displayed, and instead a fallback message was shown.
* mplayer: make VO interaction work in --idle modewm42013-10-021-19/+34
| | | | | | | Didn't handle VO events, didn't handle OSD message management. There is probably still some strangeness left. --idle mode was never made for direct interaction.
* mplayer: change default window size for --force-windowwm42013-10-021-1/+1
| | | | Closer to the ubiquitous 16:9 screen aspect ratio. Requested by ChrisK3.
* command: subtitle support depends on VO, not video decodingwm42013-10-022-13/+9
| | | | | | | | | We can render subtitles if a VO is open. Whether we're decoding video (i.e. if mpctx->sh_video is set) doesn't really matter. Subtitle display with --force-window still doesn't quite work yet, because there's nothing to actually force redrawing of subtitles in this mode.
* core: add --force-windowwm42013-10-024-16/+83
| | | | | | | | | | | | | | | | | This commit adds the --force-window option, which will cause mpv always to create a window when started. This can be useful when pretending that mpv is a GUI application (which it isn't, but users pretend anyway), and playing audio files would run mpv in the background without giving a window to control it. This doesn't actually create the window immediately: it only does so only after initializing playback and when it is clear that there won't be any actual video. This could be a problem when starting slow or completely stuck network streams (mpv would remain frozen in the background), or if video initialization somehow is stuck forever in an in-between state (like when the decoder doesn't output a video frame, but doesn't return an error either). Well, we can pretend only so much that mpv is a GUI application.
* core: don't require "refresh" seek for --keep-openwm42013-10-021-7/+1
| | | | | | | | | | | | | | | | | | | | | Seeking normally resets the VO and throws away the currently displayed frame, so if you seek outside the video with --keep-open enabled, the window would normally be "stuck" and not redraw properly, because there is no source video frame that could be redrawn. To deal with this, a precise seek to the position of the last displayed video frame was issued. This usually worked, but it can fail for formats where seeking is broken or not possible (consider reading from a pipe). Fix this by changing the semantics for vo_seek_reset(): now the video frame is remembered even after seeking. Note that this changes behavior a little when trying to seek outside of a file with --keep-open enabled. Since no actual seek is done anymore, the video will remain "frozen" on the previous position, and you can't unpause or framestep to see the video between current position and actual end of the video. If users complain, I might revert this commit.
* mplayer: fix looping of very short fileswm42013-09-293-7/+19
| | | | | | | | | | | | | | | Commit 884c179 attempted to make it possible to skip backwards through the playlist, even for files which fail to intitialize, or play for a very short time. This was also used to prevent mpv from looping forever and doing nothing if --loop=inf is used, and no file in the playlist is playable. This broke looping of very short files, because mpv was assuming that this case happened. But there are legitimate use cases. Fix this by making the looping case special. Instead of checking whether playback was "very short", check whether something could be decoded and displayed/played. If yes, allow looping.
* osc: add options to show OSC only when FS/windowedChrisK22013-09-271-2/+12
| | | | | | The boolean-options showWindowed and showFullscreen can now be set in plugin_osc.conf to control the behaviour. enhancement for #262
* network: add options to control TLS verificationwm42013-09-272-0/+6
|
* input: translate mouse position to OSD space earlywm42013-09-273-17/+2
| | | | | | | | | | | | | | Until now, mouse positions were just passed to the core as-is, even if the mouse coordinates didn't map to any useful coordinate space, like OSD coordinates. Lua scripting (used by the OSC, the only current user of mouse input) had to translate mouse coordinates manually to OSD space using mp_get_osd_mouse_pos(). This actually didn't work correctly in cases mouse coordinates didn't map to OSD (like vo_xv): the mouse coordinates the OSC got were correct, but input.c was still expecting "real" mosue coordinates for mouse areas. Fix this by converting to OSD coordinates before passing the mouse position to the core.
* input: handle MOUSE_LEAVE speciallywm42013-09-271-0/+8
| | | | | | Do this so that MOUSE_LEAVE can't be combined with other keys. (E.g. keep 'w' pressed, then move the mouse outside of the mpv window; it will print a warning what w-MOUSE_LEAVE is not mapped.)
* input: more mp_msg conversionwm42013-09-273-64/+57
| | | | | | | | It appears the last run missed all mp_tmsg(). Since the command parser also prints messages, it needs a new parameter to pass a log context. We go the easy way and just require the input_ctx to be passed, and use its mp_log.
* osc: Prevent OSD style options from messing with the OSC stylesChrisK22013-09-261-18/+30
| | | | Should fix #259
* matroska: fix uninitialized memory accesses with ordered chaptersBen Boeckel2013-09-261-0/+1
| | | | | | | There is uninitialized memory access if the actual size isn't passed along. In the worst case, this can cause a source to be loaded against the uninitialized memory, causing a false count of found versus required sources, preventing the "Failed to find ordered chapter part" message.
* video: let sh_video->disp_w/h always be container sizewm42013-09-261-4/+8
| | | | | | | Nothing really accesses it. Subtitle initialization actually does in a somewhat meaningful way, but there container size is probably fine, as subtitles were always initialized before the first video frame was decoded.
* video: let sh_video->aspect always be container aspect ratiowm42013-09-262-9/+19
| | | | | | | Now writing -1 to the 'aspect' property resets the video to the auto aspect ratio. Returning the aspect from the property becomes a bit more complicated, because we still try to return the container aspect ratio if no frame has been decoded yet.
* Add the on-screen-controllerChrisK22013-09-264-0/+1175
| | | | Signed-off-by: wm4 <wm4@nowhere>
* Add initial Lua scripting supportwm42013-09-2612-3/+1017
| | | | | | | | | | | | | | | | | | | | | | This is preliminary. There are still tons of issues, and any aspect of scripting may change in the future. I decided to merge this (preliminary) work now because it makes it easier to develop it, not because it's done. lua.rst is clear enough about it (plus some sarcasm). This requires linking to Lua. Lua has no official pkg-config file, but there are distribution specific .pc files, all with different names. Adding a non-pkg-config based configure test was considered, but we'd rather not. One major complication is that libquvi links against Lua too, and if the Lua version is different from mpv's, you will get a crash as soon as libquvi uses Lua. (libquvi by design always runs when a file is opened.) I would consider this the problem of distros and whoever builds mpv, but to make things easier for users, we add a terrible runtime test to the configure script, which probes whether libquvi will crash. This is disabled when cross-compiling, but in that case we hope the user knows what he is doing.
* Fix previous commitwm42013-09-251-0/+4
| | | | | | | This time it broke because I didn't actually test compiling vo_vaapi.c, and it was using a macro from mp_image.h, which implicitly assumed FFALIGN was available. Screw that too, and copy the definition of ffmpeg's FFALIGN to MP_ALIGN_UP, and move these macros to mp_comnon.h.
* vaapi: fix compilation with Libavwm42013-09-251-0/+2
| | | | | | | | | | | The code using FFSWAP was moved from vo_vaapi.c to vaapi.c, which didn't include libavutil/common.h anymore, just libavutil/avutil.h. The header avutil.h doesn't include common.h recursively in Libav, so it broke there. Add FFSWAP as MPSWAP in mp_common.h (copy pasted from ffmpeg) to make sure this doesn't happen again. (This kind of stuff happens all too often, so screw libavutil.)
* options: allow selecting the libass shaperwm42013-09-252-0/+4
| | | | | | I'm using the word "languages" instead of "scripts" in the manpage, but I think that's easier to understand with a smaller amount of descriptions.
* options: make --ass-hinting a choice, instead of using magic numberswm42013-09-251-1/+2
| | | | | options.c still doesn't use the constants defined by the libass headers, but it's still better than exposing those to the user directly.
* vaapi: allow GPU read-back with --hwdec=vaapi-copywm42013-09-251-1/+2
| | | | | | | | | | | | | | This code is actually quite inefficient: it reuses the (slow, simple) screenshot code. It uses an inefficient method to read the image (vaGetImage() instead of vaDeriveImage()), allocates new memory for each frame that is read, and it tries all image formats again each time. Also, in my tests it always picked NV12 as image format, which is not ideal if you actually want to filter the video, and vo_xv can't handle this format without conversion either. However, a user confirmed that it worked for him, so everything is fine.
* vaapi: add vf_vavpp and use it for deinterlacingxylosper2013-09-251-0/+3
| | | | | | | | Merged from pull request #246 by xylosper. Minor cosmetic changes, some adjustments (compatibility with older libva versions), and manpage additions by wm4. Signed-off-by: wm4 <wm4@nowhere>
* command: fix short buffer when handling of long property nameswm42013-09-241-6/+4
| | | | | | This wasn't enough and could lead to a cut off message shown on OSD. Just make it dynamic, since we already use dynamic memory allocation at this point anyway.
* mplayer: attempt to make playback resume work with DVD/BDwm42013-09-224-13/+24
| | | | | | | | | | | | | | | | The problem with DVD/BD and playback resume is that most often, the filename is just "dvd://", while the actual path to the DVD disk image is given with --dvd-device. But playback resume works on the filename only. Add a pretty bad hack that includes the path to the disk image if the filename starts with dvd://, and the same for BD respectively. (It's a bad hack, but I want to go to bed, so here we go. I might revert or improve it later, depending on user feedback.) We have to cleanup the global variable mess around the dvd_device. Ideally, this should go into MPOpts, but it isn't yet. Make the code paths in mplayer.c take MPOpts anyway.
* network: fix rtsp playbackwm42013-09-222-0/+7
| | | | | | | | | | | | | | By default, libavformat uses UDP for rtsp playback. This doesn't work very well. Apparently the reason is that the buffer sizes libavformat chooses for UDP are way too small, and switching to TCP gets rid of this issue entirely (thanks go to Reimar Döffinger for figuring this out). In theory, you can set buffer sizes as libavformat options, but that doesn't seem to help. Add an option to select the rtsp transport, and make TCP the default. Also remove an outdated comment from stream.c.
* command: when changing volume while muted, show an extra message on OSDwm42013-09-211-1/+2
| | | | | So nobody has to wonder why everything is silent, even if they raise the volume.
* command: when changing a property, allow showing an extra OSD messagewm42013-09-214-33/+50
| | | | | | | | | | This is for properties that normally show a bar, and thus do not show an OSD message (as per classic mplayer behavior). Setting an extra_msg allows showing an OSD message anyway, except if OSD messages are explicitly suppressed. This refactors the whole show_property_osd() function a bit, and replaces the weird sep field with a more general method.
* m_property: add a way to switch on property values in property expansionwm42013-09-201-3/+9
| | | | | | | | | | Allows for example: --status-msg='${?pause==yes:(Paused) } ...' to emulate the normal terminal status line. It's useful in other situations too. I'm a bit worried about extending this mini-DSL, and sure hope nobody will implement a generic formula evaluator at some point in the future. But for now we're probably safe.
* m_property: rearrange codewm42013-09-201-20/+27
|
* command: don't append, but prepend deinterlace filter by defaultwm42013-09-201-1/+1
| | | | | | In most cases, it's better if deinterlacing happens before any other filtering, so prepend the filter to the user's filter list, instead of appending it.
* command: use a list of potential deinterlacer filterswm42013-09-201-13/+22
| | | | | | | | Instead of hardcoding a single filter. This might be helpful for modeling the vaapi deinterlacer as a video filter. The idea is that a software deinterlacer would be tried first, and if that fails (because vaapi hardware decoding uses HW surfaces, which a software deinterlacer does not accept), the vaapi filter would be tried.
* Merge branch 'volume_restore'wm42013-09-205-61/+37
|\
| * mixer: make struct opaquewm42013-09-203-15/+14
| | | | | | | | Also remove stray include statements from ao_alsa and ao_oss.
| * mixer: allow accessing volume and mute property on disabled audiowm42013-09-201-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The volume is set as soon as the audio chain is created again. This works only in softvol mode. For system wide volume or otherwise externally user controllable volume, this code is intentionally disabled. It would be extremely weird if changing volume (while audio is not initialized) would do nothing, and then suddenly change it when the audio chain is created. There's another odd corner case: the user-set volume will be thrown away if it's set before the _first_ audio chain initialization. This is because the volume restore logic recognizes a change from nothing to softvol or an AO, and circumventing that would require additional code. Also, we don't even know the start volume before that point. Forcing the volume with --volume will can override the volume set during no-audio mode, depending on the situation.
| * mixer: restore volume with playback resumewm42013-09-204-2/+19
| | | | | | | | | | | | | | | | | | Note that this is intentionally never done if the AO or softvolume is different, or if the current volume control method is thought to control system wide volume (such as ALSA) or otherwise user controllable (such as PulseAudio). The intention is to keep things robust and to avoid messing with the user's audio settings as far as possible, while still providing the ability to resume volume if it makes sense.
| * mixer: refactor, fix some aspects of --volume handlingwm42013-09-192-36/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor how mixer.c does volume/mute restoration and initialization. Move to handling of --volume and --mute to mixer.c. Simplify the implementation of these and hopefully fix bugs/strange behavior related to using them as file-local options (this uses a somewhat dirty trick: the option values are reverted to "auto" after initialization). Put most code related to initialization and volume restoring in probe_softvol() and restore_volume(). Having this code all in one place is less confusing. Instead of trying to detect whether to use softvol at runtime, detect it at initialization time using AOCONTROL_GET_VOLUME (same with mute, AOCONTROL_GET_MUTE). This implies we expect SET_VOLUME/SET_MUTE to work if the GET variants work. Hopefully this is always the case. This is also preparation for being able to change volume/mute settings if audio is disabled, and for allowing restoring value with playback resume.
| * mixer: minor refactoringwm42013-09-191-7/+4
| | | | | | | | | | Let struct mixer access access MPOpts to simplify some things. Rename some variables and functions. There should be no functional changes.
* | mplayer: rename a somewhat misnamed functionwm42013-09-191-2/+2
|/
* Config path functions can return NULLwm42013-09-181-3/+5
| | | | | | | It's quite unlikely, but functions like mp_find_user_config_file() can return NULL, e.g. if $HOME is unset. Fix all the code that didn't check for this correctly yet.
* macosx: move bundle path stuff to path-macosx.mStefano Pigozzi2013-09-181-6/+1
| | | | This makes the code uniform to how stuff was handled for Windows in 1cb55ceb.
* path, win32: redo user configfile path handlingwm42013-09-181-70/+15
| | | | | | | | | | | | | | | | | Remove the ifdef hell from mp_find_user_config_file(). Move the win32 specific code (for MinGW and Cygwin) to path-win.c. The behavior should be about the same, but I can't be sure due to lack of testing and because the old path.c code was hard to follow. (I expect those who care about windows will fix things, should issues pop up - sorry.) One difference is that the new code will always force MPV_HOME. It looks like the old code preferred the mpv config dir in the exe dir if it exists. Also, make sure MP_PATH_MAX has enough space, even if the equivalent wchar_t string is not 0-terminated with PATH_MAX (because apparently the winapi doesn't require this). (Actually, maybe we should just kill all uses of PATH_MAX/MP_PATH_MAX.)
* path: fix undefined behaviorwm42013-09-181-2/+2
| | | | | | | The homepath variable was static, and its value was set to a stack buffer. This means a second invocation of the function would trigger undefined behavior. Moreover the stack buffer always went out of scope before homepath was used.
* mplayer: read subtitle packets as soon as possiblewm42013-09-161-8/+5
| | | | | | | | | | | | | Call update_subtitles() on every iteration of the playloop, so that subtitle packets are read as soon as possible, instead of every time a video frame is displayed. This helps in case the packet queue is swamped with subtitle packets, which can happen with certain insane mkv files. The change will simply cause the subtitle queue to be emptied on each playloop iteration. The timestamps update_subtitles() uses for display are the same before and after this commit. (Important for files which have subtitle packets with timestamps or duration not set.)
* command: force video refresh when changing aspectwm42013-09-151-1/+2
| | | | | Pausing the player and changing the aspect would leave the VO without a frame to display.
* screenshot: change %w format to be more like %twm42013-09-151-8/+4
| | | | | | Instead of containing a format string within %w{...}, simply allow %w to specify one item of a time format string. This is simpler, more like other format specifiers (%t), and probably easier to use too.
* mplayer: attempt to skip playlist entries which can't be playedwm42013-09-154-5/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is for situations when repeated attempts at playing a playlist entry failed, and playlist navigation becomes impossible due to that. For example, it wasn't possible to skip backwards past an unplayable playlist entry: mpv file1.mkv doesntexist.mkv file3.mkv You couldn't skip back to file1.mkv from file3.mkv. When running a single "playlist_prev" command, doesntexist.mkv would be played, which would fail to load. As reaction to the failure to load it, the next file would be played, which is file3.mkv. To make this even worse, the file could successfully load, but run only for a split second. So just loading successfully isn't good enough. Attempt to solve this by marking problematic playlist entries as failed, and by having playlist_prev skip past such playlist entries. We define failure as not being able to play more than 3 seconds (or failing to initialize to begin with). (The 3 seconds are in real time, not file duration.) "playlist_prev force" still exhibits the old behavior. Additionally, use the same mechanism to prevent pointless infinite reloading if none of the files on the playlist exist. (See github issue All in all, this is a heuristic, and later adjustments might be necessary. Note: forward skips (playlist_next) are not affected at all. (Except for the interaction with --loop.)
* screenshot: make it possible to format playback time in various wayswm42013-09-151-0/+17
|
* mp_common: add function which accepts a format string to format playback timewm42013-09-152-11/+50
|
* mplayer: don't run heartbeat command while pausedwm42013-09-151-1/+1
| | | | | | | | This is commonly used to disable the screensaver with broken/non- standard X screensavers. During pause, the screensaver should not be disabled, so not calling this command while paused seems sensible. See github issue #236.
* av_l