summaryrefslogtreecommitdiffstats
path: root/player
Commit message (Collapse)AuthorAgeFilesLines
* audio: replace from_dB functionwm42017-05-051-8/+4
| | | | | | | | The author of the old code disagreed with LGPL. The new code is a clean room reimplementation by Niklas Haas. It lacks the clamping, but we decided it doesn't matter. Untested, bugs can be fixed later anyway.
* ytdl_hook: rework edl joining to use lua tablesRicardo Constantino2017-05-041-5/+7
| | | | Seems much more resource efficient than concatenating a string.
* lua: increase subprocess stdout limit to 64MBRicardo Constantino2017-05-041-1/+1
|
* player: fix potential segfault when playing dvd:// with DVD disabledwm42017-05-011-1/+1
| | | | | | | Tries to access the options, which are obviously not allocated if there is no DVD support compiled. Fixes #4393.
* audio: merge --replaygain-track and --replaygain-album into one optionwm42017-04-271-2/+2
| | | | | This is probably better than separate options. For example, the user does not have to guess which one is applied if both options are enabled.
* audio: fix replaygain volume scalewm42017-04-271-0/+1
| | | | | | | | The new replaygain code accidentally applied the linear gain as cubic volume level. Fix this by moving the computation of the volume scale out of the af_volume filter. (Still haven't verified whether the replaygain code works correctly.)
* audio: move replaygain control to top-level optionswm42017-04-262-4/+53
| | | | | | | | | | | | | | | | | | | | | af_volume is deprecated, and so are its replaygain sub-options. To make it possible to use replaygain without deprecated options (and of course to make it available at all after af_volume is dropped), reintroduce them as top-level options. This also means that they are easily changeable at runtime by using them as properties. Change the "volume" property to use the new update mechanism as well. We don't actually bother sharing the implementation between new and deprecated mechanisms, as the deprecated one will simply be deleted. For the from_dB() functions, we mention anders' copyright, although I'm not sure if a mere formula is copyrightable. This will have to be determined later. This whole change is mostly untested. Our distributed human CI will take care of it.
* player: close audio device on no audio trackMarko Hauptvogel2017-04-251-1/+3
| | | | | | | | | Close the audio device if there is no audio track (or stream) in the current file. It will be opened again if the next file should contain audio. Signed-off-by: Marko Hauptvogel <marko.hauptvogel@googlemail.com> Signed-off-by: wm4 <wm4@nowhere>
* osc: also add processing for axis_up/down eventsRicardo Constantino2017-04-251-4/+6
| | | | | | Considered semantically equivalent with mouse_btn3/4. This is a preemptive fix for upcoming changes to AXIS_* events.
* ytdl_hook: treat single-entry playlists as a single videoRicardo Constantino2017-04-231-1/+9
|
* ytdl_hook: move single video code to a separate functionRicardo Constantino2017-04-231-94/+98
|
* external_files.c: add GPL headerwm42017-04-211-0/+17
| | | | | | It's been missing since mplayer2 times, not sure why. It originates from subreader.c. No analysis on whether it can be relicensed to LGPL was done yet.
* osc: add user_opts.boxmaxchars for box layout title limitAvi Halachmi (:avih)2017-04-191-3/+6
| | | | | The default of 80 is conservative to allow relatively wide fonts, but with many common fonts a bigger number can be used without overflow.
* osc: add volume icons to osd font and use themRicardo Constantino2017-04-191-3/+4
| | | | | Glyphs taken and based on U+1F507 to U+1F50A from Symbola, which is available under public domain: http://users.teilar.gr/~g1951d/
* osc: move volume left of fullscreen buttonRicardo Constantino2017-04-191-16/+17
|
* osc: bottom/topbar: add fullscreen buttonRicardo Constantino2017-04-191-4/+13
|
* osc: add volume buttonRicardo Constantino2017-04-191-3/+41
| | | | | Click to toggle mute, mouse wheel to change volume. OSD is shown on volume change.
* osc: support handling mouse wheel eventsRicardo Constantino2017-04-191-4/+8
|
* osc: simplify checks in key handlerRicardo Constantino2017-04-191-30/+25
| | | | Use a helper function for these safety checks.
* osc: fix last potential race condition on key eventsRicardo Constantino2017-04-191-1/+2
|
* Fix use of ISC licensewm42017-04-151-1/+3
| | | | | | | | | | The license text refers a "above copyright notice", so I guess it'd be good to actually provide such a notice. Add the license to some files that were missing it (since in theory, our Copyright file says that such files are LGPL by default). Remove the questionable remarks about the license in the client API.
* player: fix a corner case in previous commitwm42017-04-143-3/+5
| | | | | | | | | The previous commit set "mpctx->playback_active = false;" before unload hooks were processed. This was intentional, but could in theory cause playback_active to be set to true again, and actually it's plain wrong if playback was exited in the middle it. There needs to be something else that forces playback_active to be set to false while in this unloading state.
* player: fix core-idle and eof-reached update notifcationswm42017-04-145-11/+37
| | | | | | | | Make mpv_observe_property() work correctly on them even with --keep-open-pause=no. This also changes the situations in which the screensaver is enabled/disabled subtly.
* player: unmess pause state handlingwm42017-04-145-65/+53
| | | | | | | | | Merge the pause_player() and unpause_player() functions. Make sure the pause events are emitted properly. We can now set the internal pause state based on a predicate, instead of e.g. handle_pause_on_low_cache() making a mess to trigger the internal pause state as wanted. Preparation for some more changes.
* player: add --keep-open-pause=no optionDan Oscarsson2017-04-141-1/+1
| | | | | | | | | | | Instead of pausing if --keep-open is active, stop at end but continue playing if seeking backwards. And then stop again when end is reached. Signed-off-by: wm4 <wm4@nowhere> Over the PR, the option was renamed, and the manpage additions were slightly changed/enhanced.
* osc: use "loop-playlist" instead of "loop" propertywm42017-04-111-1/+1
|
* command, manpage: some leftover mentions of renamed --loop optionwm42017-04-111-1/+1
|
* command: update sub-fps etc. options on runtime changeswm42017-04-101-11/+7
| | | | | | | | | | | | | Un-special-case the sub-speed property, and apply subtitle speed updates in more cases. In particular, this respects runtime changes of the sub-fps option. (A minor consequence of this is that the subtitle speed is recomputed more often even in cases when it's not necessary. Also, the subtitle update is slightly "delayed" rather than strictly instant. Both of these likely are absolutely not observable by the user, although the subtitle speed verbose log message will be printed more often if the subtitle format is MicroDVD.)
* audio: deprecate most audio filterswm42017-04-041-1/+2
| | | | | Well, ok, only 4 filters. The rest will survive in one or the other form.
* video: deprecate almost all video filterswm42017-04-021-3/+4
| | | | | | | | | | | | | The plan is to nuke the custom filter chain completely. It's not clear what will happen to the still needed builtin filters (mostly hardware deinterlacing and vf_vapoursynth). Most likely we'll replace them with different filter chain concept (whose main purpose will be providing builtin things and bridging to libavfilter). The undocumented "warn" options are there to disable deprecation warnings when the player inserts filter automatically. The same will be done to audio filters, at a later point.
* screenshot: cleanup: use normal MSGL_ defineswm42017-04-011-19/+9
| | | | Remove the weird custom thing.
* player: make screenshot commands honor the async flagwm42017-04-015-29/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | And also change input.conf to make all screenshots async. (Except the every-frame mode, which always uses synchronous mode and ignores the flag.) By default, the "screenshot" command is still asynchronous, because scripts etc. might depend on this behavior. This is only partially async. The code for determining the filename is still always run synchronously. Only encoding the screenshot and writing it to disk is asynchronous. We explicitly document the exact behavior as undefined, so it can be changed any time. Some of this is a bit messy, because I wanted to avoid duplicating the message display code between sync and async mode. In async mode, this is called from a worker thread, which is not safe because showing a message accesses the thread-unsafe OSD code. So the core has to be locked during this, which implies accessing the core and all that. So the code has weird locking calls, and we need to do core destruction in a more "controlled" manner (thus the outstanding_async field). (What I'd really want would be the OSD simply showing log messages instead.) This is pretty untested, so expect bugs. Fixes #4250.
* player: enable "buffering" pausing for DASH streams toowm42017-04-011-1/+2
| | | | | | | | | | This wasn't enabled if no stream cache was used. It can work with only the demuxer cache. In theory this could be always enabled (even for local files), but still try to avoid this, and enable it only if the source is marked as potentially being a "network" stream. The intention is mostly to enable it for the youtube-dl pseudo-DASH support.
* external_files: enable autoloading with URLsRicardo Constantino2017-04-011-3/+4
| | | | Closes #3264
* external_files: actually try to autoload from fallback pathsRicardo Constantino2017-04-011-2/+2
| | | | | | The 'sub' and 'audio' configuration subdirectories are supposed to be fallbacks for sub-paths and audio-file-paths respectively, but they weren't being scanned even if they existed.
* command: add property notifications for hwdec propertieswm42017-03-311-3/+3
| | | | | | | | | | This is a bit approximate, because we rely on the pixel format changing if the hardware decoding changes. This is not always true, as the pixel format for software decoded video and hardware decoded video copied back to CPU RAM could be the same. (Not sure if that is actually the case for any supported cases.) But for now this should fix most of #4289.
* osc: escape ASS and strip newlines on titleRicardo Constantino2017-03-271-0/+2
|
* osc: make title configurable and use property expansion on itRicardo Constantino2017-03-271-6/+4
|
* Revert "osc: make the title toggleable between media-title and filename"Ricardo Constantino2017-03-271-11/+10
| | | | This reverts commit 6573b73462e336da0daca845ba4df02782afc2b6.
* osx: initial Touch Bar supportAkemi2017-03-261-0/+5
|
* command: add expand-text command to property-expand a stringAvi Halachmi (:avih)2017-03-261-0/+10
|
* osc: make the title toggleable between media-title and filenameRicardo Constantino2017-03-261-10/+11
| | | | Close #4221
* player: make new stream output more consistent with other outputwm42017-03-261-3/+3
| | | | It seems we generally skip the space, such as seen on the AO init line.
* player: print additional stream infoDan Oscarsson2017-03-261-1/+13
| | | | | | In print_stream print additional stream info for audio and video track. While it may be incorrect it is mostly correct and good info to have.
* command: add better runtime filter toggling methodwm42017-03-251-1/+4
| | | | | | | | | | Basically, see the example in input.rst. This is better than the "old" vf-toggle method, because it doesn't require the user to duplicate the filter string in mpv.conf and input.conf. Some aspects of this changes are untested, so enjoy your alpha testing.
* command: add demux-start-time propertyMatthias Hunstock2017-03-251-0/+11
| | | | Add a demux_start_time property, update docs.
* osc: fix PlayResX undefined warning when aspect is 0Ricardo Constantino2017-03-241-3/+6
|
* osc: bottom/topbar: don't clip title verticallyRicardo Constantino2017-03-241-2/+2
|
* osc: bottom/topbar: increase timecodes width a bitRicardo Constantino2017-03-241-4/+4
| | | | | | | Compensates for wider fonts like DejaVu Sans Mono. Further compensate for the minus sign in the right timecode by 10px. Closes #3952
* osc: refactor cache status displayRicardo Constantino2017-03-241-11/+18
| | | | This removes the twitch of the right-aligned cache status.
* osc: refactor osc message scalingRicardo Constantino2017-03-241-35/+20
| | | | | | | | | | Will still hide playlist items with long enough filenames and osd-font-size but not as soon. osc messages should now preserve their scaling with fullscreen toggling and cycling through audio-only files and files with video. Closes #4081, #4083, #4102
* command: add a property to signal whether networking is usedwm42017-03-241-0/+12
| | | | | | Requested. The property semantics are a bit muddy due to lack of effort. Anticipated use is different display of cache status, so it should not matter anyway.
* screenshot: change details of --screenshot-format handlingwm42017-03-181-2/+3
| | | | | | | | | | | | | | | | This is just a pointless refactor with the only goal of making image_writer_opts.format a number. The pointless part of it is that instead of using some sort of arbitrary ID (in place of a file extension string), we use a AV_CODEC_ID_. There was also some idea of falling back to the libavcodec MJPEG encoder if mpv was not linked against libjpeg, but this fails. libavcodec insist on having AV_PIX_FMT_YUVJ420P, which we pretend does not exist, and which we always map to AV_PIX_FMT_YUV420P (without the J indicating full range), so encoder init fails. This is pretty dumb, but whatever. The not-caring factor is raised by the fact that we don't know that we should convert to full range, because encoders have no proper way to signal this. (Be reminded that AV_PIX_FMT_YUVJ420P is deprecated.)
* screenshot: minor simplificationwm42017-03-181-7/+4
| | | | | | | | This also will set image=NULL, if the video frame is marked as hwaccel, and could not be copied to normal RAM. This will probably change the error message (due to screenshot_get() returning NULL, instead of making image conversion fail at a later point), but the behavior is the same anyway.
* player: specifically log audio EOF toowm42017-03-141-1/+3
|
* osc: fix window dragging with showwindowed=noAkemi2017-02-271-0/+2
| | | | | | | initialise OSC with a zero mouse area so mp_input_test_dragging returns a proper value. Fixes #1819
* client: call certain external functions outside of client lockwm42017-02-241-2/+3
| | | | | | | | | Fixes theoretical lock-order issues found by Coverity. Calling these inside the log is unnecessary anyway, because they have their own locking, and because mpv_detach_destroy() needs to be called by someone who has exclusive access to the mpv_handle (it's basically a destructor function). The lock order issues comes from the fact that they call back into the client API implementation to broadcast events and such.
* lavfi: temporary workaround for FFmpeg av_buffersrc_parameters_set() bugwm42017-02-221-0/+9
| | | | | The function ignores AVBufferSrcParameters.channel_layout. Set it manually using the API.
* player: don't block playback stop when seekingwm42017-02-211-3/+0
| | | | | | This was added for A-B loops, but it looks like commit a1dec6f5 made this code unnecessary. Remove it, because it has the annoying side-effect of blocking playback stop when seeking past the end.
* player: fix stats-logging of sleep statewm42017-02-211-2/+3
|
* player: remove unnecessary wakeupwm42017-02-211-1/+0
| | | | I can't find any actual need for it.
* player: reduce blocking on VO when switching pausewm42017-02-211-2/+2
| | | | | | | | | | | | | | | | | | | When pausing, we sent BOCTRL_PAUSE and VOCTRL_RESTORE_SCREENSAVER. These essentially wait until the video frame has been rendered. This is a problem with the opengl-cb, if GL rendering is done in the same thread as libmpv uses. Unfortunately, it's allowed to use opengl-cb this way. Logically speaking, it's a deadlock situation, which is resolved with a timeout. This can lead to quite ugly effects, like the on-pause frame not being rendered until the timeout has passed. It has been interpreted as video continuing to play. Resolve this by simply not blocking on pause. Make the screensaver controls async, and handle sending VOCTRL_PAUSE in the VO thread. (All this could be avoided by redoing the internal VO API.) Also see #4152.
* command: add a redundant NULL checkwm42017-02-201-1/+1
| | | | | | | | | Currently, tracks have always associated streams, so there can't be a NULL dereference on the next line. But all the code is written with the possibility in mind that we might want tracks without streams, so make it consistent. Found by coverity.
* command: fix wrong sizeof() argumentwm42017-02-201-1/+1
| | | | | | | Found by coverity. All of these cases happened to work, probably even in 32 bit (when the name pointer allowed it to use only 4 bytes of space).
* lavfi: support hwdec filters for --lavfi-complexwm42017-02-203-0/+22
| | | | | | Not so important by itself, but important for when we replace the vf libavfilter wrapper with the common implementation. (Which will hopefully happen, but not too soon.)
* lavfi: use AVBufferSrcParameterswm42017-02-201-23/+34
| | | | | It's nice that you don't have to create a parameter string anymore, but the rest sure is complicated as hell.
* lavfi: use mp_image to store the filter pad formatwm42017-02-201-16/+19
| | | | | | | | | | Preparation for enabling hw filters. mp_image_params can't have an AVHWFramesContext reference (because it can't hold any allocations, and isn't meant to hold "active" data in the first place. So just use a mp_image. It has all real data removed, because that would essentially leak 1 frame once the decoder or renderer don't need it anymore.
* lavfi: fix minor memory leakwm42017-02-131-9/+11
| | | | | | | | | | | The AVFrame in the tmp_frame field was never actually deallocated. Since this AVFrame holds data temporarily only, and is unreferenced immediately after use, there is actually no need to make it per-pad, so simplify it a bit. (There's also no real value in caching this tmp_frame at all, but I guess it makes the control flow slightly simpler.)
* atomic: remove __atomic builtin usagewm42017-02-131-1/+1
| | | | | | | | Using these was a temporary solution while some compilers implemented the underlying atomic mechanisms, but not the C11 language parts (or that's what I guess). Not really useful for us anymore. Also, there is the slight risk of having subtly incorrect semantics by using potentially changing compiler internals and such.
* ytdl_hook: support livestream segmented DASH VODsRicardo Constantino