summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* cleanup: Silence compilation warnings on MinGW-w64wm42012-03-0128-108/+101
| | | | | | | | | | | | | | | | | | | Some of the code, especially the dshow and windows codec loader parts, are extremely hacky and likely full of bugs. The goal is merely getting rid of warnings that could obscure more important warnings and actual bugs, instead of fixing actual problems. This reduces the number of warnings from over 500 to almost the same as when compiling on Linux. Note that many problems stem from using the ancient wine-derived windows headers. There are some differences to the "proper" windows header. Changing the code to compile with the proper headers would be too much trouble, and it still has to work on Unix. Some of the changes might actually break compilation on legacy MinGW, but we don't support that anymore. Always use MinGW-w64, even when compiling to 32 bit. Fixes some warnings in the win32 loader code on Linux too.
* windows: fix format string attributes on MinGWwm42012-03-013-20/+26
| | | | | | | | | | MinGW maps the "printf" format string archetype to the non-standard MSVCRT functions, even if __USE_MINGW_ANSI_STDIO is defined and set to 1. We need to use "gnu_printf" to use the format strings as provided by vsnprintf and similar functions to get correct warnings. Since "gnu_printf" isn't necessarily available on other GCC compatible compilers (such as clang), do this only on MinGW.
* configure: add __USE_MINGW_ANSI_STDIO on MinGWwm42012-03-011-0/+1
| | | | | | | | | | | | | This makes MinGW redirect certain stdio functions (such as the sprintf family) from the MSVCRT libc to a standard compliant MinGW implementation. This fixes a crash in talloc.c when compiling mplayer with MinGW-w64. The problem is most likely with talloc_vasprintf(), which calls vsnprintf with a small buffer and checks its return value to find out how much space the formatted string requires. Without this commit, vsnprintf would always return -1, and then the code calls abort(). (lachs0r figured out this one.)
* windows support: remove _UWIN definewm42012-03-011-1/+0
| | | | | | | The _UWIN define causes the mingw headers not to declare deprecated (on Windows) function names such as open and mkdir. But the code uses these. I have no idea why this used to work (if it even did), but the original reason why it was defined seems to have vanished.
* configure: allow changing pkg-config binary with --pkg-configwm42012-02-291-0/+4
|
* configure: use cross toolchain if --target is givenwm42012-02-291-44/+61
| | | | | | | | | | If --enable-cross-compile is specified, passing --target=i686-w64-mingw32 for example will check if i686-w64-mingw32-gcc can be used. This is only done if the compiler isn't specified via --cc or the CC environment variable. The same is done for some other build tools, such as pkg-config. (Only the C compiler will try to use a fallback in this case.)
* configure: disable cross compilation auto detectionwm42012-02-291-4/+5
| | | | | | | | | This didn't work very well when cross compiling from Linux to Windows: it tries to execute an .exe file, which succeeds if wine is installed. As consequence it detects "no" as result. In general this won't work if emulation for the target architecture is available. Remove it.
* configure: fix target triplet check for mingw targetsKovensky2012-02-291-15/+19
| | | | | mingw32 and mingw64's recommended triplets are i686-pc-mingw32 / x86_64-w64-mingw32, neither has mingw32 in the middle.
* configure: show PKG_CONFIG_PATH and CFLAGS in config.logUoti Urpala2012-02-291-1/+8
| | | | | | | | When the build wrapper repo scripts run configure they set a custom PKG_CONFIG_PATH environment variable. Show the value of this in config.log to make it easier to rerun configure with a tweaked version of the same parameters. Also show CFLAGS if set, as it's likely to break things.
* aviheader.c: silence a warningUoti Urpala2012-02-291-2/+4
| | | | libmpdemux/aviheader.c:235:7: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
* vo_png: set AVCodecContext parameters before opening itUoti Urpala2012-02-281-19/+21
| | | | | | | Instead of opening avctx in preinit() and setting paramters later, (re)open it in config() where parameters can be set first. This fixes a failure to open the codec with new libavcodec versions that check pix_fmt during avcodec_open2().
* configure: remove obsolete messages for mtrr / no w32codecsUoti Urpala2012-02-281-28/+1
| | | | | | | | | | Remove "Please check mtrr settings at /proc/mtrr" and "NOTE: Win32 codec DLLs are not supported on your CPU" messages printed at the end of a configure run. mtrr should be irrelevant on today's machines, and the DLLs are a lot less important nowadays. Also remove mtrr detection logic that was only used to decide whether or not to print that message. Bizarrely, there were --enable-mtrr and --disable-mtrr options for this too (with no effect except for the message).
* vo: reject vo_redraw_frame() if no frames have been drawnUoti Urpala2012-02-282-1/+4
| | | | | | | | vo_xv crashed if existing frames had been lost due to a config() call in the middle of a file and vo_redraw_frame() was called. Add checks to reject vo_redraw_frame() unless at least one frame has been flipped after the the last configuration change, so individual VOs do not have to deal with this case.
* configure, build: support compiling without libpostprocUoti Urpala2012-02-275-6/+26
| | | | | | libpostproc has been removed from Libav and the library now exists as a separate project. Because it's not essential, separate it from the Libav library check and allow compiling without it.
* configure, ao_alsa: drop support for obsolete ALSA versionsUoti Urpala2012-02-276-695/+11
| | | | | Drop compatibility code for ALSA versions prior to 1.0.9. Change the configure check to use pkg-config only.
* configure: simplify pkg-config handling, drop other testsUoti Urpala2012-02-271-201/+46
| | | | | | | | | | | Add helper function pkg_config_add() that checks for the presence of a package and also adds cflags/ldflags if it is found. Change existing pkg-config-using feature tests to use that. Also change the freetype test that used a separate libfreetype-config binary before; using pkg-config instead helps cross-compiling. Drop other kinds of checks (such as test compiles) from these tests. It's possible that this could cause problems on some (broken) systems, but that can't be verified without user testing.
* demux_lavf: update growing file size info for AVSEEK_SIZEUoti Urpala2012-02-261-2/+5
| | | | | | | | demux_lavf was returning a static size value when libavformat queried file size with AVSEEK_SIZE. Add code to query the stream for possibly changed value first. This at least improves seeking with growing MPEG files; before seeks would never go beyond the part of the file that existed when the stream was first opened.
* osd: erase terminal OSD line with mp_msg() instead of printf()Uoti Urpala2012-02-251-1/+1
| | | | | | | | The terminal OSD line was written with mp_msg(MSGT_CPLAYER, ...) but erased with printf(). This meant that disabling MSGT_CPLAYER messages would prevent the terminal line from being printed, but a line (probably unrelated) would still be cleared. Change the clearing code to use mp_msg(MSGT_CPLAYER, ...) too.
* screenshot: fix libav API use (pix_fmt and some other things)wm42012-02-251-8/+13
| | | | | | | | | | | Libavcodec started checking that avctx->pix_fmt is set when opening an encoder. The existing code (originally from vf_screenshot.c) only set it afterwards, which now made screenshots fail. Fix the code to set parameters before calling avcodec_open2(). Also fix some minor things, which seems to make it work for other encoders. This could be used to add more libavcodec based image writers. Fix memory leak (missing av_free(avctx)).
* vd_ffmpeg: fix flushing of buffered framesUoti Urpala2012-02-032-5/+12
| | | | | | | | | The vd_ffmpeg decode() function returned without doing anything if the input packet had size 0. This meant that flushing buffered frames at EOF did not work. Remove this test. Have the core code skip such packets coming from the file being played instead (Libav treats 0-sized packets as flush signals anyway, so better assume such packets do not represent real frames with any codec).
* vd_ffmpeg: adjust buffered frame count based on threads againUoti Urpala2012-02-031-0/+2
| | | | | | | | | Libav has changed back to not modifying avctx->has_b_frames based on the extra buffering caused by thread use. Add back the code to do the adjustment on the player side once again. The timing mode using the buffering info is no longer the default, so in most cases having this right or not won't matter for playback.
* build: switch to libavutil bswap.h and intreadwrite.hUoti Urpala2012-02-0137-642/+113
| | | | | | | | | | | | Remove the private bswap and intreadwrite.h implementations and use libavutil headers instead. Originally these headers weren't publicly installed by libavutil at all. That already changed in 2010, but the pure C bswap version in installed headers was very inefficient. That was recently (2011-12) improved and now using the public bswap version probably shouldn't cause noticeable performance problems, at least if using a new enough compiler.
* demux_lavf: use Libav RIFF tag lists directlyUoti Urpala2012-02-015-400/+47
| | | | | | Change demux_lavf to use CodecID -> RIFF tag mappings that are now available through the public Libav API. Previously it used a copy in ffmpeg_files/taglists.c. That can now be deleted.
* Update Libav API usesUoti Urpala2012-02-0118-102/+96
| | | | | | | | | | | | | | | | | | | Change various code to use the latest Libav API. The libavcodec error_recognition setting has been removed and replaced with different semantics. I removed the "--lavdopts=er=<value>" option accordingly, as I don't think it's widely enough used to be worth attempting to emulate the old option semantics using the new API. A new option with the new semantics can be added later if needed. Libav dropped APIs that were necessary with all Libav versions until quite recently (like setting avctx->age), and it would thus not be possible to keep compatibility with previous Libav versions without adding workarounds. The new APIs also had some bugs/limitations in the recent Libav release 0.8, and it would not work fully (at least some avcodec options would not be set correctly). Because of those issues, this commit makes no attempt to maintain compatibility with anything but the latest Libav git head. Hopefully the required fixes and improvements will be included in a following Libav point release.
* Update copyright yearUoti Urpala2012-01-282-2/+2
|
* vd_ffmpeg: explicitly set thread count even if 1Uoti Urpala2012-01-171-2/+1
| | | | | | | | | | | Libav started automatically enabling threaded decoding a while ago. This is not safe, as it means callbacks can suddenly get called from other threads and outside calls to libavcodec. We need to know when threading will be used and disable thread-unsafe callbacks in those cases. Explicitly set thread count to 1 instead of leaving it at 0 (which triggers the autodetection) when we are not requesting more threads; this should make sure that autodetection on libavcodec side will not be used.
* stream_vcd: fix option value allocated with strdupUoti Urpala2012-01-161-2/+4
| | | | | | A string freed with m_struct_free() was allocated with strdup(). This would cause a crash when using vcd:// streams. Fix to use talloc_strdup().
* audio: change default preference order of AO driverswm42012-01-161-8/+8
| | | | | | | | | | | | | | | Now PulseAudio is preferred over ALSA, which in turn is preferred over OSS. This should give best results on all systems. On systems with PulseAudio, we will always use it natively, rather than through the suboptimal ALSA emulation (which the default ALSA output is normally redirected to when PulseAudio is active; ALSA hardware devices will not be, but to use those the user must set AO explicitly in any case, so changing the defaults makes no difference). The fallback from ao_pulse to ao_alsa causes no noticeable delay on systems without PulseAudio. On systems with ALSA, we won't attempt to use OSS anymore. Also, move OpenAL above SDL. OpenAL should generally work better than SDL.
* af_volume: do not change data when volume is 1wm42012-01-161-5/+4
| | | | | | | | | | | When the volume multiplier is 1, the data shouldn't be changed, but the code actually multiplied each sample with 255/256. Change the factor to 256, and hope there wasn't a good reason for the value 255. Additionally, don't work on the data if it wouldn't be changed anyway. This is a micro-optimization. This doesn't touch the code path for the float format.
* core: print pause status message only once on consolewm42012-01-102-31/+58
| | | | | | | | | | | Since the recent OSD redraw changes, every GUI expose event causes the message "===== PAUSE =====" to be printed on console. This was a bit annoying, so change it so that it is only printed once when going into paused mode. It's also printed again if the cache status changes (when playing URLs), or when the status line is printed during pause mode (when you seek while paused). This also removes some minor code duplication.
* osd: always display pause icon when frame steppingwm42012-01-092-2/+3
| | | | | | | When the OSD was enabled and the player was paused by executing the frame_step command, the OSD still displayed the icon indicating playback. Fix this and always set the proper icon when the pause state is changed.
* cleanup: remove left over access_mpcontext.h (from GUI)Uoti Urpala2012-01-092-61/+0
| | | | | | access_mpcontext.h and the declared functions in mplayer.c were only used by the now deleted internal GUI. Remove the unused header and functions.
* ad_ffmpeg: pass packet side data from libavformatUoti Urpala2012-01-084-18/+32
| | | | | Pass avpacket->side_data when using a libavcodec audio decoder together with libavformat demuxer (this was already done for video).
* vf_fspp: make compile without Libav internalsUoti Urpala2012-01-023-11/+9
| | | | | Make vf_fspp compile without using internal Libav/FFmpeg files and compile it by default.
* stream_ffmpeg: switch to libavformat avio APIUoti Urpala2012-01-021-19/+31
| | | | | | stream_ffmpeg was using the libavformat URLContext API. This API has been deprecated (for public use at least) in libavformat. Switch to the AVIOContext API.
* Libav API updates (remove most deprecated-in-0.7 uses)Uoti Urpala2011-12-223-42/+22
| | | | | | | | Update various code using Libav libraries to remove use of API features that were deprecated at Libav release 0.7. I think this removes them all with the exception of URLContext functions still used in stream_ffmpeg.c (at least other uses that generated deprecation warnings with libraries from 0.7 are removed).
* configure, build: require at least Libav 0.7Uoti Urpala2011-12-2212-78/+7
| | | | | | | | | | | | | | | | Require versions of the Libav libraries corresponding to Libav release 0.7. These are: libavutil 51.7.0 libavcodec 53.5.0 libavformat 53.2.0 libswscale 2.0.0 libpostproc 52.0.0 Also disable the fallback to simple header check if these libraries could not be found with pkg-config; now compiling without pkg-config support for these always requires explicitly setting --enable-libav and any needed compiler/linker flags. The simple check would have let compilation proceed even if a version mismatch was detected.
* vo_vdpau: fix preemption recovery after recent commitsUoti Urpala2011-12-201-25/+27
| | | | | | | Recent commits for screenshot support and video redraw changes didn't handle vdpau driver preemption state correctly, which could make the player crash if preemption occurred. Fix this and improve preemption handling a bit otherwise.
* vf_expand: always clear the added borderswm42011-12-191-93/+20
| | | | | | | | | | | | | | | | | | | | | | | | Using the "expand" filter makes the image area larger by adding borders to the video frame. These borders are supposed to be always black. The filter relied on the borders in its output buffer staying black without redrawing them for each frame. However, when using direct rendering, a video filter inserted after vf_expand can draw into these borders, for example the "unsharp" and "ass" filters. These changes incorrectly stayed visible in the the following video frames. Fix this by always clearing the borders in vf_expand. In some cases, this might be more work than necessary, but vf_expand has no way of detecting whether a subsequent filter draws into the borders or not, and this avoids fragile assumptions about the existing contents of the output buffer(s). This also deals with frame size changes when config() is called again. Before this commit, remains of the old video were visible if the new video frame size was smaller than before. Since we now always clear the borders, there's no more need for the complicated code that cleared only the regions that were covered by the OSD. Delete that.
* vf_dsize, vf_scale: fix behavior on multiple config() callswm42011-12-192-19/+26
| | | | | | When config() is called multiple times (e.g. aspect ratio changes while the same file is playing), the user settings are not honoured, because config() overwrites them. Don't do that.
* vf_dsize: cleanup identation (tabs to 4 spaces)wm42011-12-191-71/+71
|
* vo: reset EOSD change detection when VO is re-configuredwm42011-12-121-0/+3
| | | | | | | | | | | | | | | This fixes a crash with vo_gl when the switch_ratio slave command is used while a displaying an animated subtitle. switch_ratio will cause a config() call to vo_gl, which will reset all state, including the EOSD state. Next time the EOSD is rendered, its change detection will indicate that only subtitle positions have changed. The render code will attempt to access the EOSD data structures which have been deleted with config(). Fix this by forcing the change detection to indicate a full change if config() has been called. This only happens when doing switch_ratio with vo_gl, and the current subtitle is only changing positions, i.e. mp_eosd_images_t.changed == 1.
* configure, build: remove --disable-libav supportUoti Urpala2011-12-1116-97/+24
| | | | | Remove support for building the player without libavcodec and libavformat. These libraries are now always required.
* vo_vdpau: use new want_redraw mechanism in one more caseUoti Urpala2011-12-091-3/+1
|
* options: change --ass-hinting default to 0Uoti Urpala2011-12-071-1/+0
| | | | | | | With current typical video sizes, font sizes are large enough that they don't really need hinting (and particularly so for font sizes in display-resolution rendered subtitles in fullscreen mode), and hinting apparently causes problems with some fonts.
* Merge remote-tracking branch 'pigoz/gl'Uoti Urpala2011-12-073-13/+27
|\
| * vo_gl: cocoa: point swapinterval to cocoa_common functionStefano Pigozzi2011-12-063-0/+11
| | | | | | | | | | | | | | | | Currently there is no way to set the swap interval with a function that has a signature compatible with other platforms' gl extensions. Make a wrapper function around the gui toolkit method of setting the swap interval property, and point gl->SwapInterval to it.
| * vo_gl: cocoa: decouple cocoa_common from gl_commonStefano Pigozzi2011-12-063-13/+16
| | | | | | | | | | | | Remove the useless dependency on MPGLContext from cocoa_common, since it was used just to access the vo struct. Change gl_common to pass the vo struct directly to all the cocoa_common functions.
* | Merge remote-tracking branch 'wm4/window_title'Uoti Urpala2011-12-0715-62/+107
|\|
| * libvo: change default window title to "mplayer2"wm42011-12-062-2/+2
| | | | | | | | | | Also change the WM_CLASS "application class" string from "MPlayer" to "mplayer2". This string is visible as application name in Gnome 3.
| * x11: set window titles as UTF-8wm42011-12-062-3/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Always set the X11 window title properties as UTF-8. This is a bit tricky for X11 window properties which are not specified to use UTF-8, such as WM_NAME. We also properly set WM_ICON_NAME, which means the window caption and the text used in the task bar (of the WM has one) will be the same on most window managers. Before this commit, WM_ICON_NAME was always hardcoded to "MPlayer", even if --title or --use-filename-title was used. Also update the window title only on reconfigure, like it is done in mplayer-svn commit 34380.
| * libvo: remove title argument from struct vo_driver.configwm42011-12-0615-60/+50
| | | | | | | | | | | | | | | | | | | | This affects only the "new" VO API. The config() title argument was barely used, and it's hardcoded to "MPlayer" in vf_vo.c. The X11 and the Cocoa GUI backends, which are the only ones properly supporting window titles, ignored this argument. Remove the title argument. Add the vo_get_window_title function. All GUI VOs are supposed to use it for the window title.
* | ad_ffmpeg: avoid avcodec_close() if avcodec_open() failedUoti Urpala2011-12-061-1/+1
| | | | | | | | | | | | Avoid calling avcodec_close() in uninit() if avcodec_open() failed. Calling avcodec_close() on a non-open codec context causes a crash with recent Libav versions.
* | core: minor hrseek tweak (affects vo_vdpau deint frames)Uoti Urpala2011-12-061-3/+2
| | | | | | | | | | | | Remove no longer necessary tests from hrseek code. As a result each field of vo_vdpau framerate-doubling deinterlace modes is now considered as a possible seek target.
* | commands: playback speed: better responsiveness without audioUoti Urpala2011-12-061-3/+5
| | | | | | | | | | | | | | | | Adjust the scheduled time until next frame when changing playback speed (only affects behavior without audio). The main case where this makes a difference is when it would take a noticeably long time to switch frames with the previous speed and you switch to a faster speed.
* | core, vo: new window refresh logic, add slow-video OSD redrawUoti Urpala2011-12-066-74/+35
| | | |