summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* windows support: fix compilation with pthreadswm42012-12-112-1/+5
| | | | | | | | | | | | | | | 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.
* stream_lavf/demux_lavf: export/use HTTP MIME typewm42012-12-114-15/+34
| | | | | | | | | | | | | | | | | This is a fix for web radio streams that send raw AAC [1]. libavformat's AAC demuxer probe is picky enough to request hundreds of KBs data, which makes for a slow startup. To speed up stream startup, try use the HTTP MIME type to identify the format. The webstream in question sends an AAC specific MIME type, for which demux_lavf will force the AAC demuxer, without probing anything. ffmpeg/ffplay do the same thing. Note that as of ffmpeg commit 76d851b, av_probe_input_buffer() does the mapping from MIME type to demuxer. The actual mapping is not publicly accessible, and can only be used by calling that function. This will hopefully be rectified, and ideally ffmpeg would provide a function like find_demuxer_from_mime_type(). [1] http://lr2mp0.latvijasradio.lv:8000
* demux_lavf: make minimum probe score customizable, remove lavf_preferredwm42012-12-116-59/+43
| | | | | | | | | | | | | | | | | | | | | 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
* configure: remove --disable-sortsubwm42012-12-112-60/+4
| | | | | Apparently this was for debugging. There was a patch to remove it years ago, but it has been forgotten.
* stream: handle mms streaming with ffmpegwm42012-12-113-14/+23
| | | | | | | | | | | | | | | | | | | | Use ffmpeg (stream_lavf) instead of internal mms support (asf_streaming.c) for mms://, mmsh://, mmst:// URLs. The old implementation is available under mp_mms:// etc. There are some caveats with this: - mms:// now always maps to mmsh://. It won't try mmst://. (I'm not sure if mms:// URLs really can use the mmst protocol, though.) - MMS streams under the http:// prefix are not handled. (ffmpeg ticket #2001.) (Was already broken in mpv since c02f25.) - It downloads all video streams now. MMS streams often have redundant video streams, which encode the main stream at different quality. The client is supposed to select one according to its bandwidth requirements. (Explicit MMS stream selection has been broken in mpv for a while, because MPOpts.vid maps to the stream number, not the demuxer's stream ID - but the old logic doesn't work anyway when using demuxer_lavf as opposed to demux_asf.)
* sub: remove vobsub reader in favor of ffmpeg vobsub demuxerwm42012-12-1114-1205/+74
| | | | | | | | 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-113-13/+41
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* stream_dvd: add a stream_seek() callRudolf Polzer2012-12-071-0/+2
| | | | | This fixes use of -chapter together with -correct-pts and demux_lavf and stream_dvd.
* 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.
* Fix compilation with Libavwm42012-12-041-12/+13
| | | | Libav doesn't have 12/14 bit planar formats.
* 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.
* sub: clear libavformat demuxed subtitles on seekingwm42012-12-031-0/+6
| | | | | | libavformat demuxes ass subtitles in a broken way, that forces the player to throw away all subtitle events received so far. See mplayer svn commit 31293.
* audio: make AC3 pass-through with ad_spdif workreimar2012-12-034-24/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not fall back to 0 for samplerate when parser is not initialized. Might fix some issues with using -ac spdifenc with audio in MKV or MP4. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35517 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace outdated list of unsupported formats by list of supported formats. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35534 b3059339-0415-0410-9bf9-f77b7e298cf2 Do not call af_fmt2str on the same data over and over. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35535 b3059339-0415-0410-9bf9-f77b7e298cf2 ad_spdif: use the more specific AF_FORMAT_AC3_LE when we handle AC3. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35536 b3059339-0415-0410-9bf9-f77b7e298cf2 Make AF_FORMAT_IS_IEC61937 include AF_FORMAT_IS_AC3. Our AC3 "sample format" is also iec61937. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35537 b3059339-0415-0410-9bf9-f77b7e298cf2 af_format: support endianness conversion also for iec61937 formats in general, not just AC3. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35538 b3059339-0415-0410-9bf9-f77b7e298cf2 Conflicts: audio/filter/af_format.c af_format: Fix check_format, non-special formats are of course supported. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35545 b3059339-0415-0410-9bf9-f77b7e298cf2 Note: see mplayer bug #2110
* stream_ftp: cleanupsal2012-12-031-19/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | stream ftp: Pass full buffer size to snprintf Previously the buffer size was always passed as one less than the underlying buffer's size. This is not using the underlying buffer to its full potential according to the C99 standard. The last byte of the buffers were never used. No vulnerabilities should have been caused by this mistake because the strings stored in the buffers were zero terminated at all times. Neither were out-of-array writes nor reads possible. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35488 b3059339-0415-0410-9bf9-f77b7e298cf2 stream ftp: open_f: Mark parameter file_format unused We have nothing to say about it, so we do not set *file_format. No need for compilers to emit a warning about it. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35489 b3059339-0415-0410-9bf9-f77b7e298cf2 stream ftp: Set type to STREAMTYPE_STREAM Previously this was not set at all from within the stream_ftp module. This caused the run-time warning message "Streams need a type!". The actual behaviour should not be affected by this change. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35490 b3059339-0415-0410-9bf9-f77b7e298cf2 stream ftp: Use C99 designated initializers Simplify the initialization of the stream private struct's defaults. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35491 b3059339-0415-0410-9bf9-f77b7e298cf2 stream ftp: Remove unneeded cast At worst these kind of casts can hide real errors. As it is, it is just not needed at all, thus remove it. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35492 b3059339-0415-0410-9bf9-f77b7e298cf2
* audio: improve decoder open failure handlingUoti Urpala2012-12-033-15/+4
| | | | | | | | | | | | | | | | Reinitialize sh_audio->samplesize and sample_format before falling back to another audio decoder (some decoders rely on default values). Remove code setting these fields from demux_mkv and demux_lavf (no decoder should depend on demuxer-set values for these fields). Conflicts: audio/decode/ad_lavc.c Merged from mplayer2 commit 6b9567. The changes to ad_lavc.c are not merged, as they are very specific to the mplayer2 libavresample hack; we deplanarize manually, so we can't get unsupported sample formats yet (except on raw audio with "pcm_f64le", as we don't support AV_SAMPLE_FMT_DBL in the audio chain).
* subreader: fix some of ASS parser issuesUoti Urpala2012-12-031-45/+22
| | | | | | | | | | | | | | | | | | The subreader.c ASS parser (used when playing an external ASS subtitle file with --no-ass for "plaintext" display) hardcodes dialogue line syntax instead of correctly reading it from the "Format: " line in the file, but tried to support a varying amount of fields by guessing where the text field (which should be last) begins. This guessing code was buggy in many ways. Remove it and hardcode skipping 9 commas before the text field, which should work for most files. I don't consider the --no-ass case important enough to implement correct parsing now. Also fix the code removing formatting tags, which failed to remove the second in a pair of two consecutive tags. Conflicts: sub/subreader.c Merged from mplayer2 commit 91f516. Essentially reverts d5b964.
* subs: remove --utf8, simplify codeUoti Urpala2012-12-035-28/+6
| | | | | | | | | | | | | | | | | | | 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-038-5/+66
| | | | | | | | | | | | | | | 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.
* stream_lavf: use ffmpeg for http/https streamingwm42012-12-032-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The internal mplayer http implementation is terrible and old. Try to use ffmpeg instead. Enable ffmpeg https as well (we don't have native support for it and never will). Enable the cache for ffmpeg streams. In theory, we want to enable the cache for network streams only (or at least, not enable it for files), but there doesn't seem to be any way to query this. ffmpeg has its own read-cache, but apparently it doesn't get filled asynchronously (only to the degree internal socket/kernel buffers do). Should it turn out that the mplayer implementation is better than ffmpeg's in some way (unlikely), this commit might be reverted until ffmpeg is ready. So far, the ffmpeg implementation seems to work very well though. The original mplayer stream implementation is made available under "mp_http://" and "mp_http_proxy://". This is for testing, until the http implementation is completely removed. Note that this is unlikely to happen soon: ffmpeg doesn't support Microsoft streaming, while mplayer has some support. This code has dependencies on http. Note: "http_proxy://" doesn't work anymore. Use "httpproxy://" to get the ffmpeg implementation of it. Using https requires enabling OpenSSL in ffmpeg by adding the --enable-openssl switch to ffmpeg's configure.
* cache: simplify furtherwm42012-12-039-42/+45
| | | | | | | | | | | | 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-0311-55/+41
| | | | | | | | | | | | | | | | | | | | | | | | 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).
* video: add support for 12 and 14 bit YUV pixel formatsStephen Hutchinson2012-12-036-3/+95
| | | | | | | | | | | | Based on a patch by qyot27. Add the missing parts in mp_get_chroma_shift(), which allow allocation of such images, and which make vo_opengl automatically accept the new formats. Change the IMGFMT_IS_YUVP16_LE/BE macros to properly report IMGFMT_444P14 as supported: this pixel format has the highest numerical bit width identifier (0x55), which is not covered by the mask ~0xfc. Remove 1 bit from the mask (makes it 0xf8) so that IMGFMT_IS_YUVP16(IMGFMT_444P14) is 1. This is slightly risky, as the organization of the image format IDs (actually FourCCs + mplayer internal IDs) is messy at best, but it should be ok.
* build: identify the build time of the binary in the versioning outputStephen Hutchinson2012-12-034-1/+7
| | | | | | | | | | 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_gif: remove this demuxer in favor of libavformatwm42012-12-034-437/+0
| | | | | The gif support in libavformat/libavcodec as of ffmpeg commit 5603b2 can handle animated gif. The internal demuxer is not needed anymore.
* demux_lavf: add support for libavdevicewm42012-12-038-25/+151
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* demux_lavf: do not prefix filename passed to libavformat with "mp:"wm42012-12-031-8/+9
| | | | | | | | | | | | | | | Opening files with the libavformat AVISynth demuxer ("avs"/avisynth.c) fails, because the filename we pass to avformat_open_input() is prefixed with "mp:". Normally, this doesn't matter, because data is read with the stream interface. The AVISynth demuxer can't use this, because the Avisynth API (apparently) can't read scripts from memory, and requires a filename. The "mp:" prefix used to be required when mplayer's stream layer was made available as protocol to ffmpeg. This was replaced by setting custom stream callbacks in de4908 (svn commit 25499), but the prefix wasn't removed. Since this prefix doesn't have any purpose anymore and prevents AVS playback from functioning, remove it. Fixes #5.
* vo_xv: try harder to get correctly aligned pointers/strideswm42012-12-031-4/+6
| | | | | | | | | | | | | | | | | | | | To get guaranteed alignment for the chroma planes with typical YV12 playback, we have to double the alignment on the image width, as the chroma planes have half the image width. Clear the image with black instead of green to hide scaling artifacts on the right border of the screen. (It might be possible to create the image layout ourselves by not calling XvShmCreateImage(), and filling in our own image width and exact strides, but that's probably too risky: the Xv client library sends an X protocol request to query the real image dimension and strides. It is unknown to me whether X servers or drivers would generally accept an image with mismatching parameters, even if the image is conceptually valid.) Allocate the image with av_malloc() in the non-SHM case. I suspect the non-SHM case doesn't matter much, though.
* configure: don't check for inttypes.h, it always existswm42012-12-032-20/+0
| | | | | | | | The presence of inttypes.h is guaranteed by POSIX. We don't need to check for it. We don't need to provide a compatibility header either. Apparently libc5 systems didn't provide inttypes.h. libc5 is ancient, unmaintained, and not used by modern Linux systems.
* configure: remove unused libpng detectionwm42012-12-031-29/+0
|
* ao_pcm: fix references to -novideowm42012-12-033-9/+3
| | | | | | | | | | | The option is -no-video. Remove the deprecated "fast" suboption, which did nothing and instructed the user to use "-novideo" instead. Fix a reference to -novideo in encoding.rst. Add a "generic" entry about -no-* to the list of renamed options. The change is already explicitly mentioned in the text above the table, but even if it's redundant, it makes it harder to overlook.
* af_lavcac3enc, encode: support planar formatsRudolf Polzer2012-12-034-7/+138
| | | | | | | This fixes operation with current ffmpeg releases. Note that this planarization is slow and should be reverted once proper planar audio support is there in mpv.
* osx_common: Avoid deprecated Gestalt callsStefano Pigozzi2012-12-022-17/+27
| | | | | | | | Gestalt is deprecated since 10.8. Change the code to read the OS version from a system plist file. As mentioned http://stackoverflow.com/a/11072974/499456 Apple engineers are suggesting this plist reading approach.
* encoding-example-profiles: updates, iphone 5 supportRudolf Polzer2012-12-012-5/+13
| | | | | Now the scaling for iPhones properly optimizes for the zoomed-in (pan-scan) view.
* encoding-example-profiles: fix aac bitrateRudolf Polzer2012-12-011-2/+0
| | | | | Now the enc-to-iphone profiles no longer specify the aac bitrate explicitly (128k), but take over the default from enc-a-aac (96k).
* encoding-example-profiles: use 96kbps aacRudolf Polzer2012-12-011-2/+1
| | | | | Previously it used 128kbps libfaac by default, but now that we have libfdk_aac, we can default to 96kbps at better quality than before.
* 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.
* DOCS: Add manpage metadata to the rst files.Rudolf Polzer2012-11-291-2/+13
| | | | This fixes the manpage indent issues.
* DOCS: Fix some rst error messagesRudolf Polzer2012-11-292-16/+17
| | | | Unfortunately, these do not fix the man page indent issue.
* subassconverter: correctly handle RRGGBB and unknow formatsStefano Pigozzi2012-11-251-22/+31
| | | | | | | The following HEX formats are now parsed correctly: `#RRGGBB`, `RRGGBB`. Moreover this implementation doesn't show the HTML on screen if the input color is not recognized. A warning is still displayed in the terminal.
* 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-257-3/+51
| | | | | | | | | | MPlayer/mplayer2 still show DVD subtitles in gray. Depending on who you ask, this can be considered a bug or a featu