summaryrefslogtreecommitdiffstats
path: root/player
Commit message (Collapse)AuthorAgeFilesLines
* player: fix previous commitwm42016-06-121-0/+3
| | | | | | | Of course we can't just skip updating the OSD if the playloop was woken up for the purpose of removing OSD after an OSD timer expired. Fixes e.g. OSD bars sometimes sticking along when seeking while paused.
* player: do not update OSD all the time when pausedwm42016-06-113-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Normally, OSD is updated every time the playloop is run. This has to be done, because the OSD may implicitly reference various properties, without knowing whether they really need to be updated or not. (There's a property update mechanism, but it's mostly unavailable, because OSD is special-cased and can not use the client API mechanism properly.) Normally, these updates are no problem, because the OSD is only actually printed when the OSD text actually changes. But commit d23ffd24 added a rate-limiting mechanism, which tries to limit OSD updates at most every 50ms (or the next video frame). Since it can't know in advance whether the OSD is going to change or not, this simply waked up the player every 50ms. Change this so that the player is updated only as part of general updates determined through mp_notify(). (This function also notifies the client API of changed properties.) The desired result is that the player will not wake up at all in normal idle mode, but still update properties that can change when paused, such as the cache. This is mostly a cosmetic change (in the sense of making runtime behavior just slightly better). It has the slightly more negative consequence that properties which update implicitly (such as "clock") will not update periodically anymore.
* vo_opengl: refactor performance data propertiesNiklas Haas2016-06-081-43/+34
| | | | | | | | | | | | | | | Instead of having 9 different properties, requiring 18 different VOCTRLs to read them all, they are now exposed as a single property. This is not only cleaner (since they're all together) but also allows querying all 9 of them with only a single VOCTRL (by using mp.get_property_native). (The extra factor of 2 was due to an extra query being needed to get the type, which is now also unnecessary) This makes it much easier to access performance metrics from within a lua script, and also makes it easier to just show a readable, formatted version via show-text.
* player: remove unused return valuewm42016-06-081-6/+3
|
* player: tell user about --force-seeking if demuxer is not seekablewm42016-06-081-1/+2
| | | | | | | | | | | | | This comes up often, see e.g. #3220. The issue is that if the stream input is not seekable, the demuxer is marked as not seekable. But if the stream cache is enabled, the file still _might_ be seekable to a degree. We recently disabled seeking in this mode because it can cause very weird issues, mostly because if stream-layer seeking fails, the demuxers will arbitrarily misbehave. On the other hand, it can work if the seek is within the cached range, which is why the user can still enable it with --force-seeking. There is a weird trade-off between allowing this and not crapping up too easily, so just informing the user about the possibility seems best.
* build: silence -Wunused-resultNiklas Haas2016-06-072-3/+3
| | | | | | | | For clang, it's enough to just put (void) around usages we are intentionally ignoring the result of. Since GCC does not seem to want to respect this decision, we are forced to disable the warning globally.
* vo_opengl: expose performance timers as propertiesNiklas Haas2016-06-071-0/+43
| | | | | | | | | | | This is plumbed through a new VOCTRL, VOCTRL_PERFORMANCE_DATA, and exposed as properties render-time-last, render-time-avg etc. All of these numbers are in microseconds, which gives a good precision range when just outputting them via show-text. (Lua scripts can obviously still do their own formatting etc.) Signed-off-by: wm4 <wm4@nowhere>
* ytdl: fix brightcove urlsRicardo Constantino2016-05-301-3/+5
|
* video: remove d3d11 video processor use from OpenGL interopwm42016-05-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now have a video filter that uses the d3d11 video processor, so it makes no sense to have one in the VO interop code. The VO uses it for formats not directly supported by ANGLE (so the video data is converted to a RGB texture, which ANGLE can take in). Change this so that the video filter is automatically inserted if needed. Move the code that maps RGB surfaces to its own inteorp backend. Add a bunch of new image formats, which are used to enforce the new constraints, and to automatically insert the filter only when needed. The added vf mechanism to auto-insert the d3d11vpp filter is very dumb and primitive, and will work only for this specific purpose. The format negotiation mechanism in the filter chain is generally not very pretty, and mostly broken as well. (libavfilter has a different mechanism, and these mechanisms don't match well, so vf_lavfi uses some sort of hack. It only works because hwaccel and non-hwaccel formats are strictly separated.) The RGB interop is now only used with older ANGLE versions. The only reason I'm keeping it is because it's relatively isolated (uses only existing mechanisms and adds no new concepts), and because I want to be able to compare the behavior of the old code with the new one for testing. It will be removed eventually. If ANGLE has NV12 interop, P010 is now handled by converting to NV12 with the video processor, instead of converting it to RGB and using the old mechanism to import that as a texture.
* vf_d3d11vpp: add a D3D11 video processor filterwm42016-05-281-0/+3
| | | | | | | | | | | | | | | | | Main use: deinterlacing. I'm not sure how to select the deinterlacing mode at all. You can enumate the available video processors, but at least on Intel, all of them either signal support for all deinterlacers, or none (the latter is apparently used for IVTC). I haven't found anything that actually tells the processor _which_ algorithm to use. Another strange detail is how to select top/bottom fields and field dominance. At least I'm getting quite similar results to vavpp on Linux, so I'm content with it for now. Future plans include removing the D3D11 video processor use from the ANGLE interop code.
* command: add playlist-pos-1 propertywm42016-05-261-6/+20
| | | | | | | | | | This has often been requested for use on OSD. I don't really like having such "special" properties, but whatever. Hopefully this will be the only case. Untested because I'm too damn lazy. Fixes #2828.
* ytdl_hook: support multi-arc subtitlesRicardo Constantino2016-05-231-1/+20
| | | | While at it, pass durations of segments from ytdl if available.
* ta: remove old and redundant macrowm42016-05-171-1/+1
|
* lua: add timer:is_enabled() functionJulian2016-05-141-0/+4
| | | | | Allows to query if some timer is currently running or was stopped/killed.
* ytdl_hook: Just check if protocol is rtmpRicardo Constantino2016-05-141-1/+1
| | | | Partial fix to #3090
* video: add --hwdec=auto-copy modewm42016-05-111-2/+0
| | | | | | | | This uses the normal autoprobing rules like "auto", but rejects anything that isn't flagged as copying data back to system memory. The chunk in command.c was dead code, so remove it instead of updating it.
* player: restore usual seeking behaviorwm42016-05-091-16/+31
| | | | | | | | | | | | | | | | | | | | | | Commit 786f37ae accidentally changed seeking behavior such that continuous seeking (holding the seek button down) would use the previous seek target timestamp, instead of the new video timestamp. (This is for the default mode, seeking to keyframes.) The result is that the movement on the seekbar is smooth, but the way the video updates is awkward. Some might actually prefer the new behavior (and some players effectively show similar bahavior), but I don't. So restore the old behavior. This is done in two steps: First: strictly wait for the entire seek process to finish, which will effectively make the seeking code pick up the new video timestamp correctly. This would play audio immediately, which would result in noise during continuous seeking, which leads to second: explicitly abort the playback restarting process if this case is detected, and never play audio.
* video: refactor how VO exports hwdec device handleswm42016-05-094-13/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | The main change is with video/hwdec.h. mp_hwdec_info is made opaque (and renamed to mp_hwdec_devices). Its accessors are mainly thread-safe (or documented where not), which makes the whole thing saner and cleaner. In particular, thread-safety rules become less subtle and more obvious. The new internal API makes it easier to support multiple OpenGL interop backends. (Although this is not done yet, and it's not clear whether it ever will.) This also removes all the API-specific fields from mp_hwdec_ctx and replaces them with a "ctx" field. For d3d in particular, we drop the mp_d3d_ctx struct completely, and pass the interfaces directly. Remove the emulation checks from vaapi.c and vdpau.c; they are pointless, and the checks that matter are done on the VO layer. The d3d hardware decoders might slightly change behavior: dxva2-copy will not use the VO device anymore if the VO supports proper interop. This pretty much assumes that any in such cases the VO will not use any form of exclusive mode, which makes using the VO device in copy mode unnecessary. This is a big refactor. Some things may be untested and could be broken.
* win32: make taskbar progress indication optionalmaniak13492016-05-082-4/+31
| | | | | | | | | | | Add --taskbar-progress command line option and property which controls taskbar progress indication rendering in Windows 7+. This option is on by default and can be toggled during playback. This option does not affect the creation process of ITaskbarList3. When the option is turned off the progress bar is just hidden with TBPF_NOPROGRESS. Closes #2535
* command: use NBSP for spacing after current marker for OSD listswm42016-05-041-2/+2
| | | | | Requested. Will prevent odd layout for playlists with URLs longer than the screen.
* command: change some hwdec propertieswm42016-05-041-0/+47
| | | | | | | | Introduce hwdec-current and hwdec-interop properties. Deprecate hwdec-detected, which never made a lot of sense, and which is replaced by the new properties. hwdec-active also becomes useless, as hwdec-current is a superset, so it's deprecated too (for now).
* command: slightly nicer OSD list formattingwm42016-05-031-19/+17
| | | | | | | | | For "current" markers on OSD properties like chapter-list. The marker is now an actual arrow instead of "> ", and non-current entries will have the same indentation as the current entry. While I'm not entirely sure about the new look of those lists, it's a bit better than the visual mess that was before.
* osd: make osd_ass_0/1 defineswm42016-05-031-2/+2
| | | | So we can concatenate them with strings at compile time.
* command: don't seek immediately when setting a-b loop when pausedwm42016-04-281-5/+5
| | | | | | | | | | Because it's annoying and feels unnatural. If the B point is set while paused, don't seek. If not paused, it should properly loop immediately. In theory there's a chance that it will show at least 1 frame after the loop point when setting the B point. But let's not care about that.
* player: strictly wait until done when backsteppingwm42016-04-271-1/+1
| | | | | | | | | | | This fixes backstepping getting "stuck" when e.g. holding down a key bound to the backstep command. The reason is that even if the backstep itself is finished, the next backstep might not take the new video PTS as reference if the hr-seek itself isn't finished yet. The intention of not waiting for the hr-seek to finish was faster backstepping by possibly skipping audio decoding. But it probably doesn't matter enough to make the rest of the code more complex.
* lavfi: shut up false positive compiler warningswm42016-04-261-2/+8
| | | | | | | As a positive side-effect, this also errors out gracefully for the extremely unlikely but possible case certain builtin filters are not available. (This could happen only with crippled libavfilter builds that can't be used by anything using its public API.)
* player: fix memleak when using video-frame-infotrUSTssc2016-04-241-0/+1
|
* player: always show the first frame in DS modewm42016-04-241-0/+4
| | | | Fixes bogus frame drop counter in cover art mode.
* player: assume video forwards timestamps jumps only with some formatswm42016-04-241-1/+1
| | | | | | | | | Another crappy fix for timestamp reset issues. This time, we try to fix files which have very weird but legitimate frame durations, such as cdgraphics. It can have many short frames, but once in a while there are potentially very long frames. Fixes #3027.
* player: force VO reconfig when unselecting video trackwm42016-04-231-1/+1
| | | | | Switches to a black window if --force-window is used while coverart "video" is playing.
* player: cleaner determination of current playback PTSwm42016-04-232-9/+11
| | | | | In particular, this won't overwrite the playback PTS in coverart mode, which actually fixes relative seeks.
* player: eagerly redraw OSD when seeking with coverartwm42016-04-231-1/+2
|
* player: fix OSD bar chapter markswm42016-04-221-1/+1
| | | | Truly dumb bug introduced with the previous commit.
* command: if only ab-loop-b is set, loop from start of filewm42016-04-212-8/+13
| | | | | | | | | | Commit 382bafcb changed the behavior for ab-loop-a. This commit changes ab-loop-b so that the behavior is symmetric. Adjust the OSD rendering accordingly to the two changes. Also fix mentions of the "ab_loop" command to the now preferred "ab-loop".
* player: force wakeup on playback restartwm42016-04-201-0/+1
| | | | Just a theoretical issue, most likely.
* player: really start audio only once video is readywm42016-04-201-5/+10
| | | | | | | | | | | | | | | The check whether video is ready yet was done only in STATUS_FILLING. But it also switched to STATUS_READY, which means the next time fill_audio_out_buffers() was called, audio would actually be started before video. In most situations, this bug didn't show up, because it was only triggered if the demuxer didn't provide video packets quickly enough, but did for audio packets. Also log when audio is started. (I hate fill_audio_out_buffers(), why did I write it?)
* player: reduce some timer callswm42016-04-201-4/+5
|
* player: minor simplification to buffering property updateswm42016-04-201-9/+4
| | | | | | | | | | Strictly schedule an update in regular intervals as long as either stream cache or demuxer are prefetching. Don't update just always because the stream cache is enabled ("idle != -1") or cache-related properties are observed (mp_client_event_is_registered()). Also, the "idle" variable was awkard; get rid of it with equivalent code.
* player: simplify an aspect of buffering determinationwm42016-04-194-18/+35
| | | | | | | | | | | | | | | Calculate the buffering percentage in the same code which determines whether the player is or should be buffering. In particular it can't happen that percentage and buffering state are slightly out of sync due to calling DEMUXER_CTRL_GET_READER_STATE and reusing it with the previously determined buffering state. Now it's also easier to guarantee that the buffering state is updated properly. Add some more verbose output as well. (Damn I hate this code, why did I write it?)
* player: loop on end of file if ab-loop-b is unsetwm42016-04-182-5/+9
| | | | Possibly slightly more useful/intuitive.
* command: log property set callswm42016-04-152-8/+17
| | | | | | | And remove the same thing from the client API code. The command.c code has to deal with many specialized M_PROPERTY_SET_* actions, and we bother with a subset only.
* command: allow setting panscan etc. properties if no video is activewm42016-04-151-4/+1
| | | | In that case, it merely changes the underlying option value.
* client API: improve mpv_set_property() handling of MPV_FORMAT_NODEwm42016-04-151-34/+18
| | | | | | | | | If a mpv_node wrapped a string, the behavior was different from calling mpv_set_property() with MPV_FORMAT_STRING directly. Change this. The original intention was to be strict about types if MPV_FORMAT_NODE is used. But I think the result was less than ideal, and the same change towards less strict behavior was made to mpv_set_option() ages ago.
* player: fix use-after-free with --screenshot-directorywm42016-04-141-1/+2
| | | | Probably fixes #3049.
* command: add keepaspect propertywm42016-04-081-0/+1
| | | | | | Just a bridge to the option. (Did I ever mention that I hate the property/option separation.)
* player: hide cache in status line by default againwm42016-03-301-1/+1
| | | | | | Commit 57506b27 accidentally broke this. The status (including the usually always active demuxer cache) should be shown only if the stream cache is actually enabled.
* cache: use a single STREAM_CTRL for various cache infowm42016-03-294-46/+38
| | | | | | | | Instead of having a separate for each, which also requires separate additional caching in the demuxer. (The demuxer adds an indirection, since STREAM_CTRLs are not thread-safe.) Since this includes the cache speed, this should fix #3003.
* command: add video-stereo-mode propertywm42016-03-281-0/+1
| | | | | | Enables runtime change of the option. Fixes #2994.
* player: fix breakage when combining 3D and rotate auto-filterswm42016-03-281-9/+5
| | | | | | | | | | | This would get stuck in reconfiguring the filter chain forever, because params was mutated ("params.rotate = 0;"). This was used as input for vf_reconfig(), but the filter chain input must always be equivalent to the decoder output, or filter chain reconfiguration will be triggered. The line of code to reset the rotation is from a time when this used to work differently. Also remove the unnecessary try_filter() parameter.
* player: remove auto-inserted filters before adding them againwm42016-03-281-1/+11
| | | | | | | Makes certain cases of runtime changes actually work. Also change the label for the stereo3d filter and make it consistent with the rotate one.
* player: fix --stream-dump exit codewm42016-03-261-1/+1
| | | | | Inverted condition due to weird semantics after a refactor some time ago. Fixes #2848.
* player: add wv to list of external audio file extensionsMartin Herkt2016-03-261-0/+1
|
* lua: don't require key for mp.add_key_binding()wm42016-03-261-3/+4
| | | | | Requested. The intention is that scripts can provide mappable actions for key bindings without setting a default key.
* ipc: add Windows implementation with named pipesJames Ross-Gowan2016-03-231-2/+0
| | | | | | | | | | | | | | | This implements the JSON IPC protocol with named pipes, which are probably the closest Windows equivalent to Unix domain sockets in terms of functionality. Like with Unix sockets, this will allow mpv to listen for IPC connections and handle multiple IPC clients at once. A few cross platform libraries and frameworks (Qt, node.js) use named pipes for IPC on Windows and Unix sockets on Linux and Unix, so hopefully this will ease the creation of portable JSON IPC clients. Unlike the Unix implementation, this doesn't share code with --input-file, meaning --input-file on Windows won't understand JSON commands (yet.) Sharing code and removing the separate implementation in pipe-win32.c is definitely a possible future improvement.
* command: change "cache-speed" OSD formattingwm42016-03-221-4/+9
| | | | | Also change the property to an int, since using double is questionable and pointless.
* command: add cache-speed propertywm42016-03-201-1/+17
| | | | | | | Should reflect I/O speed. This could go into the terminal status line. But I'm not sure how to put it there, since it already uses too much space, so it's not there yet.
* lua: don't suspend core by default during script executionwm42016-03-181-1/+1
| | | | | | | | | This changes behavior somewhat. The old behavior can be restored by running "mp.use_suspend=true". It was originally introduced for the OSC, but I can't reproduce whatever misbehavior I was seeing. (See mp.suspend()/resume() for explanations what the suspend mechanism does.)
* command: dump tracklist if sub-add is run with the "cached" flagwm42016-03-141-0/+2
| | | | | mp_switch_track() doesn't do it automatically for whatever reason, so do it here.
* player: add missing audio reconfig eventswm42016-03-131-0/+4
| | | | | | | This also takes care of sending the required property change notifications. Fixes #2929 and maybe fixes #2920.
* ytdl_hook: handle optional format_note▟ ▖▟ ▖2016-03-101-1/+1
| | | | | some extractors don't return a format_note for their audio stream which resulted in commandv complaining "argument 4 is not a string" (got nil).
*