summaryrefslogtreecommitdiffstats
path: root/core
Commit message (Collapse)AuthorAgeFilesLines
* Fix lots of bugs in mp_http URL handlingRudolf Polzer2013-01-101-2/+12
| | | | | Many instances of "http" were not changed to "mp_http", which made many aspects of the mp_http protocol handler broken.
* mplayer: make --loop loop the playlist instead of each playlist entrywm42013-01-092-32/+9
| | | | | | | | | | This is simpler and more useful. We could add a new switch for the old functionality, but that would probably be more confusing than helpful. When passing only a single file to the command line, this commit shouldn't change behavior. (Classic mplayer provided both features by duplicating the loop functionality in the "playtree".)
* mplayer: keep pause state when frame stepping in last framewm42013-01-091-0/+3
| | | | | | | When the last frame is displayed, and a frame step command is issued, playback ands and advances to the next file. But before this commit, the next file was played unpause. Fix this, and make sure pause is kept.
* sub: use correct fallback font for subtitleswm42013-01-061-1/+2
| | | | Accidentally still used the OSD font.
* sub: add --sub-text-* options to unstyled text subtitles fontwm42013-01-052-0/+4
| | | | | | | Before this commit, the --osd-* options (like --osd-font-size etc.) configured both the OSD and subtitle font. Make them separate, and add --sub-text-* options (like --sub-text-size etc.). Now --osd-* affects the OSD font only, and --sub-text-* unstyled text subtitles only.
* Update copyright yearwm42013-01-041-1/+1
|
* core: fix crash if VO init failswm42012-12-281-1/+1
|
* sdl, encode_lavc: fix copyright headersRudolf Polzer2012-12-282-4/+6
| | | | | | Some of them had changes in 2012; extend their header. Fix project name.
* core: make WAKEUP_PERIOD overridable by the voRudolf Polzer2012-12-191-12/+26
| | | | | | | | | | | | This is better than having just the operating system type decide the wakeup period, as e.g. when compiling for Win32/cygwin, a wakeup period of 0.5 would work perfectly fine. Instead, the default wakeup period is now only decided by availability of a working select() system call (which is the case on cygwin but not mingw and MSVC) AND a vo that can provide an event file descriptor or a similar hack (vo_corevideo). vos that cannot do either need polling for event handling and now can set the wakeup period to 0.02 in the vo code.
* path: add mp_find_config_file and reorganize some of the codeStefano Pigozzi2012-12-154-87/+77
| | | | | | | | | | | | | | Add `mp_find_config_file` to search different known paths and use that in ass_mp to look for the fontconfig configuration file. Some incidental changes spawned by this feature where: * Buffer allocation for the strings containing the paths is now performed with talloc. All of the allocations are done on a NULL context, but it still improves readability of the code. * Move the OSX function for lookup inside of a bundle: this code path was currently not used by the bundle generated with `make osxbundle`. The plan is to use it again in a future commit to get a fontconfig config file.
* core: path: run uncrustifyStefano Pigozzi2012-12-151-80/+86
| | | | | | | | | | Even if this is not so bad as other files, I need to add some stuff so... why not!? `uncrustify -l C -c TOOLS/uncrustify.cfg --no-backup --replace core/path.h` `uncrustify -l C -c TOOLS/uncrustify.cfg --no-backup --replace core/path.c` The header was unchanged by the tool.
* options: move -ass-bottom-margin/-ass-top-margin options to vf_subwm42012-12-122-4/+0
| | | | | These options might be useful sometimes, but they are not that important, and work with vf_sub only. Make them vf_sub sub-options.
* cleanup: remove ao.brokenptswm42012-12-121-7/+0
| | | | This field was used by ao_v4l2, and is now unused.
* options: handle -v during pre-parsing command linewm42012-12-121-5/+2
| | | | | Otherwise -v is honored too late, and some output will be missing. In particular, this prevented printing of the libav* library versions.
* sd_lavc: keep subs on subtitle track switchingwm42012-12-121-1/+1
| | | | | | | | | | | | | Keep the currently displayed subtitles even when the user cycles through subtitle tracks, and the subtitle is decoded by libavcodec (such as vobsubs). Do this by not clearing the subtitles on reset(). reset() is also called on seek, so check the start PTS whether the subtitle should really be displayed (there's already an end PTS). Note that sd_ass does essentially something similar. The existing code has checks for whether the PTS reported by the demuxer is invalid (MP_NOPTS_VALUE). I don't know under what circumstances this can happens, so fall back to the old behavior if the PTS is invalid.
* mplayer: prefer audio PTS over video PTS for status linewm42012-12-111-3/+3
| | | | | | | | | | | | This slightly improves display of the current playback time in files with sparse video packets (like video tracks containing a slow MJPG slideshows as in [1]), or audio files with cover art image attachments. While the video PTS is always "stuck" at the last frame displayed or the last seek, audio is usually continuous. Given sane samplerates and working audio drivers (to query how much of the current audio buffer has been played), the audio PTS should always be more reliable. [1] http://www.podtrac.com/pts/redirect.mp3/traffic.libsyn.com/rtpodcast/Rooster_Teeth_Podcast_191.m4a
* core: allow disabling display of "album art" in audio fileswm42012-12-115-5/+18
| | | | | | | | | | | | | | | | | | ffmpeg pretends that image attachments (such as contained in ID3v2 metadata) are video streams. It injects the attached pictures as packets into the packet stream received with av_read_frame(). Add the --audio-display option to allow configuring whether attached pictures should be displayed. The default behavior doesn't change (images are displayed). Identify video streams, that are actually image attachments, with "[P]" in the terminal output. Modify the default stream selection such that real video streams are preferred over attached pictures. (This is just for robustness; I do not know of any samples where images are added before actual video streams and could lead to bad default stream selection with the old code.)
* windows support: fix compilation with pthreadswm42012-12-111-0/+4
| | | | | | | | | | | | | | | This caused errors like: core/mplayer.c:4308:5: error: implicit declaration of function 'pthread_win32_thread_detach_np' [-Werror=implicit-function-declaration] It turns out a pthread.h include was missing. It's not clear why this used to work (or rather, why it happens only sometimes). Possibly some libraries or system headers recursively include pthread.h under certain circumstances or configurations. Fix missing quoting in configure, which led to broken terminal output. Closes #6.
* mplayer: make --length work if --start is missingwm42012-12-111-1/+1
| | | | In this case, --start should default to 0 obviously.
* demux_lavf: make minimum probe score customizable, remove lavf_preferredwm42012-12-111-0/+1
| | | | | | | | | | | | | | | | | | | | | libavformat wants to read a full ~400KB of data to determine whether it's really AAC. This causes slow startup with AAC web radio streams [1] (possible due to a broken initial packet). There are similar issues with other file formats. Make the probe "score" (libavformat's mechanism for testing file formats) configurable with the -lavfdtops:probescore option. This allows lowering the amount of data read on probing. If the probe score is below the probescore option value, demux_lavf will try to get a higher score by feeding more data to libavformat, until the required score or the max. probe size is reached. Remove the lavf_preferred demuxer entry. This had a purpose in mplayer-svn, but now there doesn't seem to be any good reason for it to exist. Make sure that our native "good" demuxers are above demux_lavf in demuxer_list[] instead (so that they are preferred). [1] http://lr2mp0.latvijasradio.lv:8000
* sub: remove vobsub reader in favor of ffmpeg vobsub demuxerwm42012-12-115-115/+28
| | | | | | | | ffmpeg recently added a demuxer that can read vobsubs (pairs of .sub and .idx files). Get rid of the internal vobsub reader, and use the ffmpeg demuxer instead. Sneak in an unrelated manpage change (autosub default).
* core: improve seeking in external fileswm42012-12-111-11/+27
| | | | | | | | | | | | | | | | | | | | | | | | This affects streams loaded with -subfile and -audiofile. They could get out of sync when they were deselected, and the main file was seeked. Add code to seek external files when they are selected (see init_demux_stream()). Use avformat_seek_file() under certain circumstances. Both av_seek_frame() ("old" API) and avformat_seek_file() ("new" API) seem to be broken with some formats. At least the vobsub demuxer doesn't implement the old API (and the old API doesn't fallback to the new API), while the fallback from new API to old API gives bad results. For example, seeking forward with small step sizes seems to fail with the new API (tested with Matroska by trying to seek 1 second forward relative to priv->last_pts). Since only subtitle demuxers implement the new API anyway, checking whether iformat->read_seek2 is set to test whether the old API is not supported gives best results. This is a hack at best, but makes things work. Remove backwards seeking on seek failure. This was annoying, and only was there to compensate for obscure corner cases (see 1ad332). In particular, files with completely broken seeking that used to skip back to the start on every seek request may now terminate playback.
* sub: use ffmpeg decoder for DVD subswm42012-12-101-1/+47
| | | | | | | | | | | | | | | | | Do this only if demux_lavf is used. Using demux_mpg and the ffmpeg DVD subtitle decoder doesn't work. The problem is probably that demux_mpg doesn't join split sub packets, while demux_lavf does. The internal DVD sub decoder (spudec.c) can, while ffmpeg's dvdsub can't. I do not know whether this is the actual problem. If DVD playback is used, create "fake" vobsub-style text extradata (like .idx files) to pass resolution and palette information to the ffmpeg decoder. We could use the "palette" AVOpt and avcodec_set_dimensions() instead, but it's actually simpler this way. Note that the decoder doesn't parse any other fields. Also note that DVD playback still uses demux_mpg by default, so this code is inactive unless -demuxer lavf is specified. This is mainly preparation for the case when we manage to get rid of demux_mpg for DVD playback.
* core/cfg-mplayer: fix segfault when using DVD subsRudolf Polzer2012-12-051-1/+1
| | | | | | The option sub-forced-only was accidentally renamed back to forcedsubsonly in commit 72205635abe7, causing a segfault in mp_property_generic_option due to missing option.
* input: do not generate double clicks for mouse wheelwm42012-12-031-1/+1
| | | | | | | | | Button 3 and 4 are mapped to the mouse wheel. Double click events for them annoying and not useful at all. I don't know about buttons 5-19; for all I know these could be mapped to wheels as well. Even if not, double click events are probably not very important for these. Disable double clicks for these as well.
* subs: remove --utf8, simplify codeUoti Urpala2012-12-031-2/+1
| | | | | | | | | | | | | | | | | | | Remove the options --utf8 and --unicode which had no effect any more (what they once did should be doable with --subcp). The only use of corresponding variables left in code was subreader.c code using sub_utf8 as a flag indicating whether iconv conversion was active. Change the code to test the existence of iconv context instead. Conflicts: DOCS/man/en/options.rst core/cfg-mplayer.h sub/sub.c sub/sub.h sub/subreader.c Merged from mplayer2 commit ea7311. Note: --unicode was already removed
* core: automatically pause on low cachewm42012-12-035-3/+47
| | | | | | | | | | | | | | | When the cache fill status goes below a certain threshold, automatically pause the player. When the cache is filled again, unpause again. This is intended to help with streaming from http. It's better to pause a while, rather than exposing extremely crappy behavior when packet reads during decoding block the entire player. In theory, we should try to increase the cache if underruns happen too often. Unfortunately, changing the cache implementation would be very hard, because it's insane code (forks, uses shared memory and "volatile" etc.). So for now, this just reduces the frequency of the stuttering if the network is absolutely too slow to play the stream in realtime.
* cache: simplify furtherwm42012-12-031-8/+17
| | | | | | | | | | | | This commit is separate from the previous one to separate our own changes from changes merged from mplayer2 (as far as that was possible). Make it easier for stream implementations to request being cached. Set a default cache size in stream.c, and remove them from various stream implementations. Only MS streaming support sets a meaningful cache size. Make querying cache size saner. This reduces the amount of #ifdefs needed.
* cache: refactor how cache enabling is doneUoti Urpala2012-12-033-28/+17
| | | | | | | | | | | | | | | | | | | | | | | | Code enabling the cache by default for network streams did that by modifying the value of the "cache" option. This wasn't sane, as multiple streams may be created and all share the same options. Change the code to not modify options but store data in the stream instance instead. Conflicts: core/mplayer.c demux/demux.c stream/cache2.c stream/network.c stream/network.h stream/pnm.c stream/stream.c stream/stream_rtp.c Merged from mplayer2 commit e26070. Note that this doesn't solve any actual bug, as the playlist crashing bug has been fixed before. Since the global cache size option value is not overwritten anymore, the option doesn't need to be restored on end of playback (M_OPT_LOCAL).
* build: identify the build time of the binary in the versioning outputStephen Hutchinson2012-12-033-1/+3
| | | | | | | | | | Based on a patch by qyot27. Add export LC_ALL=C on top of version.sh to make the output locale independent. Note that the build time will not be updated on every "make" invocation, but only when the git revision is updated. This is a good thing, as repeated make invocations should not rebuild the binary. (This would break "sudo make install" too.)
* demux_lavf: add support for libavdevicewm42012-12-031-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libavdevice supports various "special" video and audio inputs, such as screen-capture or libavfilter filter graphs. libavdevice inputs are implemented as demuxers. They don't use the custom stream callbacks (in AVFormatContext.pb). Instead, input parameters are passed as filename. This means the mpv stream layer has to be disabled. Do this by adding the pseudo stream handler avdevice://, whose only purpose is passing the filename to demux_lavf, without actually doing anything. Change the logic how the filename is passed to libavformat. Remove handling of the filename from demux_open_lavf() and move it to lavf_check_file(). (This also fixes a possible bug when skipping the "lavf://" prefix.) libavdevice now can be invoked by specifying demuxer and args as in: mpv avdevice://demuxer:args The args are passed as filename to libavformat. When using libavdevice demuxers, their actual meaning is highly implementation specific. They don't refer to actual filenames. Note: libavdevice is disabled by default. There is one problem: libavdevice pulls in libavfilter, which in turn causes symbol clashes with mpv internals. The problem is that libavfilter includes a mplayer filter bridge, which is used to interface with a set of nearly unmodified mplayer filters copied into libavfilter. This filter bridge uses the same symbol names as mplayer/mpv's filter chain, which results in symbol clashes at link-time. This can be prevented by building ffmpeg with --disable-filter=mp, but unfortunately this is not the default. This means linking to libavdevice (which in turn forces linking with libavfilter by default) must be disabled. We try doing this by compiling a test file that defines one of the clashing symbols (vf_mpi_clear). To enable libavdevice input, ffmpeg should be built with the options: --disable-filter=mp and mpv with: --enable-libavdevice Originally, I tried to auto-detect it. But the resulting complications in configure did't seem worth the trouble.
* encode: print on log which muxers/codecs are in useRudolf Polzer2012-12-011-0/+12
| | | | | | This is consistent with the demuxer/decoder info output mpv already has, and is also generally useful to know, especially if using --ao=codec1,codec2,... syntax.
* mplayer: fix track language displaywm42012-11-251-1/+2
| | | | | | This caused e.g. "--alang=" (without anything following) to be printed in the terminal output when the file specified no language for the track. Introduced by commit 9085b8.
* sub: add --sub-gray option to display image subs in grayscalewm42012-11-252-0/+2
| | | | | | | | | | MPlayer/mplayer2 still show DVD subtitles in gray. Depending on who you ask, this can be considered a bug or a feature. Include rendering in gray as explicit feature, so the user can decide what is better. This affects all indexed sub bitmaps entering the OSD rendering path. Currently, this means all image subs are affected by this option, but nothing else.
* sub: reimplement -spugauss as --sub-gausswm42012-11-252-0/+2
| | | | | | | | | | | | | | | | Apparently the -spugauss option was popular. The code originally implementing this is gone (scaler stuff in spudec.c). Reimplement it using libswscale to scale and blur image subtitles if the --sub-gauss option is set. The code does some rather lazy padding to allow the blur to spread pixels past the original image bounding box. (This problem exists with normal bilinear scaling too, but is barely noticable.) Technically, this doesn't just blur subtitles, but anything RGBA (or indexed) that enters the OSD rendering path. But only image subtitles produce these OSD formats currently, so no explicit check is done to prevent blurring in other cases.
* screenshot: add subs even with vf_screenshotwm42012-11-211-5/+11
| | | | | | | | | | | | | | Until now, screenshots with the video filter didn't add subs (unclear whether that was an oversight or feature). Fix this and make behavior when taking screenshots with vf_screenshot more consistent with VO screenshots. The change in vf_screenshot is needed, because add_subs() checks this flag to decide whether it's allowed to mutate the image. This commit has another user visible side effect. When taking a screenshot each frame (using the "each-frame" mode of the screenshot command), a normal screenshot command will stop the each-frame mode.
* video: fix bogus uses of mp_image.w/widthwm42012-11-211-2/+2
| | | | | | | | | | | | | | | | | mp_image has this confusing distinction between the w/h and width/height fields. w/h are the actual width and height, while width/height have a very special meaning inside the video filter code: it's the actually allocated width, which is also used for stride padding. Screenshot related code abused the w/h fields to store the aspect corrected size. Some code confused the role of w/h and width/height. Fix these issues. For aspect corrected size, display_w/h are used, while width/height should never be used outside vf.c internals and related code. This also fixes an actual bug when taking screenshots of anamorphic video with vf_screenshot, as well as using vo_image with such videos.
* cfg-config: avoid warning with -Wincompatible-pointer-typesStefano Pigozzi2012-11-211-1/+1
| | | | | This was throwing off a warning with clang. Add a cast to (void *) like many other options do.
* core: minor cleanupswm42012-11-202-3/+4
| | | | | | | Enable printf format warnings for set_osd_[t]msg. Remove the pointless assertion in mplayer.c (the assertion proved that the following NULL check is probably pointless, but leave that check anyway for robustness - it's not really clear whether it's needed).
* osd: fix OSD status symbol display in some caseswm42012-11-204-14/+22
| | | | | | | | | | | | | | | | | | | | | The playback status symbol in the OSD status display on video (such as displayed when seeking or with the show_progress input command) sometimes kept displaying the last seek, without resetting the symbol. (For example: disable the OSD, seek, enable the OSD, run show_progress; but also other cases.) The main reason for that was the code clearing the OSD bar is also responsible for clearing the osd_function (which stores the playback symbol). If no OSD bar was set, the osd_function was never reset. Fix by always setting the timer for clearing the OSD bar and the osd_function whenever the osd_function is set. Clearing the OSD bar when it wasn't set is OK. If the OSD bar is set some time after osd_function is set, the timer is overwritten - that's a good thing, as it makes both disappear from the screen at exactly the same time. Always reset osd_function to 0 and determine the playback status explicitly from mpctx->paused when displaying the status on screen.
* command: use yes/no instead of enabled/disabled for consistencywm42012-11-201-4/+2
| | | | | The idea is that the OSD uses the same names as the options, if possible.
* mplayer: disable auto-loading of external codecs.confwm42012-11-204-21/+6
| | | | | | | | | | Do not load codecs.conf files located in $PREFIX/etc/mpv/ or ~/.mpv/. There really is no use for this, other than possibly breaking things. It's still possible to use --codecs-file explicitly to load an external config file, and this option can be used in ~/.mpv/config. While we're at it, remove the global codecs_file variable, and another unused variable.
* m_option: print valid integer range for choices on parsing errorswm42012-11-201-0/+2
| | | | | | | | | Only some choices have an additional integer range. For those which do, printing the choices only would be confusing. E.g. --cursor-autohide accepts the choices "always", "no", or an integer value. The help text printed on option parse errors should print the accepted integer range additional to "always" and "no".
* osd: make the OSD and sub font more customizablewm42012-11-205-36/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make more aspects of the OSD font customizable. This also affects the font used for unstyled subtitles (such as SRT), or when using the --no-ass option. This adds back some customizability that was lost with commit 74e7a1 (osd: use libass for OSD rendering). Removed options: --ass-border-color --ass-color --font --subfont --subfont-text-scale Added options: --osd-color --osd-border --osd-back-color --osd-shadow-color --osd-font --osd-font-size --osd-border-size --osd-margin-x --osd-margin-y --osd-shadow-offset --osd-spacing --sub-scale The font size is now specified in pixels as it would be rendered on a window with a height of 720 pixels. OSD and subtitles are always scaled with the window height, so specifying or expecting an absolute font size doesn't make sense. Such scaled pixel units are used to specify font border etc. as well. (Note: the font size is directly passed to libass. How the fonts are actually rasterized is outside of our control, but in theory ASS font sizes map to "script" pixels and then are scaled to screen size.) The default settings should be about the same, with slight difference due to rounding to the new scales. The OSD and subtitle fonts are not separately configurable. It has limited use and would double the number of newly added options, which would be more confusing than helpful. It could be easily added later, should the need arise. Other small details that change: - ASS_Style.Encoding is not set to -1 for subs anymore (assuming subs use VSFilter direction in -no-ass mode too) - use a different WrapStyle for OSD - ASS forced styles are not applied to OSD
* m_option: add color option typewm42012-11-202-0/+54
| | | | | | | | | | | This accepts HTML-style hex colors in the form #RRGGBB. It's also possible to provide an alpha component with #AARRGGBB. Each 2-digit group is a hex number, which gives the color value from 0-255 (e.g. There is existing code in subassconvert.c, which parses HTML-style color values in SRT subs. This is not used: it's probably better if option parsing is completely separate from code specific to certain subtitle formats, even if a little code is duplicated.
* core: fix crash when video filter returns inf as PTSwm42012-11-201-1/+1
| | | | |