summaryrefslogtreecommitdiffstats
path: root/core
Commit message (Collapse)AuthorAgeFilesLines
* options: add allow-mimetype suboption for demux_lavfwm42013-05-272-0/+4
| | | | | | | This can control whether demux_lavf should use the HTTP mime type to determine the format, instead of probing the data with the libavformat API. Do this to allow easier debugging in case the mimetype is incorrect. (This is done only for AAC streams right now.)
* mplayer: output status line normally with --no-consolecontrolswm42013-05-271-1/+1
| | | | | | | | | | | | | | In commit 0e07189, I made the status line always print a newline, instead of cutting the output at 80 columns (or if stderr is a terminal, whatever width the terminal reports). This is better in the case the output goes into a log file or a pipe. This caused problems for people who want to pipe raw video to mpv, so change it again. (Not sure why they won't use FIFOs instead.) Now output untrimmed lines if the slave mode flag is set, which makes sense to do, too. The current slave mode is still on life support, though.
* Replace calls to usec_sleep()wm42013-05-262-2/+2
| | | | | | This is just dumb sed replacement to mp_sleep_us(). Also remove the now unused usec_sleep() wrapper.
* Replace all calls to GetTimer()/GetTimerMS()wm42013-05-267-75/+66
| | | | | | | | | | | | | | | | | | | | | | GetTimer() is generally replaced with mp_time_us(). Both calls return microseconds, but the latter uses int64_t, us defined to never wrap, and never returns 0 or negative values. GetTimerMS() has no direct replacement. Instead the other functions are used. For some code, switch to mp_time_sec(), which returns the time as double float value in seconds. The returned time is offset to program start time, so there is enough precision left to deliver microsecond resolution for at least 100 years. Unless it's casted to a float (or the CPU reduces precision), which is why we still use mp_time_us() out of paranoia in places where precision is clearly needed. Always switch to the correct time. The whole point of the new timer calls is that they don't wrap, and storing microseconds in unsigned int variables would negate this. In some cases, remove wrap-around handling for time values.
* vo: rip out VO timer wakeup mechanism againwm42013-05-261-12/+2
| | | | | | | This was used by some VOs to do timing of cursor autohiding, but we recently moved that out of the VOs. Even though this mechanism might be a good idea and could be needed again in future (but for what?), it's unused now. So better just get rid of it.
* timer: refactor, add 64 bit timer functionwm42013-05-261-5/+2
| | | | | | | | | | | | | | Make OS specific timer code export a mp_raw_time_us() function, and add generic implementations of GetTimer()/GetTimerMS() using this function. New mpv code is supposed to call mp_time_us() in situations where precision is absolutely needed, or mp_time_s() otherwise. Make it so that mp_time_us() will return a value near program start. We don't set it to 0 though to avoid confusion with relative vs. absolute time. Instead, pick an arbitrary offset. Move the test program in timer-darwin.c to timer.c, and modify it to work with the generic timer functions.
* core: do mouse cursor hiding business in frontendwm42013-05-265-7/+57
| | | | | Do this so that not every VO backend has to setup a timer for cursor hiding and interpret the --cursor-autohide option.
* vf_lavfi: allow setting avoptswm42013-05-261-0/+4
|
* macosx_application: implement "Quit & remember position"Stefano Pigozzi2013-05-231-1/+1
| | | | | | | Add a menu item to quit and save the current playback position using the code added with commit ce9a854. Fixes #85
* command: auto-insert yadif when switching deinterlacingwm42013-05-231-6/+40
| | | | | | | | | | | | | | | | | | | | | | | 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.
* m_option: allow removing filter entries by content with -vf-delwm42013-05-231-89/+88
| | | | | | | | | | | | | | 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.
* m_option: move code aroundwm42013-05-231-139/+146
| | | | Move the helper functions for parsing -vf, and rename some.
* m_option, vf: add label supportwm42013-05-232-25/+83
| | | | | | | | | | | | | | | | | 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.
* core: support mpv directory itself as a valid location for config files on ↵elevengu2013-05-231-9/+22
| | | | | | | | | | 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.
* mplayer: don't cut status line if --no-consolecontrols is usedwm42013-05-211-1/+4
|
* options: remove dead -dr1 optionwm42013-05-212-3/+0
|
* dec_video: get rid of two global variableswm42013-05-213-3/+6
|
* mplayer: re-add some legacy slave mode output for issue #92wm42013-05-211-5/+15
| | | | | | 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.
* m_option: fix parameter comparison for vf-togglewm42013-05-211-6/+11
| | | | | | 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.
* m_option: fix -vf-del in profileswm42013-05-211-3/+4
| | | | | We don't bother with option verification (as it happens in profiles), because it's barely possible.
* Fix commit d1b37afwm42013-05-181-1/+1
| | | | Yeah, it doesn't work this way... Please look away.
* input: allow quotes around any input commandwm42013-05-181-3/+1
|
* input: do property expansion for all input command string argumentswm42013-05-183-18/+26
| | | | | | 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.
* input: accept input command prefixes in any orderwm42013-05-181-20/+22
| | | | | | | | | | 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.
* core: allow changing filter filters at runtimewm42013-05-185-12/+80
| | | | | | | | | | | | | | | | 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().
* m_option: allow -vf ""wm42013-05-181-5/+3
| | | | | | | 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.)
* m_option: add -vf-togglewm42013-05-181-52/+80
| | | | | | | | 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.
* m_option: allow using -vf-del with a namewm42013-05-181-51/+70
| | | | | | 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.
* video: rename VDCTRL_RESET_ASPECT to VDCTRL_REINIT_VOwm42013-05-181-1/+1
| | | | Same thing, and VDCTRL_REINIT_VO implies more generic use.
* cfg-mplayer: fix some option flagswm42013-05-171-3/+3
|
* options: fix exit code when using help optionswm42013-05-153-16/+22
| | | | Basically a cosmetic change. Fixes github issue #88.
* mplayer: potentially fix main() return valuewm42013-05-151-2/+2
| | | | | | | 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.
* options: add -V as alias for --versionwm42013-05-151-0/+1
| | | | This is a common convention.
* options: use case-sensitive comparsion for optionswm42013-05-152-17/+17
| | | | | This is better for consistency, and also allows using -V as alias for --version.
* options: add --versionwm42013-05-152-0/+11
|
* command: use "title" tag for media-title property if availablewm42013-05-151-3/+6
| | | | | In connection with the previous commit, this will use the Matroska title for the media-title property.
* add osd-scale commandPaul B Mahol2013-05-144-0/+4
| | | | | | | 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.
* command: simplify sub OSD updatewm42013-05-141-8/+8
| | | | | 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.
* m_option: fix segfault in parse_chmapRudolf Polzer2013-05-141-1/+2
|
* core: re-add -dumpstream as --stream-dumpwm42013-05-123-0/+36
| | | | | | | Apparently useful for dumping DVD. Could also be used to rip streams with libquvi and such, but for that there are better tools. Actually I doubt there aren't better tools to dump DVDs, but whatever, this was a feature request, so I don't need a good reason.
* core: add --stream-capturewm42013-05-124-0/+20
| | | | | | This is a partial revert of commit 7059c15, and basically re-adds --capture, just with different option names and slightly different semantics.
* Merge branch 'audio_changes'wm42013-05-127-35/+83
|\ | | | | | | | | Conflicts: audio/out/ao_lavc.c
| * audio: print channel map additionally to channel count on terminalwm42013-05-121-6/+4
| |
| * audio: remove useless audio channels from AO, unless requestedwm42013-05-121-0/+2
| |
| * core: use channel map on demuxer level toowm42013-05-126-17/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This helps passing the channel layout correctly from decoder to audio filter chain. (Because that part "reuses" the demuxer level codec parameters, which is very disgusting.) Note that ffmpeg stuff already passed the channel layout via mp_copy_lav_codec_headers(). So other than easier dealing with the demuxer/decoder parameters mess, there's no real advantage to doing this. Make the --channels option accept a channel map. Since simple numbers map to standard layouts with the given number of channels, this is downwards compatible. Likewise for demux_rawaudio.
| * audio/out: switch to channel mapwm42013-05-121-4/+4
| | | | | | | | | | | | This actually breaks audio for 5/6/8 channels. There's no reordering done yet. The actual reordering will be done inside of af_lavrresample and has to be made part of the format negotiation.
| * audio: add channel map APIwm42013-05-122-0/+46
| | | | | | | | | | | | | | Unused, will be used in the following commits. Let chmap.h define the number of maximum channels, because that is most convenient.
| * options: add option to prevent decoder audio downmixingwm42013-04-134-6/+15
| | | | | | | | Also rename --a52drc to --ad-lavc-ac3drc, and add --ad-lavc-o.
| * options: remove --af-advwm42013-04-131-6/+0
| | | | | | | | | | | | | | Anything this option did has been removed in the preceding 3 commits. Note that even though these options sounded like a good idea (like setting accuracy vs. speed tradeoffs), they were not really properly implemented.
| * audio: switch to libavcodec channel order, use libavresample for mixingwm42013-04-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch the internal channel order to libavcodec's. If the channel number mismatches at some point, use libavresample for up- or downmixing. Remove the old af_pan automatic downmixing. The libavcodec channel order should be equivalent to WAVEFORMATEX order, at least nowadays. reorder_ch.h assumes that WAVEFORMATEX and libavcodec might be different, but all defined channels have the same mappings. Remove the downmixing with af_pan as well as the channel conversion with af_channels from af.c, and prefer af_lavrresample for this. The automatic downmixing behavior should be the same as before (if the --channels option is set to 2, which is the default, the audio output is forced to 2 channels, and libavresample does all downmixing). Note that mpv still can't do channel layouts. It will pick the default channel layout according to the channel count. This will be fixed later by passing down the channel layout as well. af_hrtf depends on the order of the input channels, so reorder to ALSA (for which this code was written). This is better than changing the filter code, which is more risky. ao_pulse can accept waveext order directly, so set that as channel mapping.
| * af: remove automatically inserted filters on full reinitwm42013-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure automatically inserted filters are removed on full reinit (they are re-added later if they are really needed). Automatically inserted filters were never explicitly removed, instead, it was expected that redundant conversion filters detach themselves. This didn't work if there were several chained format conversion filters, e.g. s16le->floatle->s16le, which could result from repeated filter insertion and removal. (format filters detach only if input format and output format are the same.) Further, the dummy filter (which exists only because af.c can't handle an empty filter chain for some reason) could introduce bad conversions due to how the format negotiation works. Change the code so that the dummy filter never takes part on format negotiation. (It would be better to fix format negotiation, but that would be much more complicated and would involving fixing all filters.) Simplify af_reinit() and remove the start audio filter parameter. This means format negotiation and filter initialization is run more often, but should be harmless.
* | cocoa_common: add native OSX fullscreen supportStefano Pigozzi2013-05-122-0/+6
| | | | | | | | | | | | | | | | This adds Mission Control fullscreen functionality to mpv. Since this doesn't play well with many of mpv's features disable it by default. Users can activate this feature by using `--native-fs` when starting mpv. Fixes #34
* | OSX: run native event loop in a separate threadStefano Pigozzi2013-05-121-34/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit is a followup on the previous one and uses a solution I like more since it totally decouples the Cocoa code from mpv's core and tries to emulate a generic Cocoa application's lifecycle as much as possible without fighting the framework. mpv's main is executed in a pthread while the main thread runs the native cocoa event loop. All of the thread safety is mainly accomplished with additional logic in cocoa_common as to not increase complexity on the crossplatform parts of the code.
* | OSX: use native Cocoa's event loopStefano Pigozzi2013-05-122-7/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Schedule mpv's playloop as a high frequency timer inside the main Cocoa event loop. This has the benefit to allow accessing menus as well as resizing the window without the playback being blocked and allows to remove countless hacks from the code that involved manually pumping the event loop as well simulating manually some of the Cocoa default behaviours. A huge improvement consists in removing NSApplicationLoad. This is a C function defined in the Cocoa header and implements a minimal OSX application under ther hood so that you can use the Cocoa GUI toolkit from C/C++ without having to respect the Cocoa standards in terms of application initialization. This was bad because the behaviour implemented by NSApplicationLoad was hard to customize and had several gotchas especially in the menu department. mpv was changed to be just a nib-less application. All the Cocoa part is still generated in code but the event handling is now not dissimilar to what is present in a stock Mac application. As a part of reviewing the initialization process, I also removed all of `osdep/macosx_finder_args`. The useful parts of the code were moved to `osdep/macosx_appication` which has the broaded responsibility of managing the full lifecycle of the Cocoa application. By consequence the `--enable-macosx-finder` configure switch was killed as well, as this feature is always enabled. Another change the users will notice is that when using a bundle the `--quiet` option will be inserted much earlier in the initializaion process. This results in mpv not spamming mpv.log anymore with all the initialization outputs.
* | command: add time-remaining propertywm42013-05-101-0/+14
| |
* | core: refactor seek_chapter() functionwm42013-05-093-40/+47
| | | | | |