summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | macosx_application: use @autoreleasepoolStefano Pigozzi2013-05-302-35/+25
| | | | | | | | | | | | | | | | I don't even want to know how this worked. It scares me a lot.
* | | | cocoa_common: use cocoa APIs to go fullscreenStefano Pigozzi2013-05-302-219/+165
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes a bit of ugly code and bookeeping which is never bad. `drawRect` needs to guard against different window instances since in fullscreen the view is wrapped in a fullscreen window provided by the toolkit (a instance of NSFullScreenWindow to be precise). The event handling was moved to the view so that it can still get all the events when in the fullscreen window. Ideally these should be moved to some NSResponder subclass within macosx_application and made available even when no window is present. I refrained from this because "small steps".
* | | | macosx_application: move escape_loadfile_name in this fileStefano Pigozzi2013-05-304-25/+22
| | | | | | | | | | | | | | | | This allows to move back osx_common to raw C.
* | | | cocoa_common: use better power management activity descriptionStefano Pigozzi2013-05-301-1/+1
| | | | | | | | | | | | | | | | | | | | Now one might actually undestand why this power management assertion is used in the first place.
* | | | osx: remove compatibility conditionals for 10.6Stefano Pigozzi2013-05-303-106/+13
|/ / / | | | | | | | | | | | | | | | | | | | | | At this point 10.6 is pretty old and we don't want to supporting old platforms. I'm killing all the 10.6 compatibility code before doing more refactorings. Next commits will also use newer Objective-C syntax such as literals and @autoreleasepool.
* | | demux_mkv: replace awkward goto by function callwm42013-05-301-39/+43
| | | | | | | | | | | | Requires reindenting a large code block to minimize random control flow.
* | | demux_mkv: make sure wavpacks works with older libavcodec versionswm42013-05-301-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | The new wavpack packet format (see previous commit) doesn't work with older libavcodec versions, so disable the new code in this case. The version numbers are only approximate, since the libavcodec version wasn't bumped with the wavpack change, but it's close enough.
* | | demux_mkv: fix wavpack in mkvwm42013-05-301-0/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Libav introduced a silent API breakage by changing what wavpack packets the libavcodec decoder accepts. Originally the libavcodec codec accepted Matroska-style wavpack packets. Libav commit 9b6f47c removed this capability from the libavcodec code, and added code to libavformat's Matroska demuxer to "rearrange" wavpack packets. Since demux_mkv still sent Matroska-style packets, playback failed. Fix this by "rearranging" packets in demux_mkv as well by copying libavformat's code. (The best kind of fix.) Tested with [CCCP]_Mega_Lossless_Audio_Test.mkv, as well as with a sample generated by mkvmerge.
* | | gl_common: fix invalid alignmentwm42013-05-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | 0 is invalid. The intention of the code turning off any additional alignment, so we need 1. Change a comment: obviously we don't try to set alignment parameters etc.to handle stride correctly, and instead do everything by row.
* | | gl_video: add some debug code for testing texture depthwm42013-05-301-7/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This probes and prints the depth of some texture formats with the help of a FBO. By default it tests the format used for scaling, as well as the format used for dithering and the 3D LUT (if any of these are enabled). The output is visible only with -v. Some representative values are probed, and the difference of input and output value is printed as hex- float. Hex-floats are used because they make the implied precision more obvious. Originally I wanted to do some more sophisticated guessing of the implied depth/precision for more user-friendly reporting, but then I decided that printing raw data is better for debugging, especially if things go wrong. This does not try to disable any functionality and does not print any warnings if the depth is lower than what it should be.
* | | gl_video: change a GLSL statementwm42013-05-301-1/+1
| | | | | | | | | | | | | | | | | | This might be better with dumb shader compilers, which won't vectorize this to a single vector-division, assuming the hardware does have such an instruction. Affects "bicubic_fast" scale mode only.
* | | gl_video: fix some dithering bugswm42013-05-302-15/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The internal texture format GL_RED is typically 8 bit, which is clearly not good enough for the new dither matrix. The idea was to use a float texture format, but this was somehow "forgotten". Use GL_R16, since 16 bit textures are more robust, and provide more precision for the same memory usage. Change how the offset for centering the dither matrix is applied. This is needed for making it possible to round up values to the target depth. Before this commit, this changed the output even if the input was exact and input and output depth were the same, which is not really what you want. Now it doesn't do that anymore.
* | | core: avoid deselecting and reselecting stream needlesslywm42013-05-292-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | The core deselected all streams on initialization, and then selected the streams it actually wanted. This was no problem for demux_mkv/demux_lavf, but old demuxers (like demux_asf) could lose some packets. The problem is that these demuxers can buffer some data on initialization, which then is flushed on track switching. Fix this by explicitly avoiding deselecting a wanted stream.
* | | demux_asf: fix after commit 5165e19wm42013-05-292-7/+4
| | | | | | | | | | | | | | | This demuxer reallocated packets on its own, instead of using the demux.c functions, which clashed with a recent change.
* | | options: remove some questionable -lavdopts suboptionswm42013-05-294-70/+4
| | | | | | | | | | | | | | | | | | Most of these are rather questionable, the rest you rarely need to set manually. You still can set all of them with -lavdopts-o (because libavcodec has AVOptions for them).
* | | mplayer: fix volume setting with --gapless-audiowm42013-05-292-16/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Playing something with "mpv f1.mkv f2.mkv --gapless-audio --volume=20" caused the volume to be reset when playing a new file. Normally, the volume should not be reset (unless explicitly requested with per-file options), and without either --gapless-audio or --volume it works as expected. The underlying problem is that volume was saved only when the AO was uninitialized, and also the volume was always set when starting a file. Fix this by saving the volume when playback ends, and when the audio is reinitialized. To make sure the volume is never restored twice or saved in the wrong situation, introduce INITIALIZED_VOL. Also note that this volume saving and restoring only happens if the --volume option is used. mixer.c does its own bookkeeping of volume. The main reason for this is that the volume option could be reset by per-file options (see manpage), and mixer.c doesn't know anything about this stuff. This is probably dumb, and maybe some things could be simplified. But for now this will work.
* | | manpage: fix typowm42013-05-271-1/+1
| | |
* | | demuxer_lavf: use audio/mpeg mime type for mp3wm42013-05-271-0/+1
| | | | | | | | | | | | | | | Basically, add exactly the same hacks for mp3 as we did for AAC. Should make starting mp3 streams much faster.
* | | demux_lavf: minimal probing and reduced analyzeduration for AAC over HTTPwm42013-05-272-15/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When AAC is streamed over HTTP, using libavformat defaults is pathetically slow. One solution for that is skipping probing and using the mimetype to identify that it's AAC instead. This is what we did before this commit (and ffmpeg does it too, but their logic is too "inaccessible" for mpv). This is still pretty fragile though. Make it a bit more robust by requiring minimal probing. A probescore of 25 is reached after feeding 2 KB to libavformat (instead of > 500 KB for the normal probescore), so use that. This is done only when streaming AAC from HTTP to reduce the possibility of weird breakages for other formats. Also reduce analyzeduration. The default analyzeduration will make libavformat read lots of data, which makes playback start slow. So we set analyzeduration to a low value. On the other hand, doing that for other formats is risky, because there are unspecified effects with certain "strange" formats (like transport streams). So we do this only if we're streaming AAC from HTTP as well. tl;dr libavformat is shit for media players
* | | options: add allow-mimetype suboption for demux_lavfwm42013-05-274-1/+12
| | | | | | | | | | | | | | | | | | | | | This can control whether demux_lavf should use the HTTP mime type to determine the format, instead of probing the data with the libavformat API. Do this to allow easier debugging in case the mimetype is incorrect. (This is done only for AAC streams right now.)
* | | mplayer: output status line normally with --no-consolecontrolswm42013-05-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit 0e07189, I made the status line always print a newline, instead of cutting the output at 80 columns (or if stderr is a terminal, whatever width the terminal reports). This is better in the case the output goes into a log file or a pipe. This caused problems for people who want to pipe raw video to mpv, so change it again. (Not sure why they won't use FIFOs instead.) Now output untrimmed lines if the slave mode flag is set, which makes sense to do, too. The current slave mode is still on life support, though.
* | | macosx_application: fix menu 'ghosting'Stefano Pigozzi2013-05-261-0/+7
| | | | | | | | | | | | | | | | | | | | | This fixes a bug that caused the application to never leave it's frontmost position. The idea is stolen from @donmelton who used it in MPlayerShell. Thanks!
* | | manpage: fix typowm42013-05-261-2/+2
| | |
* | | manpage: mark some filters as deprecated in favor of libavfilterwm42013-05-261-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | This is basically a "do not use" label. We don't remove them yet, because we still support FFmpeg releases where we can not use libavfilter for various reasons. Also, Libav causes pain as usual due to the lack of ported mplayer filters in its codebase, so not all filters will be available there.
* | | vo_opengl: remove most of the "inline" documentationwm42013-05-261-86/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no point duplicating all the text that is already in the man pages, and synchronizing them is a pain. Place a link to the github generated pages instead. Unfortunately, the anchor '#vo-opengl' does not work. Maybe github's rst converter just sucks, as the actually generated HTML contains links using that anchor too, but does not generate the anchor itself. Too bad.
* | | vf_delogo: copy in non-direct case, fix double-freewm42013-05-261-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | If the image is not writeable, the image actually has to be copied beforehand. This was overlooked when converting the video chain to reference counted images. Fix a double free issue. This was overlooked when vf.c was changed to free filter priv data automatically.
* | | stream: kill STREAM_CTRL_RESETwm42013-05-262-4/+0
| | | | | | | | | | | | Was unused.
* | | stream: kill memory streamswm42013-05-262-23/+3
| | | | | | | | | | | | | | | These are unused by now, and it relied on some assumptions that have been broken by now.
* | | demux_lavf: print how many bytes are read by avformat_find_stream_info()wm42013-05-261-0/+6
| | | | | | | | | | | | | | | | | | Can be helpful for debugging slow stream startup. Also add a comment about BIO_BUFFER_SIZE.
* | | stream: de-inline some larger functionswm42013-05-262-70/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tests with demux_mkv show that the speed doesn't change (or actually, it seems to be faster after this change). In any case, there is not the slightest reason why these should be inline. Functions for which this will (probably) actually matter, like stream_read_char, are still left inline. This was tested with demux_mkv's indexing. For broken files without index, demux_mkv creates an on-the-fly index. If you seek to a later part of the file, all data has to be read and parsed until the wanted position is found. This means demux_mkv will do mostly I/O, calling stream_read_char() and stream_read(). This should be the most I/O intensive non-deprecated part of mpv that uses the stream interface. (demux_lavf has its own buffering.)
* | | gl_video: improve ditheringwm42013-05-269-24/+349
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a different algorithm to generate the dithering matrix. This looks much better than the previous ordered dither matrix with its cross-hatch artifacts. The matrix generation algorithm as well as its implementation was contributed by Wessel Dankers aka Fruit. The code in dither.c is his implementation, reformatted and with static global variables removed by me. The new matrix is uploaded as float texture - before this commit, it was a normal integer fixed point matrix. This means dithering will be disabled on systems without float textures. The size of the dithering matrix can be configured, as the matrix is generated at runtime. The generation of the matrix can take rather long, and is already unacceptable with size 8. The default is at 6, which takes about 100 ms on a Core2 Duo system with dither.c compiled at -O2, which I consider just about acceptable. The old ordered dithering is still available and can be selected by putting the dither=ordered sub-option. The ordered dither matrix generation code was moved to dither.c. This function was originally written by Uoti Urpala.
* | | gl_video: add scaler-resizes-only sub-optionwm42013-05-263-0/+33
| | | | | | | | | | | | | | | This option disables the scaler set with lscale if the video image is not resized.
* | | Replace calls to usec_sleep()wm42013-05-2613-24/+15
| | | | | | | | | | | | | | | | | | This is just dumb sed replacement to mp_sleep_us(). Also remove the now unused usec_sleep() wrapper.
* | | Replace all calls to GetTimer()/GetTimerMS()wm42013-05-2619-125/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |