summaryrefslogtreecommitdiffstats
path: root/libmpdemux
Commit message (Collapse)AuthorAgeFilesLines
* demux_ts: change DVB SPU format for libavcodecreimar2011-02-151-3/+4
| | | | | | | | Change DVB SPU stream format in TS demuxer so it can be decoded by libavcodec (as soon as lavc is fixed not to fail just because of an extra padding byte). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32866 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_ts: DVB and PGS subtitle fixesreimar2011-02-151-6/+5
| | | | | | | | Fix r32587: the previous approach to return subtitles in time broke DVB subtitles due to returning incomplete packets and even for PGS subtitles resulted in incorrect pts values for the sub packets. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32864 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_ts: Set subtitle stream type correctly for DVB subtitlesreimar2011-02-151-0/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32862 b3059339-0415-0410-9bf9-f77b7e298cf2
* cleanup: remove some casts of memalign() return valuediego2011-02-151-4/+4
| | | | | | | Do not pointlessly cast the return value of memalign(). memalign() returns void*, which is compatible with any pointer in C. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32850 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_asf: add sanity checkreimar2011-02-151-0/+4
| | | | | | Check that rlen is valid before using it to increment a pointer. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32832 b3059339-0415-0410-9bf9-f77b7e298cf2
* fix compilation with old FFmpeg versionsUoti Urpala2011-02-081-1/+1
| | | | | | | | | | | | af_lavcac3enc: use old SampleFormat names without AV_ prefix, the latter were only added in 2010-11 vd_ffmpeg: add ifdef around CODEC_ID_LAGARITH use demux_real: use ffmpeg_files/intreadwrite.h stream/http.c, stream/realrtsp/real.c: define AV_BASE64_SIZE macro for old libavutil versions lacking it
* libmpdemux/mf.c: Don't hardcode filename lengthranma2011-01-311-2/+3
| | | | | | | | | Use limits.h to get the maximum length instead of hardcoding it. Original patch by Sang-Uok Kum. Signed-off-by: Tobias Diedrich <ranma@google.com> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32766 b3059339-0415-0410-9bf9-f77b7e298cf2
* Merge branch 'sub'Uoti Urpala2011-01-2610-84/+53
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sub: sub/OSD: move some related files to sub/ subtitles: options: enable -ass by default subtitles: change default libass rendering style demux_mkv, chapters: change millisecond arithmetic to ns cleanup: rename ass_* functions to mp_ass_* subs: use correct font aspect ratio for libass + converted subs cleanup: some random minor code simplification and cleanup vf_vo: fix EOSD change detection bug sd_ass: remove subreader use, support plaintext markup subtitles: style support for common SubRip tags and MicroDVD core: ordered chapters: fix bad subtitle parameter subs/demux: don't try to enable sub track when creating it subtitles/demux: store duration instead of endpts in demux packets subtitles: add framework for subtitle decoders options: add special -leak-report option subtitles: remove code trying to handle text subs with libavcodec cleanup: move MP_NOPTS_VALUE definition to mpcommon.h subtitles: move global ass_track to struct osd_state core: move most mpcommon.c contents to mplayer.c core: move global "subdata" and "vo_sub_last" to mpctx subtitles: remove sub_last_pts hack options: move -noconfig to option struct, simplify
| * sub/OSD: move some related files to sub/Uoti Urpala2011-01-267-13/+9
| |
| * demux_mkv, chapters: change millisecond arithmetic to nsUoti Urpala2011-01-263-39/+35
| | | | | | | | | | | | | | | | | | | | | | | | demux_mkv kept various integer timestamps in millisecond units. Matroska timestamp arithmetic is however specified in nanoseconds (even though files typically use 1 ms precision), and using ms units instead of that only made things more complex. Based on the demux_mkv example the general demuxer-level chapter structure also used ms units. Change the demux_mkv arithmetic and demuxer chapter structures to use nanoseconds instead. This also fixes a seeking problem in demux_mkv with files using a TimecodeScale other than the usual 1000000 (confusion between ms and TimecodeScale*ns units).
| * subs/demux: don't try to enable sub track when creating itUoti Urpala2011-01-181-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | demuxer.c new_sh_sub_sid() tried to immediately select the created sub track for playback if its id matched the "-sid" option value. This was buggy, as more initialization is needed to properly enable subtitles. Normally the correct track to play is selected after the demuxer has been created. It's possible that some DVD use case or such depended on the removed code to make -sid work with a subtitle track that's not found at start and only added later (vobsubs probably would start playing without separate initialization); if so then that needs to be fixed later in a different way.
| * subtitles/demux: store duration instead of endpts in demux packetsUoti Urpala2011-01-183-5/+5
| |
| * subtitles: add framework for subtitle decodersUoti Urpala2011-01-182-21/+4
| | | | | | | | | | | | | | | | | | | | Add a framework for subtitle decoder modules that work more like audio/video decoders do, and change libass rendering of demuxed subtitles to use the new framework. The old subtitle code is messy, with details specific to handling particular subtitle types spread over high-level code. This should make it easier to clean things up and fix some bugs/limitations.
| * cleanup: move MP_NOPTS_VALUE definition to mpcommon.hUoti Urpala2011-01-151-3/+1
| |
* | demux_ty: fix "seek to negative position" warningUoti Urpala2011-01-211-0/+1
| | | | | | | | | | | | | | | | | | demux_ty relied on demuxer->filepos being initially set to 0, but demuxer.c has been changed to initialize it to -1. This caused a "Invalid seek to negative position!" error message when running the demux_ty file format check (so it occurred for any file which had not been recognized as another type before that). Fix by making demux_ty initialize filepos to 0.
* | demux_lavf: reject format probe matches with low scoreUoti Urpala2011-01-211-1/+1
| | | | | | | | | | | | | | | | When trying to determine the format of an input stream, demux_lavf retries the probe with a larger buffer size up to some limit if the match score is low, but when reaching the size limit it accepted the best match (if any) regardless of its score. Change it to require a score of at least AVPROBE_SCORE_MAX/4 to accept a match at all.
* | demux: add sanity checks to packet allocation functionsUoti Urpala2011-01-172-11/+26
| | | | | | | | | | | | | | | | | | | | Change new_demux_packet() and resize_demux_packet() length parameter type from int to size_t and add a check to abort() if the size is over 1 GB. This should make integer overflow problems leading to memory corruption in demuxers less likely; and aborting should be no worse than insane memory consumption. Also make the functions abort() if the actual allocation fails instead of trying to continue with a zero-sized buffer.
* | cleanup: move demux packet functions from demuxer.h to demuxer.cUoti Urpala2011-01-172-61/+67
|/ | | | | There's no reason why the demux packet functions would need to be inlined, so move them from the header to the .c file.
* cosmetics: remove unused code, small formatting tweaksUoti Urpala2010-12-201-62/+1
|
* demux_mkv: remove old code for -nocorrect-pts supportUoti Urpala2010-12-201-131/+0
| | | | | There should be no reason for anyone to use demux_mkv in -nocorrect-pts mode any more, so delete the code used for that.
* demux_mkv: fix seeks to before the first index entryUoti Urpala2010-12-201-19/+16
| | | | | | | Make seeks backward from a time before the first index entry go to the first entry instead of failing completely. This change doesn't affect behavior for most files, because seeks are clamped to 0 from below and normally files have the first index entry at 0.
* demux_asf: Add a missing free to ASF demuxer closereimar2010-12-161-0/+1
| | | | | | Fixes bug #1238. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32711 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_mov: fix possible hang on invalid inputreimar2010-12-161-1/+1
| | | | | | | len < 8 is also invalid for 64-bit codec chunk size. Previous code could cause hang. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32708 b3059339-0415-0410-9bf9-f77b7e298cf2
* aviheader.c: avoid using uninitialized data in an error casereimar2010-12-161-1/+3
| | | | | | Avoid using uninitialized data if index read does not return enough data. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32707 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_mov: fix some memory allocation handlingreimar2010-12-161-5/+13
| | | | | | | | Always free before overwriting a pointer with a newly allocated one, always use calloc instead of realloc when the previous data is not needed. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32703 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_gif: Fix memleaks on errorreimar2010-12-161-0/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32701 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_ts: change overlapping memcpy to memmovereimar2010-12-161-1/+1
| | | | | | | Replace memcpy with memmove since at least src==dst is possible. Fixes another issue that is part of bug #1280. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32697 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_ts: fix several memleaksreimar2010-12-161-1/+17
| | | | | | Fixes bug 1280. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32696 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_ts: cleanupreimar2010-12-161-5/+4
| | | | | | | | | | | Replace malloc+memset with calloc and use sizeof(*variable). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32694 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace hard-coded number for loop limits for array index by the define used in the array declaration. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32695 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_ts: avoid using unitialized datareimar2010-12-161-0/+1
| | | | | | Add memset to avoid using uninitialized data with sample in bug 1280. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32693 b3059339-0415-0410-9bf9-f77b7e298cf2
* mp3_hdr.h: fix mp_check_mp3_header()reimar2010-12-161-3/+4
| | | | | | | | | | | Fix mp_check_mp3_header: it checked for a byte-swapped MP3-header on little-endian, and on big-endian it would only accept a MP3-header that would be valid when read in both directions. The latter was the reason for bug 905, causing the PS demuxer to claim files far too agressively (the MP3 check avoiding misdetection as DV is not exactly a sane approach, but it mostly works). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32692 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_demuxers: Fix crash with -audiofile and audio disabledreimar2010-12-161-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32691 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_asf, asfheader.c: cleanupreimar2010-12-162-6/+3
| | | | | | | | | | | | | | | | | | Move setup of sh_audio->format to a more appropriate place (in asfheader.c). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32684 b3059339-0415-0410-9bf9-f77b7e298cf2 Remove pointless assignments that are already handled in new_sh_audio. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32685 b3059339-0415-0410-9bf9-f77b7e298cf2 Remove useless assignment already done in new_sh_video. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32686 b3059339-0415-0410-9bf9-f77b7e298cf2 Use FFMAX for slightly better readability. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32687 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_real: fix some unaligned writesreimar2010-12-161-7/+8
| | | | | | | Fix some unaligned writes and avoid some (incorrect due to alignment) casts. Might also fix bug #371. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32683 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_audio: Do not generate nonsensical pts values for FLACreimar2010-12-161-2/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32678 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_audio: Set needs_parsing to 1 for DTS audioreimar2010-12-161-1/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32668 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux-ts: fix TS files with MP4 ES AAC descriptorreimar2010-12-161-1/+7
| | | | | | | | | Fix TS files with MP4 ES AAC descriptor to be correctly recognized as AAC and not AAC in LATM. This fixes playback of http://samples.mplayerhq.hu/A-codecs/AAC/freetv_aac_latm.ts, actual LATM samples seem unaffected. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32667 b3059339-0415-0410-9bf9-f77b7e298cf2
* mp_taglists.c: add tag for svq3compn2010-12-161-0/+1
| | | | | | | | Fixes: ffmpeg://rtsp://stream.diffusion.ens.fr/2008_10_03_albarede.mov and other X-SV3V-ES rtsp streams opened with ffmpeg:// git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32660 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_lavf: Add support for uncompressed BGR24 pixfmtreimar2010-12-161-0/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32659 b3059339-0415-0410-9bf9-f77b7e298cf2
* cosmetics: make some arguments const, "unsigned char"->uint8_treimar2010-12-163-3/+3
| | | | | | | | | | | | | | | | | | Mark input-only buffers as const. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32652 b3059339-0415-0410-9bf9-f77b7e298cf2 Use uint8_t type instead of unsigned char. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32653 b3059339-0415-0410-9bf9-f77b7e298cf2 Mark input buffer that is never modified as const. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32654 b3059339-0415-0410-9bf9-f77b7e298cf2 Mark input-only buffer as const. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32655 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_avi: Add WAVEFORMATEXTENSIBLE supportreimar2010-12-162-1/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32639 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_audio: fix WAVEFORMATEXTENSIBLE supportreimar2010-12-161-2/+2
| | | | | | | | | | Fix WAVEFORMATEXTENSIBLE support on big-endian. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32637 b3059339-0415-0410-9bf9-f77b7e298cf2 Fix WAVEFORMATEXTENSIBLE condition. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32638 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_ts: fix -sb when -aid stream is not foundreimar2010-12-161-1/+3
| | | | | | | | Make it seek back to the stream->start_pos position instead of 0 in that case. Fixes bug 1790. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32635 b3059339-0415-0410-9bf9-f77b7e298cf2
* audio: FLAC: support new libavcodec parser, use lavf to demuxUoti Urpala2010-12-093-1/+9
| | | | | Parse FLAC data with new libavcodec parser if needed. Use libavformat demuxer for raw FLAC files by default.
* demux_mkv, ad_ffmpeg: use Matroska OutputSamplingFrequency if availableUoti Urpala2010-11-212-0/+9
| | | | | | | | | | | | | | | | | | Use the value of the OutputSamplingFrequency element instead of the SamplingFrequency element as the "container samplerate". In most cases this only removes a warning, as those typically differ for SBR AAC files and there was already a special case detecting this in ad_ffmpeg. The implementation adds a new "container_out_samplerate" field to the sh_audio struct. Reusing the existing "samplerate" field and the equivalent inside the 'wf' struct and just setting those to the new value instead would probably work (at least I'm not aware of any codec that would need the original SamplingFrequency for initialization). However using a separate field also avoids some ugliness: the 'wf' struct may not exist (though most demuxers create it), and the 'samplerate' field is overwritten to reflect the final value decided by codec when decoding is first initialized.
* TOOLS/matroska.py: recognize 3 more elementsUoti Urpala2010-11-212-6/+36
| | | | | | Add definitions for DisplayUnit, OutputSamplingFrequency and FileDescription in matroska.py. Regenerate the C template files to allow using all current definitions in code.
* demux_lavf: fix check for files lavf doesn't recognizeUoti Urpala2010-11-171-1/+2
| | | | | | | Commit 91ea30c585 ("demux_lavf: use lavf for all formats except those listed") broke handling of files whose type libavformat couldn't recognize at all. Fix the demux_lavf probe function to correctly return failure in that case.
* demux: fix initial subtitle track selectionUoti Urpala2010-11-161-4/+4
| | | | | | | | | | Commit 3c2cfee488 ("demux: improve -alang / -slang track choosing logic") had a copy/paste error which left the subtitle code using audio variables and broke initial subtitle track selection. Fix. I actually realized soon after creating the original commit that I'd forgotten to change the variables and went back to fix it, but then somehow thought that it was already OK and didn't change it...
* demux_mkv: seek: fix bogus audio packet from earlier positionUoti Urpala2010-11-151-1/+2
| | | | | | | | | | Due to a bug created back in 2006 when SimpleBlock support was added, demux_mkv demuxed one audio packet from the initial file position after a seek, then skipped the following ones until a video keyframe was found. This wasn't very noticeable earlier, but it had bad effects after the recently added -initial-audio-sync code as the extra packet with an earlier timestamp confused timing calculations and resulted in desync after seeking. Fix.
* demux_mkv: fix minor seek problemUoti Urpala2010-11-151-1/+1
| | | | | | | | Commit fc66c94360 ("demux_mkv: seek: with no track-specific index entries use any") used uint64_t for a variable that should have been int64_t. Fix. The practical effects of this error were minor; mainly it made the player unnecessarily read the file contents between the previous index entry and the correct one when seeking.
* cleanup: remove NULL checks before free() all over the codecboesch2010-11-1420-81/+38
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32624 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_avi: remove pointless checksreimar2010-11-141-7/+6
| | | | | | | If audio_block_size is 0 that is a bug (and will result in a division by 0 in one case that does not check this), thus remove all checks for it. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32623 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_avi: modify to avoid -aid problem in svnreimar2010-11-141-22/+29
| | | | | | | | | | | [ Note: the questionable changes in svn that triggered this problem were never included in git, and so this commit is not strictly necessary here. It's included to reduce the differences between git and svn demux_avi versions. ] Fix possible division by 0 if -aid is used for AVI files. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32622 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_lavf: mark AVI timestamps non-pts to avoid messagesUoti Urpala2010-11-142-0/+7
| | | | | | | | Playing AVI files containing B-frames with demux_lavf printed two "decreasing pts" info messages at the start of the file. We know the timestamps from AVI won't be valid pts, so add a demuxer field to convey that information to the timing code and make that not even try to use the timestamps as valid pts.
* demux_lavf: use lavf for all formats except those listedAnton Khirnov2010-11-131-18/+12
| | | | | | | | lavf demuxers are mostly better and receive more maintenance, therefore it makes sense to prefer them in most cases. Change the "preferred" logic from listing all formats for which lavf is preferred to listing exceptions for which it isn't. Currently there are 3 exceptions: Matroska, FLAC and RealMedia (.rm).
* core: give pts as parameter to demuxer_get_current_chapter()Uoti Urpala2010-11-132-7/+3
| | | | | | | | | demuxer_get_current_chapter() accessed sh_video/sh_audio pts fields to determine playback position. demux layer shouldn't access those and the values used weren't quite correct anyway. Give the playback position as a parameter to the demux layer function instead. Also change the top-level get_current_chapter() to use get_current_time() in the timeline case where it didn't refer to demux layer.
* demux_nsv: don't write to sh_video->ptsUoti Urpala2010-11-131-1/+1
|
*