summaryrefslogtreecommitdiffstats
path: root/core
Commit message (Collapse)AuthorAgeFilesLines
* 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
| | | | | | | | | | | | | | | | | | | | Makes it easier to understand... maybe. It's still pretty strange how this function may either queue the seek or seek immediately. The way it actually works doesn't change, queuing the seek is just moved into the function. Also add a execute_queued_seek() function, which resets the queue state correctly.
* | command: fix DVD angle cyclingwm42013-05-091-2/+12
| | | | | | | | It didn't wrap around when switching while the last angle is active.
* | demux: remove retrieval of chapter end timewm42013-05-061-1/+1
| | | | | | | | | | | | | | The frontend doesn't use this. Also use double for returning the chapter times. Everything uses double for times, and there's no reason to use float here.
* | Fix some cppcheck / scan-build warningswm42013-05-061-1/+1
| | | | | | | | | | | | | | | | These were found by the cppcheck and scan-build static analyzers. Most of these aren't interesting (the 2 previous commits fix some interesting cases found by these analyzers), and they don't nearly fix all warnings. (Most of the unfixed warnings are spam, things MPlayer never cared about, or false positives.)
* | core: add playback resume feature (manual/opt-in)wm42013-05-0510-1/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A "watch later" command is now mapped to Shift+Q. This quits the player and stores the playback state in a config file in ~/.mpv/watch_later/. When calling the player with the same file again, playback is resumed at that time position. It's also possible to make mpv save playback state always on quit with the --save-position-on-quit option. Likewise, resuming can be disabled with the --no-resume-playback option. This also attempts to save some playback parameters, like fullscreen state or track selection. This will unconditionally override config settings and command line options (which is probably not what you would expect, but in general nobody will really care about this). Some things are not backed up, because that would cause various problems. Additional subtitle files, video filters, etc. are not stored because that would be too hard and fragile. Volume/mute state are not stored because it would mess up if the system mixer is used, or if the system mixer was readjusted in the meantime. Basically, the tradeoff between perfect state restoration and complexity/fragility makes it not worth to attempt to implement it perfectly, even if the result is a little bit inconsistent.
* | command: alias video/audio/sub properties to -vid/-aid/-sidwm42013-05-051-9/+26
| | | | | | | | | | | | | | | | | | Now vid/aid/sid can be used as properties. video/audio/sub still work, but they are aliases for the "real" properties. This guarantees that options/properties use the same value range. One consequence is that the video/audio/sub properties return "no" as value if no track is selected instead of -1.
* | mplayer: factor config dir creationwm42013-05-051-18/+23
| | | | | | | | Move it into its own function.
* | core: ignore backstep command if demuxer is not capablewm42013-05-051-4/+7
| | | | | | | | | | | | Also, mark demuxer as not capable if DVD playback is done. The problem with DVD is that playback time (stream_pts) is not reported frame-exact, and the time is a "guess" at best.
* | options: correctly handle things like: dvd://1-2/filenamewm42013-05-051-7/+9
| | | | | | | | | | The "/filename" part was silently dropped when a range of titles is specified.
* | core: move demuxer time reporting to demuxerwm42013-05-051-8/+4
| |
* | video: add --hwdec-codecs option to whitelist codecs for hw decodingwm42013-05-043-0/+4
| |
* | video: support YCgCo colorspacewm42013-05-041-1/+2
| | | | | | | | | | | | | | YCgCo can be manually selected, but will also be used if the decoder reports YCgCo. To make things more fun, files are sometimes marked incorrectly, which will display such broken files incorrectly starting with this commit.
* | stream_bluray: remove the broken -bluray-chapter optionreimar2013-04-271-1/+0
| | | | | | | | | | | | | | | | | | | | Remove the broken -bluray-chapter option. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@36175 b3059339-0415-0410-9bf9-f77b7e298cf2 Conflicts: DOCS/man/en/mplayer.1 cfg-common.h
* | mplayer: put space before encoding part of status linewm42013-04-271-1/+1
| | | | | | | | Also, the trailing space isn't needed.
* | options: allow using [ ] for quoting in sub-optionswm42013-04-261-1/+8
| | | | | | | | | | | | This is an attempt to make quoting of sub-option values less awkward, even if it works only with some shells. This is needed mainly for vf_lavfi. Also update the vf_lavfi manpage section.
* | core: simplify handling of --pausewm42013-04-255-31/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | Rename the struct MPOpts "start_pause" field to "pause". Store the user- pause state in that field, so that both runtime pause toggling and the --pause switch change the same variable. Simplify the initialization of pause so that using --pause and changing the file while paused is exactly the same case (changing the file while paused doesn't unpause, this has been always this way). Also make it a bit more consistent. Before, starting with --pause would reset the pause state for every file, instead of following the usual semantics for option switches (compare with behavior of --fs).
* | core: don't let cache pause handling and user pausing conflictwm42013-04-253-10/+25
| | | | | | | | | | | | | | | | | | | | | | | | The core pauses and unpauses automatically to wait for the network cache (also known as buffering). This conflicted with user pause control, and was perceived as if the player was unresponsive and/or the cache just overturned the user's decisions. Change it so that the actual pause state and the pause state as intended by the user never conflict. If the user toggles pause, the pause state will be in the expected state as soon as the cache is loaded.
* | core: fix bogus condition that broke backstepping with last commitwm42013-04-251-1/+1
| | | | | | | | | | This broke all cases where indexing was required, and the current frame wasn't the first frame in a segment.
* | core: fix backstepping with ordered chapterswm42013-04-251-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were two problems. First, frames past the end of the current segment were added to the index, which messed up backstepping. Check for the endpts before added a frame to the index. Second, it wasn't possible to step over segments which change the file. Changing a file causes decoder reinitialization, which (rightfully) is treated as discontinuity (and vo_pts_history_seek_ts was changed). Add some extra code to pretend that a segment-switching seek/reinit does not introduce discontinuities. There's still a weird corner case: sometimes, you can frame step forward on the last frame of a segment without reaching the next segment immediately. This is because the playloop switches into audio-only mode. The segment is switched when both audio and video have ended, so the frame stepping will play random sized chunks of audio until the segment will be switched. This gives the impression that backstepping doesn't work perfectly, even though it's the other way around and frame stepping behaves weird. This is a consequence of wanting to make frame stepping work with audio, and is not really a bug.
* | core: add backstep supportwm42013-04-245-8/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allows stepping back one frame via the frame_back_step inout command, bound to "," by default. This uses the precise seeking facility, and a perfect frame index built on the fly. The index is built during playback and precise seeking, and contains (as of this commit) the last 100 displayed or skipped frames. This index is used to find the PTS of the previous frame, which is then used as target for a precise seek. If no PTS is found, the core attempts to do a seek before the current frame, and skip decoded frames until the current frame is reached; this will create a sufficient index and the normal backstep algorithm can be applied. This can be rather slow. The worst case for backstepping is about the same as the worst case for precise seeking if the previous frame can be deduced from the index. If not, the worst case will be twice as slow. There's also some minor danger that the index is incorrect in case framedropping is involved. For framedropping due to --framedrop, this problem is ignored (use of --framedrop is discouraged anyway). For framedropping during precise seeking (done to make it faster), we try to not add frames to the index that are produced when this can happen. I'm not sure how well that works (or if the logic is sane), and it's sure to break with some video filters. In the worst case, backstepping might silently skip frames if you backstep after a user-initiated precise seek. (Precise seeks to do indexing are not affected.) Likewise, video filters that somehow change timing of frames and do not do this in a deterministic way (i.e. if you seek to a position, frames with different timings are produced than when the position is reached during normal playback) will make backstepping silently jump to the wrong frame. Enabling/disabling filters during playback (like for example deinterlacing) will have similar bad effects.
* | mplayer: apply hrseek framedrop only when doing hrseekwm42013-04-241-2/+2
| | | | | | | | | | | | | | | | | | | | It's not sure if there's anything that could trigger this accidentally. Normally this can't happen, because hrseek ends always if the PTS is large enough, the same condition which disables framedrop. Seeking resets hrseek framedrop anyway. On the other hand, this change makes the code easier to understand, and might be more robust against weird corner cases.
* | x11: use mpv internal key auto-repeat handling if possiblewm42013-04-242-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Block X11's native key repeat, and use mpv's key repeat handling in input.c instead. No configure check for XKB. Even though it's an extension, it has been part of most (all?) xlibs since 1996. If XKB appears to be missing, just refuse enabling x11. This is a potentially controversial change. mpv will use its own key repeat rate, instead of X11's. This should be better, because seeking will have a standardized "speed" (seek events per seconds when keeping a seek key held down). It will also allow disabling key repears for certain commands, though this is not done anywhere yet. The new behavior can be disabled with the --native-keyrepeat option.
* | input: don't reset time on each key repeatwm42013-04-241-2/+4
| | | | | | | | | | | | Key repeats were skipped when playloop iterations took too long. Fix this by using the total times for key repeat calculation, instead of the time difference to the last key repeat event.
* | input: adjust wait time for key-repeatwm42013-04-241-0/+4
| | | | | | | | | | Basically, these are additional timers that can expire without making the central select() exit.
* | input: change default auto-repeat settingswm4