summaryrefslogtreecommitdiffstats
path: root/player
Commit message (Collapse)AuthorAgeFilesLines
* player: cosmetics: rename a functionwm42014-12-273-7/+7
| | | | | Something which has this many important sideffects shouldn't start have a "get" prefix.
* player: ordered chapters: cosmeticswm42014-12-261-54/+32
| | | | | | Drop some meaningless comments, fix codingstyle, fix some formatting victims of the mp_msg refactoring, replace some memcpys with assignments.
* player: ordered chapters: bullshit reductionwm42014-12-261-26/+5
| | | | | Nobody cares about these redundant messages, they make the code even more complicated than it has to be, and also they're annoying.
* player: ordered chapters: filter missing chapterswm42014-12-261-0/+9
| | | | | | | | | | | | Ever since someone (not me) added some Matroska features which nobody ever uses (ordered edition or some bullshit), I haven't had a fucking clue what the fuck is going on in this fucking file. (Still agreed to it, so it's my fault.) mplayer2 handled missing chapters correctly (and I suppose in a somewhat clean/simple manner), but the changed code doesn't. Since I can't even follow this code because it's so arcanely complicated, just add a hack that has the same effect.
* command: overlay_add: more flexible treatment of offset parameterwm42014-12-261-8/+12
| | | | | | | | | | | | | | Essentially, don't make it the mmap() argument, and just add it to the memory address. This hides tricky things like alignment reequirements from the user. Strictly speaking, this is not entirely backwards compatible: this adds the regression that you can't access past 2 or 4 GB of a file on 32 bit systems anymore. But I doubt anyone cared about this. In theory, we could be clever, and just align the offset manually and pass that to mmap(). This would also be transparent to the user, but minimally more effort, so this is left as exercise to the reader.
* win32: add mmap() emulationwm42014-12-261-9/+0
| | | | | | | | Makes all of overlay_add work on windows/mingw. Since we now don't explicitly check for mmap() anymore (it's always present), this also requires us to make af_export.c compile, but I haven't tested it.
* player: hack against --keep-open misbehaving with broken fileswm42014-12-241-0/+2
| | | | | | | | | | | | | | | | If a file (or a demuxer) is broken, seeking close to the end of the file doesn't work, and seek_to_last_frame() will be called over and over again, burning CPU for no reason. Observed with incomplete mp4 files. That this can happen was already mentioned in commit 090f6cfc, but I guess now I'll do something against it. hrseek_lastframe is cleared by reset_playback_state(), so it's only set if seek_to_last_frame() was called, and no other seek happened since then. If finding the last frame succeeds, no EOF will happen (unless the user unpauses, but then it will simply remain at the last frame). If it fails, then it will return immediately, without retrying.
* player: fix a typo in message outputwm42014-12-241-1/+1
| | | | This typo has been around for over a year. Oops.
* client API: fix compiler warning if openglcb API is disabledwm42014-12-221-1/+0
| | | | | The function is void, and of course you can't return anything from it. (Why does C or gcc even allow this?)
* vo_opengl_cb: free context on exitwm42014-12-221-0/+3
| | | | | | | Minor memory leak. Actually, this also exposes some problems in the QtQuick example. This will have to be fixed in the example.
* client API: fix mpv_wakeup()wm42014-12-221-2/+2
| | | | | | Of course this was going to get stuck in the retry loop. Fixes #1372.
* sub: reset sub decoder correctly when cycling subtitleswm42014-12-211-3/+1
| | | | | | | | | | reset_subtitles() works in mpctx->d_sub[], which is set to NULL before calling it from uninit_sub(). This fixes resetting the subtitle when cycling subtitle tracks. Actually, this was probably a feature, because it's annoying if subtitles don't show up when cycling them. But it also can have unintended consequences, so get rid of it.
* player: cosmetics: move code aroundwm42014-12-212-16/+15
| | | | Separate commit to reduce noise in the following one.
* player: don't show "0%" percentage in infinite streamswm42014-12-202-4/+9
|
* player: print only changed tagswm42014-12-192-4/+24
| | | | | | | | | | | | | | | | | The code in the demuxer etc. was changed to update all metadata/tags at once, instead of changing each metadata field. As a consequence, printing of the tags to the terminal was also changed to print everything on each change. Some users didn't like this. Add a very primitive way to avoid printing fields with the same value again if metadata is marked as changed. This is not always correct (could print unchanged fields anyway), but usually works. (In general, a rather roundabout way to reflect a changed title with ICY streaming...) Fixes #813 (let's call it a "policy change").
* player: cosmetics: remove ancient commentwm42014-12-171-3/+0
| | | | | The DVD horror was confined to specific parts of the player, instead of having it spread everywhere.
* command: extend revert_seek commandwm42014-12-171-2/+10
| | | | | "revert_seek mark" basically forces the seekback point. It's basically a one-way bookmark.
* command: format ${avsync} like on terminal status linewm42014-12-161-0/+4
| | | | | | Padding with spaces is very useless for OSD (because most fonts are variable width), but it's good when using it on the terminal, e.g. for reproducing the default terminal status line.
* client API: be more lenient about mpv_suspend/resume mismatcheswm42014-12-153-29/+53
| | | | | | | | | | | | Before this commit, this was defined to trigger undefined behavior. This was nice because it required less code; but on the other hand, Lua as well as IPC support had to check these things manually. Do it directly in the API to avoid code duplication, and to make the API more robust. (The total code size still grows, though...) Since all of the failure cases were originally meant to ruin things forever, there is no way to return error codes. So just print the errors.
* lua: cosmetics: fix some include directiveswm42014-12-151-3/+2
| | | | | | Apparently, the atomics were used by the win32 subprocess code. This code was moved to a separate file, but the atomics.h include was forgotten.
* scripting: fix/improve deprecation messagewm42014-12-151-3/+6
| | | | | | | | | The message was missing a '\n', so it was merged with the next line, which also typically caused it not to be printed with the colors for warnings. Print the full new path in the warning message. (Normally, cfg should never be NULL, so accounting for this case is just for robustness.)
* options: deprecate 'lua' based options/dirs for 'script'Avi Halachmi (:avih)2014-12-154-15/+32
| | | | | | | | | | | | - --lua and --lua-opts change to --script and --script-opts - 'lua' default script dirs change to 'scripts' - DOCS updated - 'lua-settings' dir was _not_ modified The old lua-based names/dirs still work, but display a warning. Signed-off-by: wm4 <wm4@nowhere>
* command, dvd: add property which returns list of DVD titleswm42014-12-131-0/+33
| | | | | | | | | This was requested. It seems libdvdread can't get the duration for titlesets other than the currently opened title. The data structures contain dangling pointers for these, and MPlayer works this around by opening every title separately for the purpose of dumping the title list.
* options: add option for ignoring patch in resume mechanismwm42014-12-131-4/+8
| | | | | | Whatever. Fixes #1281.
* player: add a --keep-open=always modewm42014-12-121-1/+2
| | | | | | | | The --keep-open behavior was recently changed to act only on the last file due to user requests (see commit 735a9c39). But the old behavior was useful too, so bring it back as an additional mode. Fixes #1332 (or rather, should help with it).
* command: add properties for current bitratewm42014-12-121-0/+23
| | | | Fixes #1192.
* lua: don't ignore key press events for script key bindingswm42014-12-101-2/+2
| | | | Meh.
* command: fix crash with some forms of script_bindingwm42014-12-101-1/+1
| | | | "script_binding name ..." just crashed it. Oops.
* player: update chapter marks when switching fileswm42014-12-101-0/+4
| | | | | This wasn't done, so the chapter marks of the previous file were visible. It's harmless, but looks unpolished, so fix it.
* command: add "idle" propertywm42014-12-101-2/+16
| | | | Yes, it's redundant with events.
* player: change interaction between revert_seek and ab-loopswm42014-12-091-0/+1
| | | | | | The result isn't quite what I imagined, because the A-point is never marked as a seek point (so you can't jump between A and B), but it's still slightly better than before.
* client API: expose OpenGL rendererwm42014-12-094-0/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds API to libmpv that lets host applications use the mpv opengl renderer. This is a more flexible (and possibly more portable) option to foreign window embedding (via --wid). This assumes that methods like context sharing and multithreaded OpenGL rendering are infeasible, and that a way is needed to integrate it with an application that uses a single thread to render everything. Add an example that does this with QtQuick/qml. The example is relatively lazy, but still shows how relatively simple the integration is. The FBO indirection could probably be avoided, but would require more work (and would probably lead to worse QtQuick integration, because it would have to ignore transformations like rotation). Because this makes mpv directly use the host application's OpenGL context, there is no platform specific code involved in mpv, except for hw decoding interop. main.qml is derived from some Qt example. The following things are still missing: - a way to do better video timing - expose GL renderer options, allow changing them at runtime - support for color equalizer controls - support for screenshots
* player: restore ab-loop settings with playback resumewm42014-12-091-0/+2
| | | | Fixes #1324.
* build: fix --disable-libasswm42014-12-081-2/+2
| | | | | | Still supported, but obviously untested. You shouldn't use this option anyway.
* player: make chapter seek to end jump to last frame with --keep-openwm42014-12-083-2/+7
| | | | | | | | There were complaints that a chapter seek past the last chapter was quitting the player. Change the behavior to what is expected: the last frame. If no chapters are available, this still does nothing.
* options: add a 'once' idle modeStefano Pigozzi2014-12-071-1/+1
| | | | | This allows to make mpv wait for file open events at start but close after it is done playing the first playlist.
* sub: remove assertionwm42014-12-071-2/+1
| | | | | | | | | | | This should clearly be impossible, but it seems to happen with ordered chapters for a user. Since I can't tell what the actual bug is and it seems impossible to know the details without downloading possibly huge files, this is probably the best we can do. Should at least partially fix #1319.
* player: when seeking past EOF with --keep-open, seek to last framewm42014-12-073-7/+47
| | | | | | | | | | | | | | | | | | | | | It feels strange that seeking past EOF with --keep-open actually leaves the player at a random position. You can't even unpause, because the demuxer is in the EOF state, and what you see on screen is just what was around before the seek. Improve this by attempting to seek to the last video frame if EOF happens. We explicitly don't do this if EOF was reached normally to increase robustness (if the VO got a frame since the last seek, it obviously means we had normal playback before EOF). If an error happens when trying to find the last frame (such as not actually finding a last frame because e.g. the demuxer misbehaves), this will probably turn your CPU into a heater. There is no logic to prevent reinitiating the last-frame search if the last-frame search reached EOF. (Pausing usually prevents that EOF is reached again after a successful last-frame search.) Fixes #819.
* osc: improve slimbox layout and minor code cleanupsChrisK22014-12-051-82/+92
|
* assdraw: Properly approximate circle for rounded boxChrisK22014-12-051-4/+5
| | | | source: http://spencermortensen.com/articles/bezier-circle/
* osc, dvd, bd: fix mouse state when changing menu modeswm42014-12-052-4/+9
| | | | | | | | | The flags weren't correctly set, and the mouse cursor remained visible after leaving menu mode. This was apparently broken in 0.7.0 too. Fixes #1316.
* discnav: remove redundant callwm42014-12-041-2/+0
| | | | This was made the default a while ago.
* dvd, bd: don't unnecessarily block on demuxer/stream all the timewm42014-12-041-1/+4
| | | | | | | | | | | | | | | | | | This was completely breaking any low-level caching. Change it so that at least demuxer caching will work. Do this by using the metadata cache mechanism to funnel through the menu commands. For some incomprehensible reason, I had to reorder the events (which affects their delivery priority), or they would be ignored. Probably some crap about the event state being cleared before it could be delivered. I don't give a shit. All this code sucks. It would probably be better to let discnav.c access the menu event "queue" directly, and to synchronize access with a mutex, instead of going through all the caching layers, making things complicated and slow.
* dvd, bd, osc: disable OSC while a menu is activewm42014-12-041-0/+9
| | | | | | | They interfere. It turns out that commit b6ca4a48 actually broke this in weird ways, but this solution is better anyway.
* lua: fully cleanup removed key bindingswm42014-12-031-0/+1
| | | | This is basically cosmetic; it was leaking the old handler functions.
* client API: allow multiple mpv instances with terminal=yeswm42014-12-022-16/+21
| | | | | | | | | | | | | | | This is simply not allowed, and doing it triggered an assertion. It's still not allowed, because the terminal and related functionality is a global resource, and there doesn't seem to be a sane way to manage the signal handlers. But be a bit nicer, and just the terminal if it's already in use. Note that terminal _output_ happens anyway. This becomes usable with this commit. To facilitate logging-only usage further, also explicitly disable terminal input, so that "terminal=yes" can be used for logging without much interference with other things. (It'll still overwrite some signal handlers, though.)
* osc: always force mouse_move bindingwm42014-12-021-1/+1
| | | | | | So the OSC will still appear when using --no-input-default-bindings. It also means it may override a user's mouse_move binding, but I guess users who don't want the OSC should just use the --no-osc option.
* lua: fix broken error messagewm42014-12-021-1/+1
| | | | | luaL_error() doesn't support %.*s, because it uses Lua's own format string mechanism that just looks like the C one. Just drop this part.
* player: don't signal an error if --stream-dump is usedwm42014-12-021-0/+1
| | | | | | | The player thinks an error happened because no audio or video was played after finishing the file, but this obviously makes no sense with stream dumping. (error_playing follows the client API convention that negative values are errors.)
* client API: print version on initializationwm42014-12-021-0/+2
| | | | | A rather big oversight, because a log produced with the client API will not contain the mpv version at all otherwise.
* player: don't ignore relative seeks by 0 secondswm42014-11-291-4/+0
| | | | | | | I don't know why this done; most likely it had no real reason. Remove it because it breaks "refresh seeks" to the same position. (Although the refresh seeks mpv sometimes does were fine.)
* command: avoid returning invalid FPS valueswm42014-11-291-3/+5
| | | | It's possible that fps is sometimes 0 in case it's unset.
* player: reset frame step counter on seekswm42014-11-292-1/+1
| | | | | I suppose this wasn't done in order to keep the frame step counter active even in the next file, but actually it was reset anyway.
* lua: add a function that formats Lua values as stringswm42014-11-291-16/+21
| | | | | | | | Yep, Lua is so crappy that the stdlib doesn't provide anything like this. Repurposes the undocumented mp.format_table() function and moves it to mp.utils.
* player: simplify and fix ordered chapter EOF handlingwm42014-11-282-17/+11
| | | | | | | | | | | | | | Ordered chapter EOF was handled as special-case of ending the last segment. This broke --kee-open, because it set AT_END_OF_FILE in an "inconvenient" place (after checking for --keep-open, and before the code that exits playback if EOF is reached). We don't actually need to handle the last segment specially. Instead, we remain in the same segment if it ends. The normal playback logic will recognize EOF, because the end of the segment "cuts off" the file. Now timeline_set_from_time() never "fails", and we can remove the old segment EOF handling code in mp_seek().
* command: sub_add with "auto" should not always select a subtitle trackwm42014-11-271-1/+3
| | | | | | | | | | | Running "sub_add file.srt auto" during hook execution automatically selected the first added track. This happened because all tracks added with sub_add are marked as "external", and external subtitles are always selected by default. Fix this by negating the "external" flag when autoselecting subtitles during loading. The no_default flag exists for this purpose; it was probably added for libquvi originally, where we had the same issue.
* audio: alternative fix for previous commitwm42014-11-271-4/+1
| | | | | | | This is a somewhat obscure situation, and happens only if audio starts again after it has ended (in particular can happens with files where audio starts later). It doesn't matter much whether audio starts immediately or some milliseconds later, so simplify it.
* audio: fix busy loop when seeking while pausedwm42014-11-271-2/+4
| | | | | | | | | | | | | | | | | | | | When playing paused, the amount of decoded audio is limited to a small amount (1 sample), because we don't write any audio to the AO when paused. The small amount could trigger the case of the wanted audio being too far in the future in the PTS sync code, which set the audio status to STATUS_DRAINING, which in turn triggered the EOF code in the next iteration. This was ok, but unfortunately, this triggered another retry in order to check resuming from EOF by setting the status to STATUS_SYNCING, which in turn lead to the busy loop by alternating between the 2 states. So don't try resyncing while paused. Since the PTS syncing code also calls ao_reset(), this could cause the pulseaudio daemon to consume some CPU time as well. This was caused by commit 33b57f55. Before that, the playloop was merely run more often, but didn't cause any problems. Fixes #1288.
* ytdl: bump requrired youtube-dl version to 2014.11.26ChrisK22014-11-261-1/+1
|
* ytdl: Try to handle multi-arc videosChrisK22014-11-261-14/+37
| | | | | | | | this currently uses a sketchy but apparently working workaround, which will be removed once the neccessary changes in youtube-dl are implemented Fixes #1277
* ytdl: When using DASH, print actual durationChrisK22014-11-261-1/+5
| | | | | prints the actual duration as reported by youtube-dl to the terminal when available
* client API: make sure youtube-dl is not used by defaultwm42014-11-251-0/+1
| | | | | | | Currently, --ytdl is off by default, but even if this is changed, never enable it by default for the client API. It would be inappropriate to start an intrusive external subprocess behind the host application's back.
* audio: make mp_audio_config_to_str return a stack-allocated stringwm42014-11-251-3/+2
| | | | Simpler overall.
*