aboutsummaryrefslogtreecommitdiffhomepage
path: root/player
Commit message (Collapse)AuthorAge
* player: slightly simplify how demuxer streams are enabled/disabledGravatar wm42016-02-25
| | | | | Instead of having reselect_demux_streams() look at all streams, make it look at the current stream that is being enabled/disabled.
* player: fix --force-window behaviorGravatar wm42016-02-25
| | | | | | | | | | | | | | | | | _Of course_ the previous commit broke --force-window behavior (like it does every single time I touch it). vo_has_frame() gets cleared after a seek, so e.g. stopping playback of a file and going to the next by keeping the seek key down will enter a short moment without video at the end of the first file, which will set the stalled_video variable to true. Prevent it by using the indication whether the window was properly created (which is probably exactly what we want here). This function is also responsible for destroying the window when needed, and obviously we should never do that while video is active. (This is the actual bug, although the other change in this commit already hides the common breakage it caused.)
* player: honor --force-window if video is selected, but inactiveGravatar wm42016-02-24
| | | | | If a video track is selected, but no video is decoded from it (mostly with broken files), then create the window anyway.
* player: remove pointless callGravatar wm42016-02-23
| | | | | This is the unfortunate video timer; it's already reset when it actually matters (after video was prepared and before video is actually started).
* player: simplify enabling demuxer threadsGravatar wm42016-02-23
| | | | | No need for this crazy loop anymore, and we can simply enable it for each demuxer when it's opened.
* player: remove unused MPContext.stream fieldGravatar wm42016-02-23
| | | | | | | It was just dead code. Also fixes the stream-open-filename property, which is supposed to be read-only if a file was already opened.
* player: remove MPContext.sources fieldsGravatar wm42016-02-23
| | | | | | Some oddity that is not needed anymore. The only thing which still referenced them was avoiding loading external files more than once, which is now prevented by checking the list of tracks instead.
* player: remove initial seek on playback startGravatar wm42016-02-18
| | | | | | Accidental leftover from commit ae55896f. (This seek ised to be done with ordered chapters, and was accidentally changed to always being done.)
* player: remove old timeline/ordered chapters supportGravatar wm42016-02-15
|
* audio/video: expose codec info as separate fieldGravatar wm42016-02-15
| | | | | Preparation for the timeline rewrite. The codec will be able to change, the stream header not.
* video: remove pointless parameter indirectionGravatar wm42016-02-15
| | | | This is always the same value.
* player: add on_preloaded hookGravatar wm42016-02-15
| | | | (Limited usefulness.)
* player: restore old/correct --force-window behaviorGravatar wm42016-02-15
| | | | | | | | | When playback of a video ends, and the next file has no video at all (no cover art or anything), then the window must be cleared. This also resizes the window forcibly, which is by design. Fixes #2825.
* client API: handle double->int64 conversion correctlyGravatar wm42016-02-13
| | | | It signalled failure instead.
* lavfi: dump the filter graphGravatar wm42016-02-12
| | | | | | | | Especially useful to see what video formats are involved on the various filter links. I suspect this function is not available on Libav, so add necessary ifdeffery preemptively.
* player: remove dead codeGravatar wm42016-02-12
| | | | Fixes CID 1350055 and CID 1350054.
* player: remove double assignment in declarationGravatar wm42016-02-12
| | | | | | Fixes CID 1350058. (Still looks like this might be valid C, in some fucked up way.)
* player: abort loading if there is a problem with complex filtersGravatar wm42016-02-10
|
* lavfi: stop playback on some unrecoverable situationsGravatar wm42016-02-10
| | | | Also improve the error message for the missing label case.
* player: assume setlocale() returns NULL if locales are not supportedGravatar wm42016-02-10
| | | | | | | | It would make somewhat sense for libcs which don't implement locales at all, such as Bionic. Beyond that, setlocale() is specified that it can return NULL, and we shouldn't crash if that happens.
* player: fix crash if no video decoder can be initializedGravatar wm42016-02-10
| | | | Caused by the recent refactoring for complex filters.
* player: force refresh seek when changing audio filtersGravatar wm42016-02-09
| | | | | | | | | | | | | Unfortunately I see no better solution. The refresh seek is skipped if the amount of buffered audio is not overly huge. Unfortunately softvol af_volume insertion still can cause this issue, because it's outside of the normal dynamic filter chain changing code. Move the video refresh call to reinit_video_filters() to make it more uniform along with the audio code.
* player: add --external-file optionGravatar wm42016-02-08
| | | | Mostly intended for use with --lavfi-complex.
* lavfi: fix EOF caseGravatar wm42016-02-06
| | | | | | | | | | | | This was dumb. Could make it burn 100% CPU and not exit at the end. (Because it would retry as instructed, instead of terminating playback.) It also needs to consider EOF as waiting for input. lavfi_process() will decide if it's really EOF, or if further input might come in the future. Without this, it'd would think that it does not need to wait for input, i.e. that new input will be available immediately. (Not so fond of the duplication of subtle logic.)
* audio: fix EOF handling if nothing could be decoded at allGravatar wm42016-02-06
| | | | The code for decoding the initial frame has to handle this explicitly.
* player: remove some further current_track dependenciesGravatar wm42016-02-05
| | | | Now it's used for initialization only for audio and video.
* lavfi: fix build on LibavGravatar wm42016-02-05
| | | | | | It doesn't provide this function. The code is not really designed to work without it, so it will probably mess up big time, but at least make it compile again.
* player: add complex filter graph supportGravatar wm42016-02-05
| | | | | | | | | | | | | | | | See --lavfi-complex option. This is still quite rough. There's no support for dynamic configuration of any kind. There are probably corner cases where playback might freeze or burn 100% CPU (due to dataflow problems when interaction with libavfilter). Future possible plans might include: - freely switch tracks by providing some sort of default track graph label - automatically enabling audio visualization - automatically mix audio or stack video when multiple tracks are selected at once (similar to how multiple sub tracks can be selected)
* player: move audio and video decoder init to separate functionsGravatar wm42016-02-05
| | | | Preparation.
* player: simplify error_on_track()Gravatar wm42016-02-05
| | | | | | track can't be NLUL at this point, so the if is redundant. Remove it and unindent the block. Also, make the function check whether the track is selected at all, which makes it safer and idempotent.
* options: set fs=yes by default on RPI, and change RPI defaults handlingGravatar wm42016-02-05
| | | | | The main reason for changing the fullscreen default is that not doing it would change the vo_rpi default behavior with the previous commit.
* input: ignore --input-cursor for events injected by input commandsGravatar wm42016-02-04
| | | | | | Apparently useful for window embedding. Fixes #2750.
* sub: implement "sub-seek 0"Gravatar wm42016-02-04
| | | | | | | For bitmap subs, implement it properly. For libass, you need newest git master. Fixes #2791.
* command: fix track cycling logicGravatar wm42016-02-03
| | | | | | Also remove the unused function argument. Fixes #2784.
* command: show original aspect in video-aspect property tooGravatar wm42016-02-02
| | | | | Basically, just make it append " (original)" if the original aspect ratio is selected.
* player: refactor: reduce some dependencies on current_trackGravatar wm42016-02-01
| | | | Don't mind me.
* player: use different variable to indicate coverartGravatar wm42016-02-01
| | | | Slightly better.
* audio/video: merge decoder return valuesGravatar wm42016-02-01
| | | | | | Will be helpful for the coming filter support. I planned on merging audio/video decoding, but this will have to wait a bit longer, so only remove the duplicate status codes.
* audio: use brutal resync only on larger PTS discontinuitiesGravatar wm42016-01-31
| | | | | | | | | Let's fix broken samples with questionable heuristic without real reasoning. Until this gets fixed properly, this is a good compromise, though. A proper fix would properly resync audio and video without brutally resetting the decoders, but on the other hand not doing the brutal reset would cause issues in other obscure corner cases such resyncing might cause.
* audio: fix a case of going to sleep before playback startGravatar wm42016-01-31
| | | | | | | | | | | | | | | This code is tricky because it has to wakeup the mainloop to make progressing during syncing audio, but also has to avoid waking it up when it's not needed. Failure to do so either burns CPU by not ever going to sleep, or causes apparent "freezes" by going to sleep (and it will continue if the mainloop is woken up e.g. due to user input). In this case, simply starting A/V playback with --start=5 and removing an unrelated wakeup in osd.c can trigger such a "freeze". The unrelated wakeup did hide this bug, nonetheless it's a bug. (Can't wait to rewrite this shitty audio resync code. And it's all my fault.)
* vd_lavc: allow switching between hw/sw decoding any timeGravatar wm42016-01-29
| | | | | | | We just need to provide an entrypoint for it, and move the main init code to a separate function. This gets rid of the messy video chain full reinit in command.c, which completely destroyed and recreated the video state for the purpose of mid-stream hw/sw switching.
* player: refactor: some more minor decoder/output decouplingGravatar wm42016-01-29
| | | | | | These changes don't make too much sense without context, but are preparation for later. Then the audio_src/video_src fields will be actually be NULL under circumstances.
* audio: refactor: separate audio init and filter/output initGravatar wm42016-01-29
| | | | | | | | | | | | Before this commit, reinit_audio_chain() did 2 things: create all the management data structures and initialize the decoder, and handling lazy filter/output init (as well as dealing with format changes). For the second purpose, it could be called multiple times (even though it wasn't really idempotent). This was pretty weird, so make them separate functions. The new function is actually idempotent too. It also turns out the reinit functions don't have to call themselves recursively for the spdif PCM fallback.
* audio: move pts reset checkGravatar wm42016-01-29
| | | | Reduces the dependency of the filter/output code on the decoder.
* player: fix initial audio sync in certain casesGravatar wm42016-01-29
| | | | | | | | | | | | | | | | | Regression caused by commit 3b95dd47. Also see commit 4c25b000. We can either use video_next_pts and add "delay", or we just use video_pts. Any other combination breaks. The reason why the assumption that delay==0 at this point was wrong exactly because after displaying the first video frame (usually done before audio resync) a new frame might be "added" immediately, resulting in a new video_next_pts and "delay", which will still amount to video_pts. Fixes #2770. (The reason why display-sync was blamed in this issue is because enabling display-sync in the options forces a prefetch by 2 instead of 1 frames for seeks/playback restart, which triggers the issue, even if display-sync is not actually enabled. In this case, display-sync is never enabled because the frames have a unusually high frame duration. This is also what exposed the initial desync issue.)
* video: fix coverart switchingGravatar wm42016-01-27
| | | | | | If cover art is re-enabled during playback, the covert art picture (which has pts==0) will be discarded. Add another corner case to the list.
* command: always allow setting volume/mute propertiesGravatar wm42016-01-26
| | | | | | | | | | | | | | | | | | | | | | | This seems generally easier when using libmpv (and was already requested and implemented before: see commit 327a779a; it was reverted some time later). With the weird internal logic we have to deal with, in particular the --softvol=no case (using system volume), and using the audio API's mixer (--softvol=auto on some systems), we still can't avoid all glitches and corner cases that complicate this issue so much. The API user is either recommended to use --softvol=yes or auto, or to watch the new mixer-active property, and assume the volume/mute properties have significant values if the mixer is active. Remaining glitches: - changing the volume/mute properties has no effect if no internal mixer is used (--softvol=no) and the mixer is not active; the actual mixer controls do not change, only the property values - --volume/--mute do not have an effect on the volume/mute properties before mixer initialization (the options strictly are only applied during mixer init) - volume-max is 100 while the mixer is not active
* video: slightly improve video stream switchingGravatar wm42016-01-26
| | | | | Resync newly switched video streams to the current playback position. (Normal seeks will reset playback_pts to NOPTS.)
* audio: fix spdif PCM fallbackGravatar wm42016-01-25
| | | | | | | | | With the format left untouched, this would just try to reinit with a spdif format again. We're not clearing the format in reset_audio_state() so the audio chain can be recreated any time without having to wait for a frame to be decoded.
* audio: release pending audio frame on seekingGravatar wm42016-01-25
|