summaryrefslogtreecommitdiffstats
path: root/libmpdemux
Commit message (Collapse)AuthorAgeFilesLines
* mplayer: let frontend print stream info, instead of demuxerswm42012-07-305-9/+51
| | | | | | | | | | | | | | | | | | When playing a file, users (i.e. me) expect mplayer to print a list of video/audio/subtitle streams. Currently, this is done in each demuxer separately. This also means the output is formatted differently depending which demuxer is active. Add code to print an uniformly formatted streams list in the player front end. Extend the streams headers to export additional information about the streams. Change the lavf and mkv demuxers to follow this new scheme, and raise the log level for the "old" printing functions. The intention is to make every demuxer behave like this eventually. The stream list output attempts to provide codec information. It's a bit hacky and doesn't always provide useful output, and I'm not sure how to do it better.
* Remove compile time/runtime CPU detection, and drop some platformswm42012-07-303-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mplayer had three ways of enabling CPU specific assembler routines: a) Enable them at compile time; crash if the CPU can't handle it. b) Enable them at compile time, but let the configure script detect your CPU. Your binary will only crash if you try to run it on a different system that has less features than yours. This was the default, I think. c) Runtime detection. The implementation of b) and c) suck. a) is not really feasible (it sucks for users). Remove all code related to this, and use libav's CPU detection instead. Now the configure script will always enable CPU specific features, and disable them at runtime if libav reports them not as available. One implication is that now the compiler is always expected to handle SSE (etc.) inline assembly at runtime, unless it's explicitly disabled. Only checks for x86 CPU specific features are kept, the rest is either unused or barely used. Get rid of all the dump -mpcu, -march etc. flags. Trust the compiler to select decent settings. Get rid of support for the following operating systems: - BSD/OS (some ancient BSD fork) - QNX (don't care) - BeOS (dead, Haiku support is still welcome) - AIX (don't care) - HP-UX (don't care) - OS/2 (dead, actual support has been removed a while ago) Remove the configure code for detecting the endianness. Instead, use the standard header <endian.h>, which can be used if _GNU_SOURCE or _BSD_SOURCE is defined. (Maybe these changes should have been in a separate commit.) Since this is a quite violent code removal orgy, and I'm testing only on x86 32 bit Linux, expect regressions.
* bstr: rename bstr() function to bstr0(), and typedef bstr to struct bstrwm42012-07-283-9/+9
| | | | | Replace all uses of bstr() with bstr0(). Also remove the ridiculous C++ workaround.
* osd: use libass for OSD renderingwm42012-07-281-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The OSD will now be rendered with libass. The old rendering code, which used freetype/fontconfig and did text layout manually, is disabled. To re-enable the old code, use the --disable-libass-osd configure switch. Some switches do nothing with the new code enabled, such as -subalign, -sub-bg-alpha, -sub-bg-color, and many more. (The reason is mostly that the code for rendering unstyled subtitles with libass doesn't make any attempts to support them. Some of them could be supported in theory.) Teletext rendering is not implemented in the new OSD rendering code. I don't have any teletext sources for testing, and since teletext is being phased out world-wide, the need for this is questionable. Note that rendering is extremely inefficient, mostly because the libass output is blended with the extremely strange mplayer OSD format. This could be improved at a later point. Remove most OSD rendering from vo_aa.c, because that was extremely hacky, can't be made work with osd_libass, and didn't work anyway in my tests. Internally, some cleanup is done. Subtitle and OSD related variable declarations were literally all over the place. Move them to sub.h and sub.c, which were hoarding most of these declarations already. Make the player core in mplayer.c free of concerns like bitmap font loading. The old OSD rendering code has been moved to osd_ft.c. The font_load.c and font_load_ft.c are only needed and compiled if the old OSD rendering code is configured.
* Merge remote-tracking branch 'origin/master'wm42012-07-2821-1007/+77
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .gitignore bstr.c cfg-mplayer.h defaultopts.c libvo/video_out.c The conflict in bstr.c is due to uau adding a bstr_getline function in commit 2ba8b91a97e7e8. This function already existed in this branch. While uau's function is obviously derived from mine, it's incompatible. His function preserves line breaks, while mine strips them. Add a bstr_strip_linebreaks function, fix all other uses of bstr_getline, and pick uau's implementation. In .gitignore, change vo_gl3_shaders.h to use an absolute path additional to resolving the merge conflict.
| * demux_rawdv.c: fix change missing from recent 8079f4ff821Uoti Urpala2012-07-271-1/+0
| | | | | | | | | | | | | | | | | | | | | | Like vd_vfw.c fixed earlier, demux_rawdv.c was also missing a change needed for the "flags"->"keyframe" demux packet field rename. This broke compilation with libdv enabled. Hopefully there aren't more cases. It's hard to reliably check for references in files that aren't compiled in the local tree if they use different base variable names, as the "flags" name itself is used for many unrelated things.
| * demux_lavf: use lavf for RealMedia (.rm) files by defaultUoti Urpala2012-07-261-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | RealMedia was listed as a format for which the internal demuxer (demux_real) was preferred over lavf. The original reason for this (lavf failing to give any timing information for some video frames) has been fixed in libavformat since. Make demux_lavf the preferred demuxer for RealMedia. The libavformat demuxer does still have issues. COOK audio initially misbehaves after a seek (inconsistent timestamps, audio remaining from the before-seek position). However, the internal demuxer seemed to be _consistently_ out of sync with a test file. I haven't done thorough testing, but the internal demuxer does not seem less buggy.
| * demux, vd_ffmpeg: fix demux keyframe flag, set AV_PKT_FLAG_KEYUoti Urpala2012-07-2517-76/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was some confusion about the "flags" field in demuxer packets. Demuxers set it to either 1 or 0x10 to indicate a keyframe (and the field was not used to indicate anything else). This didn't cause visible problems because nothing read the value. Replace the "flags" field with a boolean "keyframe" field. Set AV_PKT_FLAG_KEY based on this field in packets fed to libavcodec video decoders (looks like PNG and ZeroCodec are the only ones which depend on values from demuxer; previously this was hardcoded to true for PNG). Make demux_mf set the keyframe field in every packet. This matters for PNG files now that the demuxer flag is forwarded to libavcodec. Fix logic setting the field in demux_mkv. It had probably not been updated when adding SimpleBlock support. This probably makes no difference for any current practical use.
| * 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
* | Merge remote-tracking branch 'origin/master'wm42012-04-281-2/+16
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: command.c libao2/ao_alsa.c libao2/ao_dsound.c libao2/ao_pulse.c libao2/audio_out.h mixer.c mixer.h mplayer.c Replace my mixer changes with uau's implementation, which is based on my code.
| * 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.
* | Merge remote-tracking branch 'origin/master'wm42012-04-011-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bstr.c bstr.h etc/input.conf input/input.c input/input.h libao2/ao_pulse.c libmpcodecs/vf_ass.c libmpcodecs/vf_vo.c libvo/gl_common.c libvo/x11_common.c mixer.c mixer.h mplayer.c
| * cosmetics: misc minor cleanupsUoti Urpala2012-03-251-1/+1
| | | | | | | | | | The deleted ZRM* things were only relevant to vo_zr, which was deleted earlier.
* | Merge remote-tracking branch 'origin/master' into my_masterwm42012-03-163-15/+19
|\| | | | | | | | | | | | | | | Conflicts: command.c mp_core.h mplayer.c screenshot.c
| * 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.
* | Merge remote-tracking branch 'origin/master' into my_masterwm42012-03-0516-91/+120
|\| | | | | | | | | | | Conflicts: mplayer.c screenshot.c
| * 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.
* | core: sort chapterswm42012-02-261-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure that chapters are sorted by time. There are some broken mkv files that have chapters in random order. Using simple chapter skipping with the seek_chapter slave command is very confusing and just doesn't work if the chapters are not in order. The chapters are resorted every time a chapter is added, that would make the chapter list unsorted. While this is algorithmically very stupid, it doesn't require changes per demuxer, or reasoning when exactly chapters could be added. Turning this into an insertion sort isn't worth the code, and the added demuxer_sort_chapters() function could possibly be moved to the "right" place later. This is not done when ordered chapters are used, because timeline support uses different data structures for chapters.
* | Don't print awkward negative seek message when playing directorywm42012-02-191-1/+0
| | | | | | | | | | | | | | This was caused by a demuxer trying to undo the header read when probing for its file format. This is pointless in any case, because the core demuxer code seeks back to the start of the file when initializing a demuxer.
* | core: add new support for reading .cue fileswm42012-01-183-0/+68
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | Playing a .cue file directly will now parse the .cue file, and load and play the file(s) referenced in the cue. If multiple files are referenced, a timeline including all files will be created to create the impression of a single, flat audio file containing all the tracks. For each track, a chapter is created. The chapter navigation commands can be used to jump between tracks. The chapter titles will use the string provided by the track's TITLE cue command. (The -identify command can be used to print all chapters in a not so user friendly way.) Other than the chapter names, there is no attempt at displaying or exposing any other meta data contained in the cue files yet. The handling (or lack of thereof) of gaps (track pregaps and postgaps) is probably not correct yet. In general, mplayer's mapping of tracks to the source audio files can be verified by examining the timeline, which will be printed when passing the -v switch. Note that this has nothing to do with the old cue:// support. The old code isn't touched, and is still only able to play .cue/.bin pairs. Prefixing a .cue file with cue:// will always invoke the old code, while playing a .cue file directly (i.e. "mplayer file.cue") will always use the new code. Playing audio images (.cue/.bin pairs of files) doesn't work yet.
* 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