summaryrefslogtreecommitdiffstats
path: root/player
Commit message (Collapse)AuthorAgeFilesLines
* audio: rename i_bps to 'bitrate' to avoid confusionMarcoen Hirschberg2014-05-281-4/+4
| | | | Since i_bps now contains bits/sec, rename it to reflect this change.
* audio: change values from bytes-per-second to bits-per-secondMarcoen Hirschberg2014-05-281-1/+1
| | | | | | | The i_bps members of the sh_audio and dev_video structs are mostly used for displaying the average audio and video bitrates. Keeping them in bits-per-second avoids truncating them to bytes-per-second and changing them back lateron.
* osc: correct calculation of slider positionChrisK22014-05-281-1/+1
| | | | | calculation the mouse position on the slider relied on how the hitbox is positioned, change it according to new hitbox size.
* osc: extend hitbox of seekbars to include gapChrisK22014-05-271-1/+1
| | | | | | should make usage a bit easy Fixes #810
* lua: slightly nicer diagnostics outputwm42014-05-271-1/+3
| | | | | | | | | | | | | When Lua itself prints errors such as: Error: [string "mp.defaults"]:387: syntax error near 'function' It's unclear why the location is prefixed with "string ". And for some reason, it disappears if you prefix the name with '@'. I suppose this is done for the sake of luaL_loadstring. With the '@' prefix added, the output is now: Error: mp.defaults:387: syntax error near 'function'
* lua: add missing include fileswm42014-05-261-0/+2
| | | | | | These are actually already included in osdep/io.h, but I think it's cleaner to repeat them in the file where they are actually needed. (osdep/io.h needs to have them for other reasons.)
* lua: fix compilation with lua 5.2wm42014-05-261-8/+42
| | | | | | | | | | | Commit e2e450f9 started making use of luaL_register(), but OF COURSE this function disappeared in Lua 5.2, and was replaced with a 5.2-only alternative, slightly different mechanism. So just NIH our own function. This is actually slightly more correct, since it forces the user to call "require" to actually make the module visible for builtin C-only modules other than "mp". Fix autoload.lua accordingly.
* command: add write_watch_later_config commandMartin2014-05-261-0/+5
| | | | | | Closes #808. Signed-off-by: wm4 <wm4@nowhere>
* lua: add some filesystem utility functionswm42014-05-251-10/+72
| | | | | | | | | | | We need this only because Lua's stdlib is so scarce. Lua doesn't intend to include a complete stdlib - they confine themselves to standard C, both for portability reasons and to keep the code minimal. But standard C does not provide much either. It would be possible to use Lua POSIX wrapper libraries, but that would be a messy (and unobvious) dependency. It's better to implement the missing functions ourselves, as long as they're small in number.
* osc: fix chapter list displayChrisK22014-05-241-2/+2
| | | | also fix small typo in DOCS
* client API: fix mpv_observe_property with MP_FORMAT_NONEwm42014-05-241-2/+3
| | | | | It returned only 1 change event (after registration), and then went silent. This was accidentally broken some time ago.
* stream: don't use end_poswm42014-05-243-13/+13
| | | | | | | | | | | | | | | | | | | Stop using it in most places, and prefer STREAM_CTRL_GET_SIZE. The advantage is that always the correct size will be used. There can be no doubt anymore whether the end_pos value is outdated (as it happens often with files that are being downloaded). Some streams still use end_pos. They don't change size, and it's easier to emulate STREAM_CTRL_GET_SIZE using end_pos, instead of adding a STREAM_CTRL_GET_SIZE implementation to these streams. Make sure int64_t is always used for STREAM_CTRL_GET_SIZE (it was uint64_t before). Remove the seek flags mess, and replace them with a seekable flag. Every stream must set it consistently now, and an assertion in stream.c checks this. Don't distinguish between streams that can only be forward or backwards seeked, since we have no such stream types.
* stream: kill start_pos, remove --sb optionwm42014-05-245-24/+6
| | | | | | | | | | | | | | | | | | | | stream.start_pos was needed for optical media only, and (apparently) not for very good reasons. Just get rid of it. For stream_dvd, we don't need to do anything. Byte seeking was already removed from it earlier. For stream_cdda and stream_vcd, emulate the start_pos by offsetting the stream pos as seen by the rest of mpv. The bits in discnav.c and loadfile.c were for dealing with the code seeking back to the start in demux.c. Handle this differently by assuming the demuxer is always initialized with the stream at start position, and instead seek back if initializing the demuxer fails. Remove the --sb option, which worked by modifying stream.start_pos. If someone really wants this option, it could be added back by creating a "slice" stream (actually ffmpeg already has such a thing).
* player: don't init/uninit terminal at runtimewm42014-05-241-7/+1
| | | | This seems like an unnecessary complication.
* lua/osc: forgot some changed files in previous commitChrisK22014-05-233-97/+20
|
* lua/osc: small overhaulChrisK22014-05-231-0/+105
| | | | | | | | | Small fixes for the OSC, seektooltip now enabled by default. Option-parser now moved to separate package, can be used from other scripts, see DOCS/man/en/lua.rst. OSC config file location moved to lua-settings/osc.conf
* player: give quit_watch_later an exit code argument like quitwm42014-05-221-6/+3
| | | | | | | | The quit command has an optional argument that is used as exit code. Extend that to the quit_watch_later command. Actually, unify the implementations of the two commands. Requested in #798.
* tl_mpv_edl: correct misspelling on line 233Yomi02014-05-221-1/+1
| | | | | | Closes #783 Signed-off-by: wm4 <wm4@nowhere>
* player: fix cover art sometimes "syncing" against audiowm42014-05-221-1/+3
| | | | | | | Cover art is treated like video, but is not really video. In one case, the audio sync code was accidentally still active. Fixes cover art playback with --ao=null. (This is due to ao_null's latency emulation. Although it's not very clear whether that is actually correct...)
* player: suggest --no-audio-display on cover artwm42014-05-221-0/+7
|
* video: fix display of cover art with vo_vdpauwm42014-05-221-2/+4
| | | | | | | | | | vo_vdpau currently has a video queue larger than 1 entry, which causes the video display code to never queue display the video frame. This is because we consider cover art an endless stream of frames decoded from the same source packet, and include special logic to actually only decode and display 1 frame. Also, make decode_image() also signal EOF in the cover art case.
* edl: use start PTS of the source files as default start timewm42014-05-221-2/+8
|
* cache: redo options and default settingswm42014-05-204-29/+18
| | | | | | | | | | | | Some options change from percentages to number of kilobytes; there are no cache options using percentages anymore. Raise the default values. The cache is now 25000 kilobytes, although if your connection is slow enough, the maximum is probably never reached. (Although all the memory will still be used as seekback-cache.) Remove the separate --audio-file-cache option, and use the cache default settings for it.
* client API: add mpv_load_config_file()wm42014-05-181-0/+15
| | | | | | | This is probably a good idea, because it would make it easier for software embedding mpv to configure the mpv parts, without requiring the host program to provide explicit mechanisms for this (other than calling mpv_load_config_file()).
* options: unify code for setting string and "raw" optionswm42014-05-182-47/+44
| | | | | | | | | The code paths for setting options by string and by direct "raw" value were too different, which resulted in some weird code. Make the code paths closer to each other. Also, use this to remove the weirdness in the mpv_set_option() implementation.
* threads: use mpv time for mpthread_cond_timedwait wrapperwm42014-05-181-2/+2
| | | | | | Use the time as returned by mp_time_us() for mpthread_cond_timedwait(), instead of calculating the struct timespec value based on a timeout. This (probably) makes it easier to wait for a specific deadline.
* player: increase seek accuracy when refreshing display on filter changewm42014-05-181-1/+1
| | | | | | | | | When the player is paused, and video filters are changed, an exact seek is executed to refresh the display. Increase the exactness of the seek in this case; this reuses the code used for frame backstepping. It might help in cases where seeking is very imprecise, such as with transport streams.
* command: add a disc-menu-active propertywm42014-05-183-0/+30
| | | | Returns whether a DVD/BD menu is active. As requested by #788.
* client API: fix "missed" property notificationswm42014-05-181-19/+25
| | | | | | | | | | | | | | | | | | If a property is notified as changed, and then again (before the change notification is returned to the client), and the second change is a sporadic change (i.e. nothing actually changed) and the change notification was associated with with a data type, it could happen that a change was "overlooked", because it would detect no change on the second notification. This is actually a pretty annoying corner case, due to the annoying way we do things, so just store both the previously returned _and_ the newly obtained property value. then we always compare with the user value to check for a change, excluding any possibility of a missed change. Note that we don't (can't/shouldn't) care if a value changes, and then changes back; it's fine if that doesn't generate a notification. This is due to how property notifications are supposed to be coalesced.
* x11: replace--[x11-]fstype option with --x11-netwmwm42014-05-161-11/+0
| | | | | Simplifies the code a lot. You can still use --x11-netwm=no to disable NetWM for whatever reasons.
* player: reorganize how lua scripts are loadedwm42014-05-138-130/+205
| | | | | | Make loading of scripts independent of Lua. Move some of the loading code from lua.c to scripting.c, and make it easier to add new scripting backends.
* player: disable hr-seek framedropping during backsteppingwm42014-05-121-2/+3
|
* player: don't assign "false" to pointerwm42014-05-111-1/+1
| | | | | | | This is legal in theory. "false" expand to 0, and 0 is a valid pointer value. But I guess this was not really intended. Found by cppcheck.
* input: remove pausing command prefixeswm42014-05-111-9/+0
| | | | | | These are now equivalent to combining commands with the "cycle pause" or "set pause" commands, and thus are not needed anymore. They were also obscure and undocumented.
* player: don't complain on too long filenameswm42014-05-101-2/+2
| | | | | | | | | mpv supports per-file config files, basically filename+".conf". We use a static buffer for the new filename, and if that buffer is too small, we print a warning. This is confusing for e.g. long URLs, so just hide the warning by default. Why not dynamically allocate the buffer? Who cares.
* command: add property that estimates current video FPSwm42014-05-081-0/+27
| | | | | | | | | | | | | | | | | | This is done after filters, so things like framerate-doubling deinterlacing is accounted for. Unfortunately, framedropping can cause inaccuracies (especially after precise seeks), and we can't really know when that happens. Even though we know that the decoder might drop a frame if we request it to do so, we don't know when the dropped frame will start or stop affecting the video filter chain. Video filters can have frames buffered, and we can't tell at which point the dropped frame would have been output. It's not even possible to mark a discontinuity after seek, because again we don't know if the filter chain still has the discontinuity within its buffers. So we have to live with the fact that the output of this property can be completely broken after seek, unless --no-hr-seek-framedrop is used.
* options: add --hr-seek-framedrop optionwm42014-05-071-1/+2
| | | | | | | | This allows disabling of decoder framedrop during hr-seek. It's basically another useless option, but it will help exploring whether this framedropping really makes seeking faster, or whether disabling it helps with precise seeking (especially frame backstepping).
* player: avoid reconfig during seekingwm42014-05-071-1/+2
| | | | | This probably matters only in extremely corner-case heavy testcases, such as using mf:// with a bunch of differently sized images.
* player: remove VO from seeking code pathwm42014-05-072-11/+26
| | | | | | | | | | | | | | | Until recently, the VO was an unavoidable part of the seeking code path. This was because vdpau deinterlacing could double the framerate, and hr- seek and framestepping etc. all had to "see" the additional frames. But we've removed the frame doubling from the vdpau VO and moved it into a video filter (vf_vdpaupp), and there's no reason left why the VO should participate in seeking. Instead of queuing frames to the VO during seek and skipping them afterwards, drop the frames early. This actually might make seeking with vo_vdpau and software decoding faster, although I haven't measured it.
* player: minor reshuffling of video codewm42014-05-071-28/+30
|
* player: limit max. fallback frame durationwm42014-05-071-1/+1
| | | | | | It's calculated from the demuxer reported FPS, which is not very reliable. Limit the damage a completely insane and broken value could cause.
* player: handle video reconfig slightly different againwm42014-05-072-23/+29
| | | | | | | | | | Now we avoid calling update_video() twice on reconfig (once to check whether there are still new frames, and again to actually do the reconfig). Instead, we check whether there's still something going on before calling update_video() at all, and depending on that update_video() will be allowed to reconfig or not. This will simplify some things later.
* player: reset last_frame_duration on initwm42014-05-071-0/+1
|
* command: rename stream-length to file-size, format file sizeAndrey Morozov2014-05-061-13/+44
| | | | Signed-off-by: wm4 <wm4@nowhere>
* command: remove ifdefs for deint filterswm42014-05-061-4/+0
| | | | Doesn't have much of a purpose.
* common: change mp_snprintf_append semanticswm42014-05-051-2/+2
| | | | | | | | Make it more suitable for chaining. This means a function formatting a value to a string using a static buffer can work exactly like mp_snprintf_append itself. Also rename it to mp_snprintf_cat, because that's shorter.
* options: merge ---sub-auto-match with --sub-autowm42014-05-041-1/+1
| | | | There's no reason why these should be separate.
* options: remove deprecated --identifyMartin Herkt2014-05-042-29/+0
| | | | | | | Also remove MSGL_SMODE and friends. Note: The indent in options.rst was added to work around a bug in ReportLab that causes the PDF manual build to fail.
* options: rename video-related options/propertiesMartin Herkt2014-05-041-1/+1
| | | | | | | | | | | Renamed options: --aspect → --video-aspect --fstype → --x11-fstype --native-fs → --fs-missioncontrol --name → --x11-name Renamed properties: aspect → video-aspect
* options: rename audio-related options/propertiesMartin Herkt2014-05-041-2/+2
| | | | | | | | | | | | | Renamed options: --audiofile → --audio-file --audiofile-cache → --audio-file-cache --channels → --audio-channels --format → --audio-format --srate → --audio-samplerate Renamed properties: samplerate → audio-samplerate channels → audio-channels
* options: rename subtitle-related optionsMartin Herkt2014-05-041-1/+1
| | | | | | | | | --ass → --sub-ass --autosub → --sub-auto --autosub-match → --sub-auto-match --sub → --sub-file --subcp → --sub-codepage --subfps → --sub-fps
* video: remove a corner case by introducing another onewm42014-05-031-3/+2
| | | | | | | | | | | | | | | | | | | | When loading a video, and a script reacts to MPV_EVENT_VIDEO_RECONFIG, and the script inserts a video filter, the first frame can be skipped. This happens simply because the first frame is (usually) still queued in the video filter chain, and changing the filter chain will drop all queued frames. So this is just a corner case that just happens in a weird situation. But it's still annoying when having such a script, and starting something where the first frame is very visible, and not starting in paused mode. (All in all, a corner case.) Do this by immediately queuing 1 filtered frame to the VO immediately after reconfig, instead of leaving it to the video loop doing it as "incremental" work. Simply fallthrough to the next case. We must not overwrite "r" in this case, because that contains the current status. Note that the first frame will not be filtered using the inserted filter.
* video: fix video end conditionwm42014-05-031-5/+4
| | | | | | | | | | This wasn't really fine, and could (perhaps) cause weird corner cases on reinit or when the player was paused. Before eb9d20, video_left was also set to true if vo->frame_loaded was set, and this variable basically indicated whether the previous update_video() call was successful. This was overlooked when changing everything. Simply always call update_video(), it should be equivalent.
* video: rename a variablewm42014-05-031-2/+2
| | | | Cosmetic change, reduce the diff of the following commit.
* client API: fix inverted conditionwm42014-05-021-1/+1
| | | | Oops. Sigh.
* video: removed unused stuffwm42014-05-021-1/+0
|
* player: remove extremely obscure undefined behaviorwm42014-05-021-1/+2
| | | | | | Apparently the value of a pointer is "indeterminate" after a free() call, even if you never dereference the pointer after the free. Since talloc_free() calls free(), this applies here.
* client API, video: signal reconfig at the right timewm42014-05-021-4/+2
| | | | Filter reconfig can now happen a few frames before VO reconfig.
* lua: remove "lua/" prefix from script nameswm42014-05-021-1/+1
| | | | | | | | | This affects the return value of mp.script_name, the "client name" (what's returned by mpv_client_name()) and all associated features, as well as the mpv terminal output module prefix when scripts print something. As discussed in #748.
* video: change everythingwm42014-05-023-180/+224
| | | | | | | Change how the video decoding loop works. The structure should now be a bit easier to follow. The interactions on format changes are (probably) simpler. This also aligns the decoding loop with future planned changes, such as moving various things to separate threads.
* video: handle colorspace and aspect overrides separatelywm42014-05-023-5/+5
| | | | | Now the video filter code handles these explicitly, which should increase robustness (or at least find bugs earlier).
* command, vo_vdpau: respect vdpau deint sub-optionwm42014-05-021-2/+15
| | | | | This is a horrible hack to keep compatibility with the vo_vdpau deint sub-option.
* command: redo deinterlace filter probingwm42014-05-021-18/+27
| | | | | | | Give up on the deint_filters[] array, and probe using explicit code instead. Add additional checks to test the pixel format to avoid annoying warnings when a hardware deinterlacer is inserted when the current video chain is obviously incompatible.
* command: make enabling deinterlacing with vdpau workwm42014-05-021-0/+3
| | | | | | This restores the capability of enabling deinterlacing with the 'cycle deinterlace' command with vo_vdpau, and also makes it work with vo_opengl.
* video: improve error messageswm42014-04-301-2/+1
|