summaryrefslogtreecommitdiffstats
path: root/player
Commit message (Collapse)AuthorAgeFilesLines
* player: never overwrite stop_play fieldwm42015-07-085-13/+21
| | | | | | | This is a real pain: if a quit command is received, it's set to PT_QUIT. And then other code could overwrite it, making it not quit. The annoying bit is that stop_play is written and read in many places. Just not overwriting it unconditionally seems to be the best course of action.
* command: allow changing deinterlace property any timewm42015-07-081-1/+1
| | | | Don't require video decoding to be active.
* command: make deinterlace property use interlaced-only yadif modewm42015-07-071-1/+1
|
* player: add missing include directivewm42015-07-061-0/+1
|
* sub: protect ASS_Renderer statewm42015-07-063-1/+8
| | | | | | | | | | | | | | | | | | | Each subtitle track gets its own decoder instance (sd_ass). But they use a shared ASS_Renderer. This is done mainly because of fontconfig. Initializing fontconfig is very slow when using it with memory fonts, so there's a practical need to cache this memory font state, which is done by not creating separate ASS_Renderers. This is very dirty and very evil, but we probably can't get rid of it any time soon. The shared ASS_Renderer was not properly synchronized. While the program logic guarantees that only one sd_ass instance is visible at a time, there are other interactions that require synchronization. In particular, I suspect concurrent execution of mp_ass_configure_fonts() and sd_ass.get_bitmaps cause issues in a newer libass development branch. So here's a shitty hack that hopefully fixes things, hopefully only until libass becomes less dependent on fontconfig.
* player: simplify reload logicwm42015-07-024-20/+15
| | | | Instead of only reloading the demuxer, reopen the stream as well.
* player: remove automatic DVB channel advancement on no datawm42015-07-021-6/+0
| | | | | | | | For the sake of removing the separate stream/demuxer loading code. This could probably be reimplemented in some other way, but I have no DVB hardware for testing. The most preferred way would be making DVB to not quit, and just rerun the stream selection.
* player: unentangle --stream-dumpwm42015-07-023-12/+15
| | | | | | | | The final goal is making opening the demuxer and opening the stream the same operation. Stream dumping is a rather uninteresting feature, but has a small number of vocal users, and it's easy to keep.
* vo: change internal API for drawing frameswm42015-07-011-11/+21
| | | | | | | | | | | | | | draw_image_timed is renamed to draw_frame. struct frame_timing is renamed to vo_frame. flip_page_timed is merged into draw_frame (the additional parameters are part of struct vo_frame). draw_frame also deprecates VOCTRL_REDRAW_FRAME, and replaces it with a method that works for both VOs which can cache the current frame, and VOs which need to redraw it anyway. This is preparation to making the interpolation and (work in progress) display sync code saner. Lots of other refactoring, and also some simplifications.
* video: pass future frames to VOwm42015-07-012-34/+62
| | | | | | | | | | Now the VO can request a number of future frames with the last parameter of vo_set_queue_params(). This will be helpful to fix the interpolation code. Note that the first frame (after playback start or seeking) will usually not have any future frames (to make seeking fast). Near the end of the file, the number of future frames will become lower as well.
* player: slim down A/V desync warningwm42015-06-301-17/+5
| | | | | I don't think most of these suggestions are overly helpful. Just get rid of them.
* x11: Handle external fullscreen togglesEduardo Sánchez Muñoz2015-06-281-1/+1
| | | | | | | | | | | | | | | Some window managers let you change the fullscreen state of any window using a key combination. For example, on XFWM you can use Alt+F11 and on Compiz you can configure a key combination with the "Extra WM actions" plugin. With this change mpv will handle these fullscreen state changes. So, if you enter into fullscreen mode using the WM's shortcut and then you use mpv's fullscreen toggle, you will get back into window mode. Merges PR #2081. Signed-off-by: wm4 <wm4@nowhere>
* demux: export forced flagwm42015-06-273-3/+11
| | | | | | At least Matroska files have a "forced" flag (in addition to the "default" flag). Export this flag. Treat it almost like the default flag, but with slightly higher priority.
* ytdl: don't print failure warning when youtube-dl was killed by uswm42015-06-271-3/+5
|
* subprocess, lua: export whether the process was killed by uswm42015-06-271-0/+2
| | | | | | | | We want to distinguish actual errors, and just aborting the program intentionally. Also be a bit more careful with handling the wait() exit status: do not called WEXITSTATUS() without checking WIFEXITED() first.
* Disable DVD and BD menu support (to be removed)wm42015-06-261-0/+2
| | | | | | | | | | | | | | | | | | DVD/BD menu support never worked right, and are a pain to maintain. In particular, DVD menus never actually worked correctly, because highlights were not rendered correctly. Fixing this requires major effort, which I'm not interested to spend. Most importantly, the requirement to switch streams without losing the DVD/BD state caused major weirdness in the playback core. It was implemented by somehow syncing the playback state to the DVD/BD implementation (in stream_dvdnav.c etc.), and then reloading the demuxer without destroying and recreating the stream. This caused a bunch of special-cases which I'm looking forward to remove. For now, don't just remove everything related to menu support and just disable it. If someone volunteers, it can be restored (i.e. rewritten) in a reasonable way. If nobody volunteers soon, it goes.
* audio: fix format function consistency issueswm42015-06-261-3/+3
| | | | | | | | | | | Replace all the check macros with function calls. Give them all the same case and naming schema. Drop af_fmt2bits(). Only af_fmt2bps() survives as af_fmt_to_bytes(). Introduce af_fmt_is_pcm(), and use it in situations that used !AF_FORMAT_IS_SPECIAL. Nobody really knew what a "special" format was. It simply meant "not PCM".
* audio: output human-readable channel layouts toowm42015-06-251-0/+1
| | | | | This gets you the "logical" channel layout, instead of the exact thing we're sending to the AO. (Tired of the cryptic shit ALSA gives me.)
* player, demux: replace some demux_open() uses with demux_open_url()wm42015-06-241-12/+6
|
* player: increase tick event update frequencywm42015-06-231-1/+1
| | | | | | | | | | | | | | | 500ms is a bit too high. Change it to 50ms. This improves client API (and Lua) playback state update frequency. Updating absolutely every time the audio PTS changes would be possible, but is not helpful. Audio samplerates are high to trigger a wakeup feedback loop, so the process would waste CPU time on updating the playback position all the time. (If a client application wants to ensure smooth update of the playback position, it should update the position manually using a timer and by reading the property - the application can make a much better decision at how often the playback has to happen.)
* command: export stereo 3D tagswm42015-06-231-0/+4
| | | | Fixes #2066.
* client API: allow using msg-level option for log messageswm42015-06-201-0/+3
| | | | | | | | | | | | | | | | Client API users can enable log output with mpv_request_log_messages(). But you can enable only a single log level. This is normally enough, but the --msg-level option (which controls the terminal log level) provides more flexibility. Due to internal complexity, it would be hard to provide the same flexibility for each client API handle. But there's a simple way to achieve basically the same thing: add an option that sends log messages to the API handle, which would also be printed to the terminal as by --msg-level. The only change is that we don't disable this logic if the terminal is disabled. Instead we check for this before the message is output, which in theory can lower performance if messages are being spammed. It could be handled with some more effort, but the gain would be negligible.
* osc: time display configuration optionsTeoh Han Hui2015-06-191-2/+4
| | | | Total time and ms
* player: add some debug output for seekingwm42015-06-182-0/+5
|
* player: actually play videowm42015-06-181-1/+1
| | | | Broken by e00e9d65.
* client API: fix logging memory leakwm42015-06-181-0/+1
| | | | | | Very stupid. Was pointed out in #2056.
* player: make decoding cover art more robustwm42015-06-181-3/+18
| | | | | | | | | | | | | | When showing cover art, the decoding logic pretends that the source has an infinite number of frames. This slightly simplifies dealing with filter data flow. It was done by feeding the same packet repeatedly to the decoder (each decode run produces new output). Change this by decoding once at the video initialization. This is easier to follow, and increases robustness in case of broken images. Usually, we try to tolerate decoding errors, so decoding normally continues, but in this case it would just burn the CPU for no reason. Fixes #2056.
* command: do not exit playback if the B point of A-B loop is past EOFwm42015-06-163-18/+25
| | | | | | | | | | | | | | The previous behavior is confusing if the B point is near EOF (consider B being the duration of the file, which is strictly speaking past the last video timestamp). The new behavior is fine as well for B being far past EOF. Achieve this by checking the EOF state in addition to whether playback has reached the B point. Also, move the A-B loop code out of command_event(). It just isn't useful anymore, and obfuscates the code more than it makes it loop simple. Fixes #2046.
* player: do not exit when a seek gets queuedwm42015-06-161-0/+4
| | | | | | | | | Seems logical. Note that if playback otherwise ends while playback is active and a seek is still queued, we still exit. Otherwise you couldn't end playback by seeking past the end of the file (which is classic MPlayer and mpv behavior).
* lua: support MPV_END_FILE_REASON_REDIRECTwm42015-06-111-0/+1
| | | | And also add the missing "unknown" entry to the manpage.
* client API: add MPV_END_FILE_REASON_REDIRECTwm42015-06-111-2/+4
| | | | | Requested. Minor incompatible behavior change, as it was signalling MPV_END_FILE_REASON_EOF previously.
* client API: leave mpv_event_end_file.error to 0 on no errorwm42015-06-111-2/+2
| | | | | Making sure this is true makes it closer to the libmpv docs, and possibly less confusing in corner cases.
* lua: export end-file event fieldswm42015-06-111-0/+20
|
* command: add keypress, keydown, and keyup commands.torque2015-06-111-0/+30
| | | | | These commands are used to simulate keypresses using the key names from input.conf.
* audio: add some change notificationswm42015-06-091-0/+4
| | | | | We must be sure that every change comes with a notification. Otherwise, some property changes could possibly be missed.
* command: fix audio-out-detected-device propertywm42015-06-091-2/+3
| | | | | | | Used a wrong condition, and I suppose it could crash in some situations. Change it to lazily initialize the hotplug stuff, like the audio-device-list property does.
* command: remove unnecessary event IDswm42015-06-092-4/+0
| | | | | These were actually not needed for correct function, since individual property change notifications via mp_notify_property() are used.
* command: make property event mask matching more restrictivewm42015-06-091-1/+2
| | | | | | This was matching e.g. both "foo/bar" and "foobar" against "foo", when only the former should match. This could cause more property notifications than necessary.
* ytdl_hook: Support 'multi_video' resultsJaime Marquínez Ferrándiz2015-06-071-1/+1
| | | | | They can be handled by the same codes used for playlists, most of them will use an EDL. Fixes #2027.
* audio: add --audio-spdif as new method for enabling passthroughwm42015-06-052-1/+18
| | | | | | | | | | | | | This provides a new method for enabling spdif passthrough. The old method via --ad (--ad=spdif:ac3 etc.) is deprecated. The deprecated method will probably stop working at some point. This also supports PCM fallback. One caveat is that it will lose at least 1 audio packet in doing so. (I don't care enough to prevent this.) (This is named after the old S/PDIF connector, because it uses the same underlying technology as far as the higher level protoco is concerned. Also, the user should be renamed that passthrough is backwards.)
* audio: do not allow AO to change passthrough formatswm42015-06-051-7/+17
| | | | | | | This makes no sense, because the format can't be converted anyway. It just sets up the filter chain init code, which will vomit a bunch of useless and confusing messages. So uninit and fail explicitly when this happens.
* video: remove worthless log messagewm42015-06-051-6/+0
| | | | | All this information is already output otherwise. Except the FourCC, which lost most of its importance in mpv.
* vf_sub: minor simplificationwm42015-06-051-2/+1
|
* audio: do not exit when loading small files in paused modewm42015-06-041-1/+1
| | | | | | | | When starting in paused mode, no audio is written to the device at all, because writing audio implicitly unpauses the AO. If the file is very small, and all audio fits within the AO buffer, this accidentally triggered the EOF condition. (In unpaused mode, it would write all audio, end playback, and then wait until the AO has everything played.)
* player: print track list when switching trackswm42015-06-031-0/+4
|
* player: print a message along with track listwm42015-06-033-7/+9
| | | | Slightly less strange.
* player: don't print stream list when adding external tracks during loadwm42015-06-031-5/+7
| | | | | | | | | There's a short time during loading where external commands can add external streams even before the main file is loaded (like during ytdl hook execution). The track list is printed every time an external track is added via commands. This was quite awkward when ytdl was adding multiple streams, so don't print it in this stage. They are printed anyway at the end of the loading process.
* audio: remove an old hackwm42015-05-301-10/+1
| | | | | | | This was a cosmetic issue. It's handled differently now (clamping the display time to known duration range). This reverts commit 33b57f55573e658b3af6c6e8ff3188c8f959e82e.
* player: restore video-aspect on playback resumewm42015-05-291-0/+1
|
* lua: fix options submodulewm42015-05-292-2/+7
| | | | | | | | | It polluted the global namespace, instead of exporting the function properly. For now, keep it compatible by explicitly keeping the bogus export. Also fix a mistake in the manpage example.
* command: remove deprecated get_property commandwm42015-05-271-34/+0
| | | | | | This command has been deprecated in the 0.8.x and 0.9.x releases - get rid of it. Its only point ever was MPlayer compatibility, which broke years ago anyway.
* options: remove --slave-brokenwm42015-05-271-6/+0
| | | | It has been deprecated for ages.
* player: set cocoa input context at an earlier pointwm42015-05-271-4/+4
| | | | | There is not much of a reason to do this later. (Since some time ago, the input_ctx is created right at the start, so this can be done now.)
* player: load scripts at an earlier pointwm42015-05-271-4/+4
| | | | This is about as early as possible.
* command: better choice when to allow playback-related commandswm42015-05-261-16/+16
| | | | | | | | For certain reasons, we allow adding external tracks even before the main file is loaded. This somewhat breaks in old assumption, which uses mpctx->num_sources to determine whether a command can be applied in the current state. Use the newer playback_initialized instead, which is a much better choice for this purpose.
* command: fix track property when no file is loadedwm42015-05-261-2/+8
| | | | | | | | | | | The previous commit removed this. Although mp_switch_track() can now be called in all situations, we still don't want it to be called here. Setting a track property while no file is loaded would simply deselect the track instead of setting the underlying option to the requested value. Likewise, if the "cycle" command (M_PROPERTY_SWITCH) is used, don't just deselect the track.
* player: fix crashes when adding external tracks before loading main filewm42015-05-264-40/+30
| | | | | | | | | | | | | | | | Adding an external audio track before loading the main file didn't work right. For one, mp_switch_track() assumes it is called after the main file is loaded. (The difference is that decoders are only initialized once the main file is loaded, and we avoid doing this before that for whatever reason.) To avoid further messiness, just allow mp_switch_track() to be called at any time. Also make it do what mp_mark_user_track_selection() did, since the latter requires current_track to be set. (One could probably simply allow current_track to be set at this point, but it'd interfere with default track selection anyway and thus would be pointless.) Fixes #1984.
* input: allow - as separator between commands, instead of _wm42015-05-251-5/+5
| | | | | | | | | | Wnile it seems quite logical to me that commands use _ as word separator, while properties use -, I can't really explain the difference, and it tends to confuse users as well. So always prefer - as separator for everything. Using _ still works, and will probably forever. Not doing so would probably create too much chaos and confusion.
* command: change the hwdec propertieswm42015-05-251-30/+43
| | | | | | Another very minor step towards property/option unification. Not bothering with interface compatibility here.
* video: do not use MP_NOPTS_VALUE for A/V differencewm42015-05-243-7/+3
| | | | | | There's no need for this, it just creates more corner cases. Also always reset it on seeks etc..
* player: add function to compute past frame durationswm42015-05-243-17/+28
| | | | | And use it for the estimated-vf-fps property (it should be doing the same as before).
* command: add protocol-list propertywm42015-05-231-0/+16
| | | | Fixes #1972.
* ytdl: do not use deprecated optionwm42015-05-231-1/+1
| | | | This was missed in commit 450af053.
* command: allow changing track properties while no file is loadedwm42015-05-221-16/+20
| | | | | | | | | | Now it simply changes the options, i.e. what will be requested, instead of returning M_PROPERTY_UNAVAILABLE. This is another minor step towards unifying options and properties. Still a bit weird: it will always return "no" if no file is loaded, and disregards the option value.
* player: use an array for stream ID options and suchwm42015-05-223-37/+25
| | | | This makes the code slightly more generic.
* command: deprecate audio-sampleratewm42015-05-221-43/+2
| | | | | | | Also replace their implementation with the recently introduced properties. One significant difference is that audio-channels using OSD formatting does not print the channel layout. The user can just use the replacement property instead.
* command: add audio-params and audio-out-params propertieswm42015-05-221-1/+40
|
* command: rename audio-format pr