summaryrefslogtreecommitdiffstats
path: root/libmpdemux
Commit message (Collapse)AuthorAgeFilesLines
* demuxer: introduce a general stream structwm42012-08-035-67/+123
| | | | | | | | | | | | | | | | There are different C types for each stream type: sh_video for video, sh_audio for audio, sh_sub for sub. There is no type that handles all stream types in a generic way. Instead, there's a macro SH_COMMON, that is used to define common fields for all 3 stream structs. Accessing the common fields is hard if you want to be independent from the stream type. Introduce an actual generic stream struct (struct sh_stream), which is supposed to unify all 3 stream types one day. Once all fields defined by SH_COMMON have been moved into sh_stream, the transition is complete. Move some fields into sh_stream, and rewrite osd_show_tracks to use them.
* demux_audio: always enable parsing for audio streamsmplayer-svn2012-08-031-1/+2
| | | | | | | | | Generally enable parsing for audio streams. The formats I know of that do not need it (e.g. raw audio) do not have a parser anyway. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35050 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: reimar
* mp3_hdr: cleanupsmplayer-svn2012-08-031-59/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Return a spf value even when srate is NULL. Based on patch by Benoît Thébaudeau [benoit thebaudeau advansee com] git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34916 b3059339-0415-0410-9bf9-f77b7e298cf2 Make some tables const. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34917 b3059339-0415-0410-9bf9-f77b7e298cf2 Use more appropriate types. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34918 b3059339-0415-0410-9bf9-f77b7e298cf2 Some minor simplifications. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34919 b3059339-0415-0410-9bf9-f77b7e298cf2 Cosmetics: fix up indentations, get rid of a few lost tabs. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34920 b3059339-0415-0410-9bf9-f77b7e298cf2 Remove unused code from mp_get_mp3_header. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34923 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: reimar
* demux_audio: fix calculation of audio lengthmplayer-svn2012-08-031-1/+2
| | | | | | | | | Take start offset into account when calculating amount of audio data. Patch by Benoît Thébaudeau [benoit thebaudeau advansee com] git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34915 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: reimar
* demux_audio: avoid integer overflowsmplayer-svn2012-08-031-3/+7
| | | | | | | | | Add some additional checks to ensure subtractions do not overflow. Patch by Benoît Thébaudeau [benoit thebaudeau advansee com]. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34914 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: reimar
* demux_real: set aspect ratiomplayer-svn2012-08-031-0/+2
| | | | | | | | | RM demuxer: set aspect from container video dimensions. Fixes the sample from FFmpeg trac issue #785. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34850 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: reimar
* commands, dvd, dvdnav, bluray: cleanup sub/audio track language displaymplayer-svn2012-08-032-0/+39
| | | | | | | | | | | | | | | | | | | | | Code cleanup: Use a stream_control instead of global functions to get the language associate with a audio or subtitle stream from the streaming layer. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34736 b3059339-0415-0410-9bf9-f77b7e298cf2 Support showing the stream language with br:// playback. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34737 b3059339-0415-0410-9bf9-f77b7e298cf2 Fix DVDs showing the subtitle language as "unknown" for a long time. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34777 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: reimar Note: heavily modified by wm4 for this fork of mplayer.
* demux_rtp: fix compilation with new LIVE555 librariesmplayer-svn2012-08-031-0/+2
| | | | | | | Patch by Marty Jack, martyj19 comcast net git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34800 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: cehoyos
* demux_audio: do not decode ID3v2 tag data as audio datamplayer-svn2012-08-031-10/+53
| | | | | | | | | | | | | | | | | Minor simplification. Part of patch by Benoît Thébaudeau [benoit thebaudeau () advansee com]. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34718 b3059339-0415-0410-9bf9-f77b7e298cf2 Detect ID3v2 tag at the end of the file and stop demuxing before its start. Avoids trying to decode its data as MP3. Patch by Benoît Thébaudeau [benoit thebaudeau {} advansee com]. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34719 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: reimar
* demux_mf: add j2c and jpc as jpeg2k, add tiff extension as tif imagemplayer-svn2012-08-031-0/+5
| | | | | | | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34587 b3059339-0415-0410-9bf9-f77b7e298cf2 demux_mf: add JPS/PNS image formats add jps / pns image formats, sync'd from ffmpeg samples: http://i2.i-2000.com/~siragusa/jpsvpns/data/ git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34642 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: compn
* stream: add new stream control command STREAM_CTRL_GET_NUM_TITLESmplayer-svn2012-08-031-0/+2
| | | | | | | | | This provides the total number of titles (aka tracks) of CDs / VCDs / DVDs. Additionally, add a titles property to the get_property slave command. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34474 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: ib
* demux_audio: improve WAV format detectionmplayer-svn2012-08-031-1/+3
| | | | | | | | Make WAV format detection more restrictive so it does not incorrectly grab qcp files. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34343 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: reimar
* demux_audo: fix wrong runtime and average bitrate for VBR MP3mplayer-svn2012-08-031-1/+67
| | | | | | | | | Do so by determining the number of frames from the Xing/Info/VBRI headers and by calculation a correct duration which leads to an reasonable average bytes per seconds. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34273 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: ib
* demux_audio: ensure that demuxer->movi_end will be setmplayer-svn2012-08-031-3/+2
| | | | | | | This also simplifies the code that checks for TAG. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34272 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: ib
* Replace 'q' printf length modifier by 'll'mplayer-svn2012-08-031-2/+2
| | | | | | | 'q' is just a deprecated synonym of 'll' that should no longer be used. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34224 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: diego
* Remove teletext supportwm42012-08-032-6/+0
| | | | | | | | Teletext requires special OSD support. Because I can't even test teletext, I can't restore support for it. Since teletext can be considered ancient and obscure, and since it doesn't make sense to keep the remaining teletext code without being able to use it, I'm removing it.
* Remove dead codewm42012-08-0110-1496/+0
| | | | | | | | | | | | | This was done with the help of callcatcher [1]. Only functions which are statically known to be unused are removed. Some unused functions are not removed yet, because they might be needed in the near future (such as open_output_stream for the encode branch). There is one user visible change: the --subcc option did nothing, and is removed with this commit. [1] http://www.skynet.ie/~caolan/Packages/callcatcher.html
* Change <endian.h> include to <sys/types.h>wm42012-07-313-3/+2
| | | | | This seems to be more portable. Should fix compilation on OSX and FreeBSD. Apparently also works on MinGW-w64.
* configure: remove checks for malloc.h and alloca()wm42012-07-301-3/+0
| | | | | | | | Including <malloc.h>, especially if all you want is malloc(), has no legitimate uses (on sane platforms at least). Remove the check for it, and remove all uses in the code. Remove unused check for alloca().
* Remove some demuxers and decoderswm42012-07-3035-16353/+32
| | | | | | | | | | | | | | | | | | Most of these demuxers and decoders are provided in better form by libav, while the mplayer builtin ones are essentially unmaintained. The only legimitate use case for not using the libav ones was working around libav bugs or bugs related to the way mplayer uses libav. Instead of trying to keep dead code alive, development effort should go into improving libav or the mplayer libav glue code. Note that the libav demuxer have been preferred over the mplayer builtin ones for a while in mplayer2. There were some exceptions: playing DVDs with dvdnav or playing network sources. (That's because some stream modules and network.c requested explicit file formats, such as DEMUXER_TYPE_MPEG_PS, which mapped to builtin demuxers.) With this commit, they are switched to use libav. One caveat is that the requested format is not passed to libavformat, instead we rely on the auto probing to select the correct libav demuxer (see code in demux_open_stream()).
* Remove XMMS plugin supportwm42012-07-303-575/+0
| | | | XMMS has been dead since 2007.
* 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
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | |