summaryrefslogtreecommitdiffstats
path: root/libmpdemux
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* cosmetics: reformat demux_lavf.c, m_option.[ch] and m_property.cUoti Urpala2011-07-031-480/+513
|
* demux: use talloc for sh_* structs and "lang" fieldUoti Urpala2011-07-034-17/+16
|
* cleanup: reindent stheader.hUoti Urpala2011-07-031-100/+102
| | | | Also improve some comments and change two fields from int to bool.
* audio: move ready-for-ao data buffer from decoder to AOUoti Urpala2011-07-021-5/+0
| | | | | | | | | | | | Move the buffer storing audio data ready to be fed to the audio output driver from the audio decoder object to the AO object. This will help encoding code deal with end of input, and may also be useful to improve other general gapless audio behavior (as AOs which do not accept chunks smaller than a certain size may keep them in the buffer while the decoder changes). Less data may be dropped now when changing audio filters or switching timeline parts.
* cleanup: fix mp_dbg() format string warningsClément Bœsch2011-07-014-16/+7
|
* demux_ts: Support S302M audiocehoyos2011-06-291-0/+8
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33461 b3059339-0415-0410-9bf9-f77b7e298cf2
* cleanup: some warning fixes and minor cleanupsreimar2011-06-293-9/+5
| | | | | | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33399 b3059339-0415-0410-9bf9-f77b7e298cf2 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33400 b3059339-0415-0410-9bf9-f77b7e298cf2 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33421 b3059339-0415-0410-9bf9-f77b7e298cf2 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33425 b3059339-0415-0410-9bf9-f77b7e298cf2 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33426 b3059339-0415-0410-9bf9-f77b7e298cf2
* vd_ffmpeg: autoselect output colorspaces without codecs.confUoti Urpala2011-06-261-0/+1
| | | | | | | | | | | | | Selecting the colorspace to output from a decoder is done in the function mpcodecs_config_vo(). Add a new version of this function, mpcodecs_config_vo2(), that allows the decoder to specify a list of candidate colorspaces instead of always using a hardcoded list specified in the codecs.conf entry. If the codecs.conf entry has any "out" lines then those still take priority and the decoder-provided list (if any) is ignored. Make vd_ffmpeg provide a list of the colorspaces it's willing to output. Remove "out" lines from most entries for libavcodec video decoders in codecs.conf, so that the automatic values are now used instead.
* demux: pad even 0-size demux packet data (fixes sd_ass crash)Uoti Urpala2011-06-181-17/+10
| | | | | | | | | | | | | sd_ass relies on there being a zero byte after packet data. However the packet allocation routines special-cased data length 0 and left the data pointer as NULL in that case. This could cause a crash in sd_ass if there was an empty subtitle packet. Change the allocation routines to stop special-casing empty data and always allocate padding. Empty packets are not so common that special casing them would be a worthwhile optimization. Also fix resize_demux_packet() to use MP_INPUT_BUFFER_PADDING SIZE as the padding size, instead of a hardcoded value of 8.
* cleanup: shut up more warningsClément Bœsch2011-05-0617-30/+35
|
* cleanup: remove more warningsClément Bœsch2011-05-023-4/+4
|
* Merge branch 'mplayer1_changes'Uoti Urpala2011-05-024-3/+15
|\
| * mp_taglists.c: add CODEC_ID_ANM and CODEC_ID_AVSreimar2011-05-021-0/+2
| | | | | | | | | | | | Add mapping between codec ID and tag for ANM and AVS. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33288 b3059339-0415-0410-9bf9-f77b7e298cf2
| * demux_ts: Hint at -tsprobe option when no audio stream is founddiego2011-05-021-1/+1
| | | | | | | | | | | | patch by Godmar Back, godmar gmail com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33271 b3059339-0415-0410-9bf9-f77b7e298cf2
| * codecs.conf, mp_taglists: add FFmpeg Bitmap Brothers JV decodercehoyos2011-05-021-0/+3
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33125 b3059339-0415-0410-9bf9-f77b7e298cf2
| * codecs.conf, stheader.h: support CrystalHD decoding (libavcodec)cehoyos2011-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | Add the various decoders to codecs.conf and increase the maximum number of buffered pts in stheader.h (apparently CrystalHD can have very high decoder lag). Patch by Philip Langdale, philipl overt org git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33095 b3059339-0415-0410-9bf9-f77b7e298cf2
| * audio: do not run the AC-3 parser on byte-swapped AC-3reimar2011-04-131-1/+4
| | | | | | | | | | | | | | | | | | Libavcodec has no parser that would work on byte-swapped AC3, but at least don't run the normal AC-3 one which would only break things. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33026 b3059339-0415-0410-9bf9-f77b7e298cf2 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33027 b3059339-0415-0410-9bf9-f77b7e298cf2
| * codecs.conf, mp_taglists.c: add LXF PCM and dvvideocehoyos2011-04-121-0/+4
| | | | | | | | | | | | | | | | | | | | Support audio in Leitch/Harris' VR native stream format (LXF). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32990 b3059339-0415-0410-9bf9-f77b7e298cf2 Support dvvideo in Leitch/Harris' VR native stream format (LXF). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32991 b3059339-0415-0410-9bf9-f77b7e298cf2
* | demux_ogg: fix slang selectionClément Bœsch2011-04-231-10/+4
| | | | | | | | | | | | Commit 59fff90d94 ("options: change -alang and -slang to use string list type") failed to change demux_ogg accordingly. Add the missing change.
* | Update libav API usesUoti Urpala2011-04-201-11/+14
| | | | | | | | | | | | | | | | | | | | | | Update various code to use newer alternatives instead of deprecated functions/fields that are being dropped at libav API bump. An exception is avcodec_thread_init() which is being dropped even though it's still _necessary_ with fairly recent libav versions, so there's no good alternative which would work with both those recent versions and latest libavcodec. I think there are grounds to consider the drop premature and revert it for now; if that doesn't happen I'll add a version-test #if check around it later.
* | cleanup: avoid various GCC warningsClément Bœsch2011-04-201-1/+1
|