summaryrefslogtreecommitdiffstats
path: root/libmpdemux
Commit message (Collapse)AuthorAgeFilesLines
* video, audio: use lavc decoders without codecs.conf entriesUoti Urpala2012-07-243-27/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for using libavcodec decoders that do not have entries in codecs.conf. This is currently only used with demux_lavf, and the codec selection is based on codec_id returned by libavformat. Also modify codec-related terminal output somewhat to make it use information from libavcodec and avoid excessively long default output. The new any-lavc-codec support is implemented with codecs.conf entries that invoke vd_ffmpeg/ad_ffmpeg without directly specifying any libavcodec codec name. In this mode, the decoders now instead select the libavcodec codec based on codec_id previously set by demux_lavf (if any). These new "generic" codecs.conf entries specify "status buggy", so that they're tried after any specific entries with higher-priority status. Add new directive "anyinput" to codecs.conf syntax. This means the entry will always match regardless of fourcc. This is used for the above new codecs.conf entries (so the driver always gets to decide whether to accept the input, and will fail init() if it can't find a suitable codec in libavcodec). Remove parsing support for the obsolete codecs.conf directive "cpuflags". This directive has not had any effect and has not been used in default codecs.conf since many years ago. Shorten codec-related terminal output. When using libavcodec decoders, show the libavcodec long_name field rather than codecs.conf "info" field as the name of the codec. Stop showing the codecs.conf entry name and "vfm/afm" name by default, as these are rarely needed; they're now in verbose output only. Show "VIDEO:" line at VO initialization rather than at demuxer open. This didn't really belong in demuxer code; the new location may show more accurate values (known after decoder has been opened) and works right if video track is changed after initial demuxer open. The vd.c changes (primarily done for terminal output changes) remove round-to-even behavior from code setting dimensions based on aspect ratio. I hope nothing depended on this; at least the even values were not consistently guaranteed anyway, as the rounding code did not run if the video file did not specify a nonzero aspect value.
* build: use python3 to generate some files previously in gitUoti Urpala2012-07-162-901/+0
| | | | | | | | | | | | Some files used during build are generated with Python scripts in TOOLS/. Before, the generated files were included in the git tree. Start creating them at build time. This introduces a build-dependency on python3. The files in question are: libvo/vdpau_template.c libmpdemux/ebml_types.h libmpdemux/ebml_defs.c
* demux_lavf: try harder to make up a frame rateUoti Urpala2012-04-141-2/+16
| | | | | | | | | | | | Frame rate information is mostly irrelevant for playback, but it's needed at least to convert frame numbers used in some subtitle formats (like MicroDVD) into timestamps. Libavformat stopped making up a frame rate if no "reliable" information is available (commit 7929e22bd "lavf: don't guess r_frame_rate from either stream or codec timebase", 1.5 months ago). This caused a regression with AVI files and MicroDVD subtitles. Add a heuristic similar to what libavformat used to have, to make up FPS values which should work at least for the AVI+MicroDVD use case.
* cosmetics: misc minor cleanupsUoti Urpala2012-03-251-1/+1
| | | | | The deleted ZRM* things were only relevant to vo_zr, which was deleted earlier.
* windows support: unicode filenameswm42012-03-092-15/+17
| | | | | | | | | | | | | | | | | | | Windows uses a legacy codepage for char* / runtime functions accepting char *. Using UTF-8 as the codepage with setlocale() is explicitly forbidden. Work this around by overriding the MSVCRT functions with wrapper macros, that assume UTF-8 and use "proper" API calls like _wopen etc. to deal with unicode filenames. All code that uses standard functions that take or return filenames must now include osdep/io.h. stat() can't be overridden, because MinGW-w64 itself defines "stat" as a macro. Change code to use use mp_stat() instead. This is not perfectly clean, but still somewhat sane, and much better than littering the rest of the mplayer code with MinGW specific hacks. It's also a bit fragile, but that's actually little different from the previous situation. Also, MinGW is unlikely to ever include a nice way of dealing with this.
* cleanup: Silence compilation warnings on MinGW-w64wm42012-03-011-0/+2
| | | | | | | | | | | | | | | | | | | 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.
* 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]
* 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.
* build: switch to libavutil bswap.h and intreadwrite.hUoti Urpala2012-02-019-37/+43
| | | | | | | | | | | | 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-013-26/+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-014-24/+21
| | | | | | | | | | | | | | | | | | | 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.
* ad_ffmpeg: pass packet side data from libavformatUoti Urpala2012-01-082-4/+5
| | | | | Pass avpacket->side_data when using a libavcodec audio decoder together with libavformat demuxer (this was already done for video).
* Libav API updates (remove most deprecated-in-0.7 uses)Uoti Urpala2011-12-221-23/+19
| | | | | | | | 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-223-30/+0
| | | | | | | | | | | | | | | | 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.
* configure, build: remove --disable-libav supportUoti Urpala2011-12-114-28/+0
| | | | | Remove support for building the player without libavcodec and libavformat. These libraries are now always required.
* core, demux: fix --identify chapter output with ordered chapterswm42011-10-252-47/+4
| | | | | | | | | | | | | | | Information about individual chapters was printed during demuxer opening phase, and total chapter count (ID_CHAPTERS) was printed according to mpctx->demuxer->num_chapters. When playing a file with ordered chapters, this meant that chapter information about every source file was printed individually (even though only the chapters from the first file would be used for playback) and the total chapter count could be wrong. Remove the printing of chapter information from the demuxer layer and print the chapter information and count actually used for playback in core print_file_properties(). Also somewhat simplify the internal chapters API and remove possible inconsistencies.
* 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.
* audio/video: delete buggy "dynamic plugin" codeUoti Urpala2011-10-201-6/+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.
* 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.
* 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.
* 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).
* 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).
* 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-203-15/+51
| | | | | | | | | | | | 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
| | | | | | | | Export the codec private data field for WavPack and TrueHD audio tracks. At least for WavPack this is necessary to make some samples work. Also change some other cases to use the same data-copying code.
* demux_mkv: clean up audio codec handling somewhatUoti Urpala2011-08-201-91/+78
|
* demux_mkv: check for valid track in video/audio switchingUoti Urpala2011-08-201-6/+20
| | | | | | | | | | | | When switching audio or video tracks, demux_mkv only checked that the new index fell in the range corresponding to tracks existing in the file being played. However, if the demuxer can not recognize the format of a track or detects an error, some of those tracks in the file may not be exported from the demuxer and are not visible to the rest of the player. Selecting such a track would cause a crash. Add checks skip such tracks when cycling to next track and switch to nosound instead if given an explicit track number corresponding to such a track.
* demux_mkv: remove bad mkv_free() from 0ece360eeaf9Uoti Urpala2011-08-191-1/+0
| | | | | | | | demuxer.c calls demuxer->close() even if opening failed. Thus the mkv_free() call added in 0ece360eeaf95f ("demux_mkv: skip files faster in ordered chapter file search") was wrong, and could cause a crash from a double free if some data structures were allocated before the opening attempt was aborted.
* demuxer.h: avoid including stream.hUoti Urpala2011-08-193-1/+3
| | | | | | Drop the unnecessary include and add a missing direct include in some files. This also revealed that demux_rtp_internal.h was missing a config.h include, fix that too.
* aviheader.h: avoid including demuxer.hUoti Urpala2011-08-191-2/+2
| | | | | | | Remove unnecessary demuxer.h include from aviheader.h. Through stheader.h aviheader.h is included in a lot of files. Add missing mp_msg.h includes to av_sub.c and sd_ass.c (previously hidden by indirect inclusion through demuxer.h and stream.h).
* demux: avoid a copy of demux packets with lavf, reduce paddingUoti Urpala2011-08-193-26/+45
| | | | | | | | | | | | | When demux_lavf read a new packet it used to copy the data from libavformat's struct AVPacket to struct demux_packet and then free the lavf packet. Change it to instead keep the AVPacket allocated and point demux_packet fields to the buffer in that. Also change MP_INPUT_BUFFER_PADDING_SIZE to 8 which matches FF_INPUT_BUFFER_PADDING SIZE; demux_lavf packets won't have more padding now anyway (it was increased from 8 earlier when FF_INPUT_BUFFER_PADDING_SIZE was increased in libavcodec, but that change was reverted).
* demux_lavf: don't interpret MPEG codec tags as generic tagsUoti Urpala2011-08-101-3/+8
| | | | | | | | Don't interpret native MPEG codec tags using our generic format-agnostic codec tag tables. MPEG may use tag 3 for MP3, whereas the generic tables map 3 to uncompressed PCM. Make the code ignore the codec_tag field for the "mpeg" and "mpegts" libavformat demuxers and rely on the codec_id value provided by lavf only.
* demux_mkv: skip files faster in ordered chapter file searchUoti Urpala2011-08-043-45/+85
| | | | | | | | | | | | Ordered chapter code tries opening files to find those matching the SegmentUID values specified in the timeline. Previously this scan did a full initialization of the Matroska demuxer for each file, then checked whether the UID value in the demuxer was a match. Make the scan code instead provide a list of searched-for UIDs to the demuxer open code, and make that do a comparison against the list as soon as it sees the UID in the file, aborting if there is no match. Also fix units used in "Merging timeline part" verbose message.
* core: audio: if audio pts is missing return MP_NOPTS_VALUEUoti Urpala2011-07-301-1/+1
| | | | | | | Change written_audio_pts() and playing_audio_pts() to return MP_NOPTS_VALUE if no reasonable pts estimate is available. Before they returned some incorrect value typically around zero (but not necessarily exactly that).
* build: fix --enable-debug, remove some "#ifdef MP_DEBUG"Uoti Urpala2011-07-301-4/+0
| | | | | | | | | | | Recent commit 5d5ca22a6d ("options: commandline: accept --foo=xyz style options") left some bad code under "#ifdef MP_DEBUG" in playtree.c, which caused a compilation failure if configured with "--enable-debug". Fix this. Having the "#ifdef MP_DEBUG" there was completely unnecessary; it only increased the risk for this kind of problems for no real benefit - executing the asserts under it would have no noticeable performance or other penalty in default builds either. Remove several cases of such harmful "#ifdef MP_DEBUG".
* bstr: rename BSTR() -> bstr()Uoti Urpala2011-07-273-8/+8
| | | | | | Rename the BSTR() function to bstr(). The former caused a conflict with some Windows OS name, and it's no longer a macro so uppercase naming is less appropriate.
* cleanup: do libav* initialization on startupUoti Urpala2011-07-183-6/+0
| | | | | | | Do the global initialization of libavcodec and libavformat (avcodec_register_all(), av_register_all()) immediately on program startup and remove the initialization calls from various individual modules that use libavcodec/libavformat functionality.
* cleanup: silence most of the clang warningsClément Bœsch2011-07-093-5/+5
|
* demux/mp_taglists: Move Bink audio tags to override listAnton Khirnov2011-07-061-2/+2
| | | | | | | | Some versions of lavf abuse codec_tag for passing Bink version information to the decoder, which broke detection based on codec tag (though this has already stopped again in latest Libav). Move bink audio codec IDs from mp_wav_tags to mp_codecid_override_tags so that codec tags are completely ignored for them.
* Merge branch 'mplayer1_changes'Uoti Urpala2011-07-066-13/+40
|\
| * demux_rtp.cpp: Add a hack to receive audio while probing video FPSreimar2011-07-061-1/+26
| | | | | | | | | | | | | | Otherwise newer live555 versions would just hang. Fixes http://bugzilla.mplayerhq.hu/show_bug.cgi?id=1874 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33793 b3059339-0415-0410-9bf9-f77b7e298cf2
| * cleanup: demux_vqf: typo/wording fixesdiego2011-07-061-2/+2
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33762 b3059339-0415-0410-9bf9-f77b7e298cf2
| * demux_lavf: Do not set AVIOContext for AVFMT_NOFILE formatsreimar2011-07-061-5/+7
| | | | | | | | | | | | | | | | Setting AVIOContext for AVFMT_NOFILE formats now triggers a warning from libavformat (and triggered an error for a while), so add a check to avoid setting AVIOContext when not necessary. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33695 b3059339-0415-0410-9bf9-f77b7e298cf2
| * demux_lavf: fix code printing subtitle typereimar2011-07-061-2/+2
| | | | | | | | | | | | | | Fix printing of subtitle type, the wrong index was used to look up the type. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33664 b3059339-0415-0410-9bf9-f77b7e298cf2
| * cosmetics: Fix typoscehoyos2011-07-061-1/+1
| | | | | | | | | | | | Patch by Mike Castle, dalgoda+mplayer gmail git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33575 b3059339-0415-0410-9bf9-f77b7e298cf2
| * demux_asf: Fix play duration calculation errorib2011-07-061-1/+1
| | | | | | | | | | | | | | | | | | | | Acording to the ASF documentation, the play duration is zero if the preroll value is greater than the play duration. The new way of determining it (suggested by reimar) prevents overflows as well. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33492 b3059339-0415-0410-9bf9-f77b7e298cf2
| * cosmetics: asf.h: Fix comment errorib2011-07-061-1/+1
| | | | | | | | | | | | | | | | According to the ASF documentation, MF_PD_ASF_FILEPROPERTIES_PREROLL (preroll) is UINT64. Fix type mentioned in comment. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33484 b3059339-0415-0410-9bf9-f77b7e298cf2
* | demux_lavf: add missing #include <libavutil/mathematics.h>Uoti Urpala2011-07-061-0/+1
|/ | | | Not included by avutil.h any more in recent Libav versions.
* OSD: when switching sub/audio tracks show title of new trackUoti Urpala2011-07-033-3/+13
| | | | | | If the played file has per-track titles for audio and subtitles show those on the OSD when switching tracks. This changes the OSD message from 'Audio: (2) eng' to 'Audio: (2) eng ("Director's commentary")'.
* commands: change property mechanism to use talloc stringsUoti Urpala2011-07-031-6/+4
|
*