summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* libmenu: remove OSD menu functionality (--menu)Uoti Urpala2011-10-2527-4483/+8
| | | | | | | | | | Something like the OSD menu functionality could be useful. However the current implementation has several problems and would require a relatively large amount of work to get into good shape. As far as I know there are few users of the existing functionality. Nobody is working on the existing code and keeping it compiling at all while changing other code would require extra work. So delete the menu code and some related code elsewhere that's used by nothing else.
* vo_gl: fix crash with backends lacking control() featureswm42011-10-241-0/+6
| | | | | | | | Some functionality provided by the windowing backend (such as x11, win32) is optional. The function pointers in MPGLContext are NULL if the functionality is not implemented. Check them before calling them, instead of crashing. This happened at least on Windows with the "vo_ontop" command.
* vo_gl: remove support for nvidia register combiners (yuv=1)wm42011-10-243-169/+7
| | | | | | | | | | | | | The register combiner color conversion is broken and seems to use a slightly incorrect color matrix (the image looks gray-ish). Completely remove all code related to nVidia register combiners. Unless you have an ancient nVidia GPU, there's no reason to prefer register combiners over fragment shaders. Users with ancient GPUs without fragment shader support can just use -vo xv. Passing yuv=1 (register combiners) as sub option will print a warning and use yuv=2 (fragment shaders) instead.
* vo_gl: fix crash with ati-hack after 20256a8a64c9679bc9136bbwm42011-10-241-28/+34
| | | | | | | | | | | | | | | | | | | | | | Using the ati-hack and force-pbo suboptions (both can be enabled automatically when particular ATI drivers are detected) could lead to segfaults due to incorrect length calculation. The problem is that width*((bpp+7)/8) == width*(bpp+7)/8 doesn't hold true in general. The old code used bpp/8, because bpp was always guaranteed to be divisible by 8. When commit 20256a8a64c96 fixed bugs around 10 bit pixel formats, this assumption was broken, and resulted in out of bounds memory accesses. Additionally, the color values that were used to clear image borders were incorrect and showed up as pink borders on the right/bottom sides of the video when playing 10 bit content. Make the clear value approximately correct; the borders are still filled with a single byte value even though formats with 9-16 bits should be cleared with 2-byte values with the low byte 0. This commit also contains some other minor cleanups with no functional changes.
* vo_gl: remove mesa-buffer suboptionwm42011-10-243-79/+28
| | | | | | | This option enabled using Mesa specific functions, which have never been widely supported, and were removed from Mesa in 2010. http://cgit.freedesktop.org/mesa/mesa/commit/?id=cb2a66fd0c095fe03be5aaf88c8d48f5867425d3
* vo: sdl: handle key modifierswm42011-10-241-9/+43
| | | | | | | | | Now modifiers such as shift, control, and alt are handled. Unfortunately this requires a hack to deal with a SDL quirks when combining CTRL and a letter key. Also add some missing key syms.
* vo_gl: move window creation functions from vo_gl.c into gl_common.cwm42011-10-243-90/+71
| | | | | | | Now all windowing specific code is in gl_common.c. init_mpglcontext() used to set dummy callbacks for non-optional windowing callbacks. Remove these, as they only lead to confusion.
* vo_gl/sdl: use desktop resolution for fullscreen modewm42011-10-243-0/+20
| | | | | Before the SDL code would change screen resolution when switching to fullscreen. Try to keep existing desktop resolution instead.
* vo_gl: add new vo name "gl_sdl" to make SDL+GL mode availablewm42011-10-242-9/+45
| | | | | | | | | | | | | | | | | The actual work is done by the existing SDL code. This commit merely makes it possible to explicitly select the SDL backend ("gl" alone uses SDL only if the X11 and win32 backends are not available, while the new "gl_sdl" always forces use of SDL). Also disable YUV conversion method autodetection when SDL is used. This gets rid of a temporary window that appears for a moment and is immediately closed again. SDL can't deal with the VOFLAG_HIDDEN flag, which is needed to create an invisible GL context (when the autodetection is run, the video size isn't yet known to the VO, and creating a window then resizing would cause problems with window placement). Instead always pick the fragment program method by default (yuv=2). This change affects the normal "gl" VO too if it chooses the SDL backend.
* vo_gl: remove "noaspect" suboptionwm42011-10-241-13/+13
| | | | | | Apparently this is fully redundant given the global "noaspect" option. Refuse this suboption, and output an error message suggesting the correct option.
* vo_gl: convert to new API, clean up codewm42011-10-243-2745/+2980
| | | | | | | Reformat vo_gl.c, gl_common.c, gl_common.h. Remove all global variables and move them into a context struct (the Windows and SDL backends still refer to global_vo though). Change vo_gl.c to use the "new" VO API.
* vo_gl2, vo_matrixview: remove these VOswm42011-10-247-1702/+1
| | | | | | | | | | | | | | | | | | | | | Delete the vo_gl2 and vo_matrixview implementations. vo_gl2 was barely useful anymore. It was a hack based on an old vo_gl.c version, and all it did differently was rendering the video in tiles instead of using a single texture. That made it work with some crappy OpenGL implementations. These days all GPUs support textures of at least 2048x2048 pixels, which is enough for HD playback. On the other hand, gl2 suffered from various bugs and deficiencies, all of which are fixed in gl. Its existence also confused users; many thought that gl2 is the next version of gl and attempted to use it, even though it's much worse than gl and they should have used that instead. Should it turn out that tiling is actually useful, it should be implemented in vo_gl, instead of keeping vo_gl2 alive. vo_matrixview was a toy that couldn't even properly display a video. All it did was display a screensaver-like animation that showed "a Matrix-like running-text effect". (mplayer is not a screensaver.)
* Makefile: fix build without OpenGL after 75eab4f72af7b10e52aUoti Urpala2011-10-241-2/+2
| | | | | | | | After commit 75eab4f72a ("video, options: implement better YUV->RGB conversion control"), libvo/csputils.c symbols are required by core code. However, the file was still only compiled if GL was enabled, causing a build failure with GL disabled. Fix by making csputils.c compilation unconditional.
* demux_demuxers: fix seeking bug (--audiofile)Uoti Urpala2011-10-231-1/+1
| | | | | | | | | | | | | | | Demux_demuxers checked a pts value against 0 to see if it was unset, but other code uses MP_NOPTS_VALUE for that now. As a result audio and subtitle streams could seek to a large negative position (effectively to 0) instead of the correct target position. This broke --audiofile; the --initial-audio-sync code could compensate for wrong demuxer seek up to 5 minutes from the start of the file, masking the bug, but seeking further than that audio would seek to 0 instead. Note that the current --audiofile implementation using the demux_demuxers wrapper is a fundamentally unsound design and still not expected to generally work properly even after fixing this particular problem.
* cosmetics: vd_ffmpeg.c: reformatUoti Urpala2011-10-221-348/+301
|
* audio/video: delete buggy "dynamic plugin" codeUoti Urpala2011-10-204-112/+0
| | | | | | | | | | | | Codec selection for audio and video decoding had a "dynamic plugin" feature that tried to load a shared library for any codec that had not been enabled at compilation (disabled by default, but could be enabled with --enable-dynamic-plugins configure switch; for unknown reasons some distro packages have enabled it). The implementation was buggy and could cause normal codec selection fallback to fail if the feature was enabled. I'm not aware of any real uses of such dynamic plugins and the feature seems questionable anyway (there are no ABI guarantees that would make it safe to use). Remove the buggy feature.
* demux_lavf: set rawvideo codec_tag based on pix_fmtUoti Urpala2011-10-181-0/+2
| | | | | | | | | | | | Libav stopped automatically filling missing codec_tag field for raw codecs based on pix_fmt in libav commit bb416bd68c ("lavf: do not set codec_tag for rawvideo"). This broke demux_lavf for raw video in formats like YUV4MPEG, as the video format was not exported from demux_lavf in any form (the information only existed in the pix_fmt field of the struct AVCodecContext from libavformat, and that is not exported). Add an explicit call to avcodec_pix_fmt_to_codec_tag() to set the codec tag again so that selecting the correct raw decoder based on the tag works.
* video, options: implement better YUV->RGB conversion controlwm42011-10-1618-203/+505
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrite control of the colorspace and input/output level parameters used in YUV-RGB conversions, replacing VO-specific suboptions with new common options and adding configuration support to more cases. Add new option --colormatrix which selects the colorspace the original video is assumed to have in YUV->RGB conversions. The default behavior changes from assuming BT.601 to colorspace autoselection between BT.601 and BT.709 using a simple heuristic based on video size. Add new options --colormatrix-input-range and --colormatrix-output-range which select input YUV and output RGB range. Disable the previously existing VO-specific colorspace and level conversion suboptions in vo_gl and vo_vdpau. Remove the "yuv_colorspace" property and replace it with one named "colormatrix" and semantics matching the new option. Add new properties matching the options for level conversion. Colorspace selection is currently supported by vo_gl, vo_vdpau, vo_xv and vf_scale, and all can change it at runtime (previously only vo_vdpau and vo_xv could). vo_vdpau now uses the same conversion matrix generation as vo_gl instead of libvdpau functionality; the main functional difference is that the "contrast" equalizer control behaves somewhat differently (it scales the Y component around 1/2 instead of around 0, so that contrast 0 makes the image gray rather than black). vo_xv does not support level conversion. vf_scale supports range setting for input, but always outputs full-range RGB. The value of the slave properties is the policy setting used for conversions. This means they can be set to any value regardless of whether the current VO supports that value or whether there currently even is any video. Possibly separate properties could be added to query the conversion actually used at the moment, if any. Because the colorspace and level settings are now set with a single VF/VO control call, the return value of that is no longer used to signal whether all the settings are actually supported. Instead code should set all the details it can support, and ignore the rest. The core will use GET_YUV_COLORSPACE to check which colorspace details have been set and which not. In other words, the return value for SET_YUV_COLORSPACE only signals whether any kind of YUV colorspace conversion handling exists at all, and VOs have to take care to return the actual state with GET_YUV_COLORSPACE instead. To be changed in later commits: add missing option documentation.
* options: --lavfdopts, --reuse-socket: remove "global" flagUoti Urpala2011-10-161-3/+3
| | | | | | --reuse-socket and --lavfdopts had the CONF_GLOBAL flag set. I see no reason why they could not be set per file. Remove the flag from both options.
* vo_gl: fix image corruption with PBOs when playing 10 bit videowm42011-10-061-10/+14
| | | | | | | | vo_gl.c hardcoded the assumption that YUV formats always use 1 byte per component. This corrupted the output when playing 10 bit h264 video. Only the PBO code path was affected. PBOs are normally unused, unless ATI is detected, or the force-pbo option is used.
* getch2.c: fix negative keycodes returned for non-asciiUoti Urpala2011-10-031-1/+1
| | | | | | | | | | | | | | | | | | getch2.c read data into a "char" array, and returned values other than escape sequences directly from there. This meant that it could return negative values (except on platforms where "char" is unsigned) if the input contained bytes >= 128. This would break later parsing in input.c as the values would be interpreted as having the MP_KEY_DOWN flag set, which would make the key binding code think a key is held down (and never released). Fix by changing the buffer type to unsigned char. The bug itself was very old, but started triggering visible breakage more easily after commit 82b8f89baea ("input: rework event reading and command queuing"). Before that the key values would be passed through the input.c "key read function" interface, which (mis)interpreted the negative values as errors from the function, and in most cases discarded them without much visible effect.
* terminal output: show libav version numbers in verbose modeUoti Urpala2011-10-013-0/+29
|
* demux_mkv: avoid hang with some broken filesUoti Urpala2011-09-251-0/+4
| | | | | Return failure to open file in one case that could lead to an infinite loop with broken Matroska files before.
* subreader.c: don't run FriBiDi code if using libassUoti Urpala2011-09-231-1/+4
| | | | | | | | Libass has its own BiDi handling now, and preprocessing the subtitles with FriBiDi before passing them to libass breaks things. Disable our own FriBiDi code when libass rendering is used. This affects external subtitle files of other formats parsed with subreader.c and converted to ASS tracks.
* sd_ass.c: set event->Style to fix --ass-stylesUoti Urpala2011-09-231-0/+1
| | | | | | | | | | | | | Set the "Style" attribute for subtitle events created in sd_ass to match the "default_style" attribute of the track. This is required to make --ass-styles work with recent libass versions (otherwise the event would use style 0, which is a fallback style added by libass now). Commit 378ada847c8eb3a641392691b1a2317f8fc214e0 ("sub/ass: use default style, not first style unconditionally") fixed the same issue for external subtitles converted with mp_ass_read_subdata(); this commit fixes it for muxed ones.
* codecs.conf: add Libav ProRes decoderUoti Urpala2011-09-231-0/+11
|
* options: make "choice" option type parsing ignore caseUoti Urpala2011-09-111-1/+1
|
* core: fix --sstepUoti Urpala2011-09-041-1/+1
| | | | | The --step option had broken at some point. Probably nobody uses it, but it was easy to fix.
* cosmetics: mplayer.c: minor tweaksUoti Urpala2011-09-041-21/+8
|
* options: --pphelp: fix after libpostproc version changeUoti Urpala2011-09-041-1/+1
| | | | | | | | | | The last libpostproc major version change from 51 to 52 changed the type of the "pp_help" symbol from a pointer to help text to the help text itself. This made --pphelp crash. Change the option definition to match the new type. This probably makes it crash if compiled against older libpostproc, but the option is not important enough to try supporting that (I've seen no reports of the crash, probably people just don't use the option).
* options: add "disabled option" functionalityUoti Urpala2011-09-044-14/+44
| | | | | | | | | | | Add functionality to mark options that depend on features disabled at compile time as disabled rather than not compiling the option definitions at all. This allows printing a warning about the option not being available because of a disabled feature, instead of just "unknown option". Because the option definitions are still compiled fully, this only works for definitions that do not reference symbols which are not available if the feature is disabled. Use the new functionality for options depending on libass.
* input/ar.c, input/lirc.c: fix changes missing from 1916b95b8Uoti Urpala2011-09-042-1/+3
| | | | | | | | | | | | | 1916b95b8 changed two function types from returning "void" to returning "int", but was missing changes to add "return 0;" to the functions. Fix. The reason for the change in the original commit was that the functions were called through a function pointer returning int anyway, so the missing return probably made things no more likely to fail at runtime than they were before that commit. However, it caused a compilation failure with clang, which treats non-void function not returning a value as a fatal error (in GCC it's just a warning).
* options: move libass-related options to structUoti Urpala2011-09-0310-96/+91
|
* subassconvert: handle "\r\n" line endsClément Bœsch2011-09-021-1/+1
| | | | | | | | | Previously the code converting text subtitles to ASS format converted newline characters, and only those, to ASS "new line" markup. If the subtitles contained "\r\n", the "\r" was thus left in the text. In previous libass versions the "\r" was not visible, but in the current one it produces an empty box. Improve the conversion to remove the "\r" in that case. Also treat a lone "\r" as a newline.
* demux_mf: fix option value allocated with strdupUoti Urpala2011-09-021-1/+2
| | | | | | demux_mf allocated the "type" suboption of "--mf" with strdup if it was not explicitly set. This caused a crash after playing an mf:// entry. Fix to use talloc instead.
* options: commandline: support "--no-opt" for flag optionsUoti Urpala2011-09-011-6/+39
| | | | | | | | | | | | | | | When parsing the command line, map "--no-foo" to "--foo=no" if an option named "foo" exists and is a flag option. Non-empty parameters are not allowed with this syntax ("--no-foo=no" is invalid). This implementation is different from the existing "--nofoo" variants for most flag options. Those are implemented as completely separate options; there's an option named "fs" and a separate option named "nofs" (thus "--no-nofs" actually works after this change...). The reason for adding the new syntax is to support the much more standard "--no-" prefix and to allow eventually cleaning up the option handling (though the "nofoo" variants of existing options can't be removed soon due to backwards compatibility).
* csputils/vo_gl: rewrite YUV->RGB matrix generationUoti Urpala2011-08-292-77/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrite the csputils.c code generating a conversion matrix for YUV->RGB conversions (currently used by vo_gl only). Functional differences: - The separate "mplayer default" colorspace is removed, and BT.601 is used instead (the default colorspace was in fact BT.601; see below). - The old code was missing chroma scaling. As a result the "mplayer default" colorspace actually mapped to BT.601, and everything else was buggy (I guess the other colorspaces were added with particular coefficient semantics, without understanding that the original "default colorspace" was actually BT.601 and why its coefficients differed from the added version). - The old code had a bug in the equalizer hue equations. - The old code assumed that for specifying whether input and output were limited-range or full-range YUV or RGB it would make sense to specify "no conversion" meaning full-range YUV to full-range RGB or limited-range YUV to limited-range RGB. This isn't true; limited- range YUV has different ranges for luma and chroma (16-235 vs 16-240) which means you have to scale chroma for limited->limited conversions. The new code assumes limited->limited conversions for the levelconv parameter 2. It'd probably make sense to change the API later to specify the ranges of input and output separately. - The undocumented EBU and XYZ colorspaces are removed. I doubt any videos use these. Also the EBU colorspace looks like it'd expect a different input range - at least no input would map to full RGB red as it was.
* cosmetics: csputils.[ch]: reindentUoti Urpala2011-08-282-138/+146
|
* demuxer.h: raise pad amount to allow compiling against FFmpegUoti Urpala2011-08-261-1/+1
| | | | | | | | FFmpeg has increased FF_INPUT_BUFFER_PADDING_SIZE to 16 (unlike Libav which still has it at 8). Raise MP_INPUT_BUFFER_PADDING_SIZE to 16 to allow compilation against FFmpeg too (demuxer.c checks the padding size for packets is at least as much as libavcodec wants for its decoders, and this check failed with the previous value of 8).
* core: remove bad workaround for files without FPS setUoti Urpala2011-08-251-7/+2
| | | | | | | | | | | | | Commit dde8b753e4 merged an mplayer1 change (r31328) that set correct_pts to true if FPS was not set (on the assumption that correct-pts mode could provide proper timing without FPS). As the merge commit noted this change was somewhat questionable, as the option shouldn't really change after things have already been initialized. After recent changes it can cause an outright crash (assert in ds_get_packet2() from 9c7c4e5b7d fails). Remove the hack. Also only print a warning about not having FPS if correct_pts is not set (in correct_pts mode not having FPS shouldn't be a real problem, as everything is based on timestamps anyway).
* video_out.h: change VOCTRL_* defines to enumharklu2011-08-251-54/+56
| | | | | | | | Convert the list of VOCTLR_* defines to an enum, dropping some unused values. This resolves a collision between VOCTRL_XOVERLAY_SET_COLORKEY and VOCTRL_REDRAW_OSD, which had the same value (the XOVERLAY one was only used by vo_xvr100 and vo_tdfx, so this didn't matter much in practice).
* ad_ffmpeg: free resources on init failureUoti Urpala2011-08-211-4/+12
| | | | | | | | | | ad_ffmpeg init() function did not free resources if opening failed. Outside code (dec_audio.c) does not automatically call uninit() if init() returns failure, and the uninit function would have crashed in some cases had it been called (it did freed lavc_context->extradata, but lavc_context could have been NULL after early init failure). Add explicit calls to uninit() after failure and make uninit function safe to call at any point.
* ad_ffmpeg: handle timing for partially decoded packets betterUoti Urpala2011-08-211-7/+23
| | | | | | | | | | | | | | | | | | | | | | | At least the libavcodec WavPack decoder can return output for an audio frame in multiple parts and return 0 bytes input consumed for the initial parts. Timing info was not set correctly in this case: sh_audio->pts and pts_bytes were reset each time when decoding more from the packet, as if the packet had been new (ds_get_packet_pts() has a check to return MP_NOPTS_VALUE if the packet has already been partially read, but that didn't trigger since libavcodec returned exactly 0 bytes read so the demuxer-visible packet state didn't change). Add a field to keep track of whether a packet has already been decoded from, and don't reset timing info again if so. Adding the field requires adding a decoder context to store it (there wasn't one before). BTW the WavPack decoder behavior and avcodec_decode_audio3() documentation don't match - the documentation says the return value is "zero if no frame data was decompressed (used) from the input AVPacket", while the decoder DOES return some frame data which comes from the input packet.
* cosmetics: ad_ffmpeg.c: reformatUoti Urpala2011-08-211-131/+137
|
* demux_lavf: Adding av_dup_packet() missing from recent 6e8d420a41Uoti Urpala2011-08-211-0/+5
| | | | | | | | | Commit 6e8d420a41 ("demux: avoid a copy of demux packets with lavf, reduce padding") was missing an av_dup_packet() line. As a result at least formats that use parsing on the lavf side could fail (with parsing the packet may contain pointers to temporary fields that will be overwritten/freed when reading further packets, and av_dup_packet() is required to allocate permanent storage).
* osdep/mplayer.rc: change to use "mplayer2" nameMartin Herkt2011-08-211-7/+6
|
* configure: libav: use "pkg-config --print-errors", "Libav" nameUoti Urpala2011-08-211-9/+9
| | | | | | | | | | | | Use the "--print-errors" flag of pkg-config when testing for the presence of Libav libraries. Even though the error output is a bit messy (printed on the same "Checking for"... line), it does contain useful information for this test which checks for several libraries at once. Also change the test name from "FFmpeg" to "Libav" and rename the option from --disable-ffmpeg to --disable-libav. The change should cause no compatibility problems as the option is very rarely used.
* demux_mkv: fix failure to open some files from 0ece360eeaf95Uoti Urpala2011-08-201-32/+23
| | | | | | | | After 0ece360eeaf95 ("demux_mkv: skip files faster in ordered chapter file search") some Matroska files failed to open. The problem was that demux_mkv_read_info() returned 0 on success, but the opening code interpreted this as a value to stop parsing further headers. Fix this and also modify some of the other return value handling.
* core, demux, vd_ffmpeg: pass side data from demux_lavf to vd_ffmpegUoti Urpala2011-08-208-40/+91
| | | | | | | | | | | | Pass the libavformat packet side_data field from demux_lavf to vd_ffmpeg. Libavcodec/libavformat use this field for palette data, and passing it is required for the playback of some paletted video codecs. The implementation works by giving vd_ffmpeg a copy of the struct demux_packet used to store the video packet (from which it can access the avpacket field). The definition of struct demux_packet is moved to new file demux_packet.h so that vd_ffmpeg.c can use it without including all of demuxer.h.
* demux_mkv: support extradata for wavpack audio tracksUoti Urpala2011-08-201-12/+11
| | | | |