summaryrefslogtreecommitdiffstats
path: root/libmpdemux
Commit message (Collapse)AuthorAgeFilesLines
* libmpdemux: add back demux_tswm42012-09-184-1/+3573
| | | | | | | | | | | | | | | | | Someone wanted this. Apparently both libavformat's TS demuxer and demux_ts are crap, and work/fail in different cases. This demuxer has been removed in 1fde09db6f4ce. All code added comes from the revision before that. Some required bits have been added in the commit before this one (re-adding demux_mpg), in particular the changes to video.c. stream_dvb will use this demuxer by default, otherwise demux_lavf is preferred (as it has been before). Some TS related command line options are not re-added. Closed captions might not work.
* libmpdemux: add back demux_mpgwm42012-09-1810-7/+2791
| | | | | | | | | | | | | | | | | | | | | Apparently this was needed for good DVD playback. This demuxer has been removed in 1fde09db6f4ce. All code added comes from the revision before that. Some other bits have been removed in later commits, and are added back as well. Usage of memalign() is replaced by av_malloc(). As far as I can tell, this memory is never free'd or reallocated, so no calls to av_free() have been added. The code re-added to video.c is plain horrible, full of code duplication, full of demuxer/codecs specifics, but apparently needed. Unrelated to re-adding the demuxer, re-add one codepath for DEMUXER_TYPE_TV, which was accidentally removed in the same commit demux_mpg was removed. The closed captions decoder is not re-added.
* rawaudio: use mplayer audio format for format optionwm42012-09-181-16/+14
| | | | | | | | | | | | | | | The rawaudio demuxer had a rather hard to use way to set the audio format with the --rawaudio=format=value option. The user had to pass a numeric value, which then was set as wFormatTag member in the WAVEFORMATEX header. Make it use the mplayer audio format (the same as --af=format=value). Add a new internal pseudo audio codec tag, which is hopefully unused, which makes ad_pcm use the value in wFormatTag as internal mplayer audio format. Playing non-PCM formats is disabled. (At least AC3 can be played directly.)
* demuxer: remove ImageDesc fieldwm42012-09-182-2/+0
| | | | | | | | | | | | | | | | | | This was needed by the now-removed mov demuxer for QuickTime video, or to be more specific, the Sorenson 3 video codec. QuickTime can (probably) still decoded by libavcodec, but this field is not needed for this. The reference in demux_mkv was apparently for decoding QuickTime in Matroska, using binary QuickTime codecs (QTX stuff). It's possible that this has been broken with the binary codecs removal (see commit aebfbbf2bdd), because it removed related code from demux_mkv. On the other hand, the code section in question was enabled only if binary win32 codecs were enabled. The win32 codec loader worked on 32 bit x86 only. This means QuickTime-in-Matroska was broken on all other architectures, including 64 bit x86. Despite being possibly broken on a major platform, nobody has complained about it yet, and since I couldn't find a sample of such a mkv file, so don't bother with it.
* demuxer: do not set sub_utf8 optionwm42012-09-182-5/+0
| | | | | | | | demux_lavf and demux_mkv, which both support demuxing subtitles, set the global variable sub_utf8. This variable is connected with the -utf8 option, and should not be reset by code. Since demuxer subtitles are not influenced by this option (anymore?), this is unnecessary. Remove the code setting this variable from the demuxers.
* core: fix DVD subtitle selectionwm42012-09-183-15/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add all subtitle tracks as reported by libdvdread at playback start. Display language for subtitle and audio tracks. This commit restores these features to the state when demux_mpg was default for DVD playback, and makes them work with demux_lavf and the recent changes to subtitle selection in the frontend. demux_mpg, which was the default demuxer for DVD playback, reordered the subtitle streams according to the "logical" subtitle track number, which conforms to the track layout reported by libdvdread, and is what stream_dvd expects for the STREAM_CTRL_GET_LANG call. demux_lavf, on the other hand, adds the streams in the order it encounters them in the MPEG stream. It seems this order is essentially random, and can't be mapped easily to what stream_dvd expects. Solve this by making demux_lavf hand out the MPEG stream IDs (using the demuxer_id field). The MPEG IDs are mapped by mplayer.c by special casing DVD playback (map_id_from/to_demuxer() functions). This mapping is essentially the same what demux_mpg did. Making demux_lavf reorder the streams is out of the question, because its stream handling is already messy enough. (Note that demux_lavf doesn't export stream IDs for other formats, because most time libavformat demuxers do not set AVStream.id, and we don't know which demuxers do. But we know that MPEG is safe.) Another major complication is that subtitle tracks are added lazily, as soon as the demuxer encounters the first subtitle packet for a given subtitle stream. Add the streams in advance. If a yet non-existent stream is selected, demux_lavf must be made to auto-select that subtitle stream as soon as it is added. Otherwise, the first subtitle packet would be lost. This is done by DEMUXER_CTRL_PRESELECT_SUBTITLE. demux_mpg didn't need this: the frontend code could just set ds->id to the desired stream number. But demux_lavf's stream IDs don't map directly to the stream number as used by libdvdread, which is why this hack is needed.
* demux_mkv: fix minor memory leakwm42012-09-181-0/+1
|
* core: runtime Matroska edition switchingwm42012-09-182-1/+5
| | | | | | | | | | | | | | | | | | | | | | | Add a new slave property which switches the current Matroska edition. Since each edition can define an entirely new timeline, switching the edition will simply restart playback at the beginning of the file with the new edition selected. Add 'E' as new keybinding to step the edition property. DVD titles are still separate. Apparently they work similarly, but I don't have any multi-title DVDs for testing. Also, cdda (for audio CDs) uses the same mechanism as DVDs to report a number of titles, so there seems to be confusion what exactly this mechanism is supposed to do. That's why the edition code is completely separate for now. Remove demuxer.num_titles. It was just a rather useless cache for the return value of the DVD titles related STREAM_CTRL. One rather obscure corner case isn't taken care of: if the ordered chapters file has file local options set, they are reset on playback restart. This is unexpected, because edition switching is meant to behave like seeking back to the beginning of the file.
* core: move implementation for -audiofile to the frontendwm42012-09-183-311/+26
| | | | This should behave as before, with the same set of caveats.
* core: manage tracks in the frontendwm42012-09-184-139/+78
| | | | | | | | | | | | | | | Introduce a general track struct for every audio/video/subtitle track known to the frontend. External files (subtitles) are now represented as tracks too. This mainly serves to clean up the subtitle selection code: now every subtitle is simply a track, instead of using a messy numbering that goes by subtitle type (as it was stored in the global_sub_pos field). The mplayer fontend will list external subtitle files as additional tracks. The timeline code now tries to match the exact demuxer IDs of all tracks. This may cause problems when Matroska files with different track numberings are used with EDL timelines. Change demux_lavf not to set demuxer IDs, since most time they are not set.
* libaf: rename af_format.h to format.hwm42012-08-291-1/+1
| | | | | | | | | | af_format.h declares some symbols which are defined in format.c. The fact that af_format.c is a completely unrelated file is rather confusing. Having the header and implementation file use the same base name is more uniform. (af_format.c is the audio conversion filter, while af_format.h and format.c are about audio formats and their properties.) Also fix all source files which include this file.
* video: honor the video's colormatrix and color range flagscantabile2012-08-211-0/+2
| | | | | | If either of them is not defined, the old behavior is used: - the colormatrix is guessed based on resolution. - the color range is assumed to be tv aka limited range.
* demux_gif: change format of packets to make it work againwm42012-08-201-9/+23
| | | | | | | | | | | | | | The only decoder which could handle demux_gif's output was vd_raw, which has been removed recently. Instead of re-adding vd_raw, make it work with vd_ffmpeg. By coincidence, the FourCC "raw " fits our needs and it understood by the ffmpeg raw decoder (apparently used in mov files going by libavcodec/rawdec.c). Since there doesn't seem to be any good way to transport the palette in mplayer dmuxer packets, create an AVPacket for this purpose. (struct sh_video provides a "global" palette. Rather than hacking vd_ffmpeg to use it, it seems cleaner to make demux_gif use AVPacket, which supports a per-frame palette.)
* vd_ffmpeg, demux_mng: allow general raw formats, fix MNG demuxerwm42012-08-201-2/+3
| | | | | | | | | | | | | | | Change vd_ffmpeg such that if sh_video->format is a mplayer pixel format, and there's no other codec information, try to play it as raw video. (The case of no codec information happens if the "generic" ffmpeg decoder is instantiated, which is tried last. This means clashes with actual existing formats are less likely.) demux_mng did not initialize all fields of the bih, which made vd_ffmpeg do invalid memory accesses when trying to copy the extradata. Also, use IMGFMT_RGB32 instead of creating the FourCC directly. (They should be the same, but what if mplayer changes the IMGFMT_* values.) This also fixes demux_rawvideo.
* libmpcodecs: remove redundant audio and video decoderswm42012-08-203-747/+0
| | | | | | | | Probably all of these are supported by libavcodec. Missing things can be added back. Also remove qtpalette.h. It was used by demux_mov.c, and should have been deleted with commit 1fde09db6f4ce.
* Remove support for libdvwm42012-08-203-281/+0
| | | | | This removes the libdv demuxer and audio/video decoders. FFmpeg has support for it, and it's even preferred over the internal decoders.
* Remove support for libnemesi RTSP streamingwm42012-08-203-505/+0
| | | | | Removed due to being a maintainance burden. Support for FFmpeg is available.
* Remove support for LIVE555 RTSP streamingwm42012-08-207-1265/+0
| | | | | | | | | | | | The main excuse for removing this is that LIVE555 deprecated the API the mplayer implementation was using. The old API still seems to be somewhat supported, but must be explicitly enabled at LIVE555 compilation, so mplayer won't always work on any user installation. The implementation was also very messy, in C++, and FFmpeg support is available as alternative. Remove it completely.
* libmpdemux: remove demux_real, demux_viv, demux_audiowm42012-08-2011-4245/+56
| | | | | | libavformat replaces demux_audio completely. I don't know/care what vivo (demux_viv) is. libavformat has a Real demuxer; it seems it works slightly better, with a different set of bugs.
* Remove dvdnav support (DVD menus)wm42012-08-161-1/+1
| | | | | | | | | | | | | | | | When the internal mplayer MPEG demuxer was removed (commit 1fde09db), the default demuxer when using dvdnav was set to libavformat. Now it turns out that this doesn't work with libavformat. It will terminate playback right after the audio runs out (instead of looping it like the video, or whatever it's supposed to do). I'm not sure what exactly the problem is, but since 1. even mplayer-svn can't handle DVD menus directly (missing highlights), 2. DVD menus are essentially worthless, and 3. I don't directly watch DVDs, don't bother with it and remove it. For basic playback, there's still libdvdread support. Also, use pkg-config for libdvdread, and drop support for in-tree libdvdread. Remove support for in-tree libdvdcss as well.
* Remove win32/qt/xanim/real binary codecs loadingwm42012-08-163-681/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the win32 loader - the win32 emulation layer, as well as the code for using DirectShow/DMO/VFW codecs. Remove loading of xanim, QuickTime, and RealMedia codecs. The win32 emulation layer is based on a very old version of wine. Apparently, wine code was copied and hacked until it was somehow able to load a limited collection of binary codecs. It poked around in the code segment of some known binary codecs to disable unsupported win32 API calls to make them work. Example from module.c: for (i=0;i<5;i++) RVA(0x19e842)[i]=0x90; // make_new_region ? for (i=0;i<28;i++) RVA(0x19e86d)[i]=0x90; // call__call_CreateCompatibleDC ? for (i=0;i<5;i++) RVA(0x19e898)[i]=0x90; // jmp_to_call_loadbitmap ? for (i=0;i<9;i++) RVA(0x19e8ac)[i]=0x90; // call__calls_OLE_shit ? for (i=0;i<106;i++) RVA(0x261b10)[i]=0x90; // disable threads Just to show how utterly insane this code is. You wouldn't want even your worst enemy to have to maintain this. In fact, it seems nobody made major changes to this code ever since it was committed. Most formats can be decoded by libavcodecs these days, and the loader couldn't be used on 64 bit platforms anyway. The same is (probably) true for the other binary codecs. General note about how support for win32 codecs could be added back: It's not possible to replace the win32 loader code by using wine as library, because modern wine can not be linked with native Linux programs for certain reasons. It would be possible to to move DirectShow video decoding into a separate process linked with wine, like the CoreAVC-for-Linux patches do. There is also the mplayer-ww fork, which uses the dshownative library to use DirectShow codecs on Windows.
* demux_lavf: assume audio codec_tag 0 means unsetUoti Urpala2012-08-161-0/+2
| | | | | | | | | | | Libavformat does not distinguish between "no codec_tag given" and "codec_tag given, value is 0". 0 can be a valid value. Change demux_lavf to assume that 0 always means unset for audio. This prevents incorrect selection of the PCM decoder, which includes "format 0x0" in its codecs.conf entry. The video case accepts 0 iff codec_id is RAWVIDEO, but there's no obvious similar check possible for audio. Thus this could possibly cause issues if a file really uses 0 to mean uncompressed audio.
* command: fix subtitle selection displaywm42012-08-081-1/+1
| | | | | | | | | Commit 9c02ae7e9510897 set the sh variable (see diff) to the struct of type sh_sub instead the one of sh_stream. Unfortunately this didn't crash, and merely made the OSD show "unknown" for the language. Commit 804bf91570a24b9 accidentally removed the display of the track title. Add it back.
* Remove V4L2 decoder support (vo_v4l2 and ao_v4l2)wm42012-08-072-184/+0
| | | | | | | | | | | The removed VO and AO took MPEG data and decoded it with V4L2. I'm not exactly sure what's the use of this today, but get rid of it. As far as feeding video data to V4L2 is concerned, there are other ways. For example, there is this script, that feeds yuv4mpeg formatted raw video data to V4L2: https://raw.github.com/umlaeute/v4l2loopback/master/examples/yuv4mpeg_to_v4l2.c
* 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
| |