summaryrefslogtreecommitdiffstats
path: root/player
Commit message (Collapse)AuthorAgeFilesLines
* command: always make video-aspect property accessiblewm42015-08-041-14/+14
| | | | | | Now it can always be read. Normally returns the value of the video- aspect option. Writing it sets the option. If the aspect is not forced, it will attempt to return whatever is the current video aspect.
* command: fix video-aspect property update notificationwm42015-08-041-1/+1
| | | | Fixes #2194.
* osc: completely disable if no VO window existswm42015-08-041-1/+7
| | | | | Fixes relatively excessive CPU usage when paused while playing audio only.
* command: make auto-deinterlacing output at field ratewm42015-08-041-1/+1
| | | | | | This was requested by a user. The vdpau and vaapi deinterlacers already do this.
* player: use demux_open_url() to open main fileswm42015-08-041-61/+24
| | | | | | | | | | | | | | | | Instead of opening a stream and then a demuxer, do both at once with demux_open_url(). This requires some awkward additions to demuxer_params, because there are some weird features associated with opening the main file. E.g. the relatively useless --stream-capture features requires enabling capturing on the stream before the demuxer is opened, but on the other hand shouldn't be done on secondary files like external subtitles. Also relatively bad: since demux_open_url() returns just a demuxer pointer or NULL, additional error reporting is done via demuxer_params. Still, at least conceptually, it's ok, and simpler than before.
* player: remove higher-level remains of DVD/BD menu supportwm42015-08-036-430/+0
| | | | | | | | | | | | | | | Nobody wanted to restore this, so it gets the boot. If anyone still wants to volunteer to restore menu support, this would be welcome. (I might even try it myself if I feel masochistic and like wasting a lot of time for nothing.) But if it does get restored, it should be done differently. There were many stupid things about how it was done. For example, it somehow tried to pull mp_nav_events through all the layers (including needing to "buffer" them in the demuxer), which was needlessly complicated. It could be done simpler. This code was already inactive, so this commit actually changes nothing. Also keep in mind that normal DVD/BD playback still works.
* video: unbreak EOF with video-only files that have timestamp resetswm42015-08-031-1/+2
| | | | | | | Normally when there's a timestamp reset, we make audio resync to make sure audio and video line up (again). But in video-only mode, just setting audio to resyncing breaks EOF detection, because there's no code which would get audio_status out of this bogus state.
* audio: fix --end handling (again)wm42015-08-031-5/+2
| | | | | | | | | | Commit c5818046 fixed one case of audio EOF handling, and caused a new one. This time, the ao_buffer doesn't actually contain everyting that should be played - because if --end is used, only a part of it is played. Of course this is stupid, and it will be changed later. For now, this smaller change fixes the bug. Fixes #2189.
* audio: remove questionable speed change adjustmentwm42015-08-011-3/+0
| | | | | | | | | time_frame is when the next video frame should be shown. It's normally overwritten by the video timing code. This also says something about "nosound mode" (--no-audio today), but at least these days we don't use it at all if video is disabled. Remove it; it likely has no function at all.
* video: move frame duration code to a separate functionwm42015-08-011-11/+23
| | | | Minor preparation for something else.
* ytdl: get start_timeRicardo Constantino2015-07-291-0/+6
|
* ytdl: print command in debug modeRicardo Constantino2015-07-291-0/+1
|
* command: let track properties return option value in idle modewm42015-07-291-1/+5
| | | | | In idle mode (no file playing), the track properties such as vid/sid/aid should return the option setting, instead of the value "no".
* video: move up vo_frame setupwm42015-07-281-12/+12
|
* video: always decode at least 2 frames in advancewm42015-07-261-5/+1
| | | | | | | Remove the exception for decoding only 1 frame if VO framedrop is disabled. This was originally done to be able to test potential regressions when we enabled VO framedrop and decoding 2 frames by default. It's not needed anymore.
* audio: remove an unused parameterwm42015-07-241-3/+2
|
* audio: fix EOF state with --keep-openwm42015-07-241-1/+1
| | | | | | | | | | In paused mode, we never entered the audio EOF state. This shows e.g. in --keep-open mode, which will not set the eof-reached property correctly. Regression since commit c06cd1b9. This commit was the wrong fix. We need to respect the buffer state, and pausing has nothing to do with this. Fixes #2167.
* command: add property indicating per-file optionswm42015-07-231-0/+1
| | | | Fixes #2165, more or less.
* video: always re-probe auto deint filter on filter reconfigwm42015-07-213-10/+24
| | | | | | | | | If filters are disabled or reconfigured, attempt to remove and probe the deinterlace filter again. This fixes behavior if e.g. a software deint filter was automatically inserted, and then hardware decoding is enabled during playback. Without this commit, initializing hw decoding would fail because of the software filter; with this commit, it'll replace it with the hw deinterlacer instead.
* vo: minor simplification for queue size handlingwm42015-07-202-3/+3
| | | | | | | | | | Instead of calling it "future frames" and adding or subtracting 1 from it, always call it "requested frames". This simplifies it a bit. MPContext.next_frames had 2 added to it; this was mainly to ensure a minimum size of 2. Drop it and assume VO_MAX_REQ_FRAMES is at least 2; together with the other changes, this can be the exact size of the array.
* command: add track-list/N/audio-channels propertydeuiore2015-07-181-0/+8
| | | | | | Signed-off-by: wm4 <wm4@nowhere> (With some heavy modifications from the original patch.)
* player: show larger cache sizes in MB on status linewm42015-07-141-1/+5
|
* player: add missing \n to a messagewm42015-07-131-1/+1
|
* sub: call ass_set_fonts() only oncewm42015-07-131-10/+3
| | | | | | | | | | | | | ass_set_fonts() is called by mp_ass_configure_fonts(), which was called every time a subtitle renderer was initialized. I'm not sure why this was done - I can't find a good reason, and most likely there's none. However, it did cause problems with an experimental libass branch. It crashed some time after switching to a second subtitle track. The branch will hopefully be merged soon, and it seems unlikely that libass wants to fix its problems with its ridiculous API (rather it should normalize its API so that the issue doesn't happen in the first place), so just apply this change. It makes our code simpler too.
* player: extend --hls-bitrate optionwm42015-07-131-4/+10
| | | | Fixes #2116.
* player: put --term-playing-msg in a separate log categorywm42015-07-131-1/+3
| | | | Fixes #1983.
* player: parse and expose m3u playlist titleswm42015-07-101-2/+3
| | | | Requested. Closes #2100.
* video: don't force video refresh if video is restartingwm42015-07-101-1/+3
|
* player: refactor chapter seek codewm42015-07-103-24/+7
| | | | | | | mp_seek_chapter() had only 1 caller. Also the code was rather roundabout; the entire function can be compressed to 5 lines of code. (The new code is functionally the same - "mpctx->last_chapter_seek = -2;" was effectively a dead assingment.)
* client API: fix mpv_get_property_async() string casewm42015-07-101-1/+1
| | | | | | | The logic for this code didn't survive the previous refactor. It always crashed in async mode. Fixes #2121.
* 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
| | |