summaryrefslogtreecommitdiffstats
path: root/libmpdemux
Commit message (Collapse)AuthorAgeFilesLines
* cleanup: move MP_NOPTS_VALUE definition to mpcommon.hUoti Urpala2011-01-151-3/+1
|
* 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
|
* options: move -cache-min and cache-seek-min to option structClément Bœsch2010-11-111-5/+2
|
* options: move [no]hr-mp3-seek to option structClément Bœsch2010-11-112-6/+4
|
* options: move some demux options to option structClément Bœsch2010-11-111-37/+27
| | | | | Following options were moved: audiofile, audiofile-cache, subfile, demuxer, audio-demuxer, sub-demuxer, [no]extbased.
* demux: change "%s file format detected" messageUoti Urpala2010-11-103-2/+11
| | | | | | | | | "libavformat file format detected" wasn't a very useful message due to the many file formats supported to libavformat. Change the message so that for demux_lavf it says something like "Detected file format: QuickTime/MPEG-4/Motion JPEG 2000 format (libavformat)" (using long name from FFmpeg), and for non-lavf something like "Detected file format: Matroska".
* demuxer.c: clean up demux_open_stream()Uoti Urpala2010-11-101-136/+98
| | | | | Refactor the code to avoid duplication. Behavior should be mostly the same as before.
* demux: error out if given invalid -demuxer optionUoti Urpala2010-11-101-0/+5
| | | | | | | | | The code choosing the demuxer to use only printed an error if given an unknown demuxer name, then continued with default demuxer selection. Change it to abort instead. This feels like more sensible behavior. Also there's no fallback to autodetection in the case where the demuxer name is recognized but the demuxer fails to open the file either.
* demux_lavf: add simple seek-by-bytes mode for MPEGUoti Urpala2010-11-101-3/+39
| | | | | | | | | Seeking in MPEG files with pts resets could fail completely, as it was always done by timestamps and those of course don't unambiguously specify a file position in such files. Add basic functionality for byte-based seeking and playback position reporting, and decide whether to use that functionality based on a simple heuristic (could be improved).
* demux: improve -alang / -slang track choosing logicUoti Urpala2010-11-082-57/+53
| | | | | | | | | | | | When -alang / -slang was specified the numerically first matching track (if any) was always chosen. This meant that specifying "-alang eng" could change the track choice even if all tracks were in English, because now the default flag of tracks was ignored. Change the logic to take the default flag into account as a secondary sorting key. The code also accepted prefix matches, so that "-slang g" would match track language "ger". I think that was not intentional. Change it to require exact matches.
* demux_mkv: seek: with no track-specific index entries use anyUoti Urpala2010-11-081-38/+46
| | | | | | | | | The Cue entries in typical Matroska files have information for the video track only. This caused seeks to fail when playing with -novideo, as demux_mkv tried to use audio track index entries then. Add a fallback case that uses any index entries without caring what track they're for if there are no entries specific to the track we're interested in.
* demux_mkv: fix relative seeks without indexUoti Urpala2010-11-081-3/+3
| | | | | | | | Relative seeks didn't add the current position as they should. Fix. Note that this had no effect in normal playback case even if the file had no index, because the "accurate_seek" logic at higher level would convert all commands to absolute seeks before calling demuxer level.
* demux_mkv: fix seek hang when going past end of file without indexUoti Urpala2010-11-081-0/+2
|
* demux_mkv: cleanup: separate index creation part of seekingUoti Urpala2010-11-081-59/+69
| | | | | Move the code to build an index and seek without using cue information from the file to a separate function.
* core: use correct demuxer with -audiofile / -subfileUoti Urpala2010-11-081-1/+1
| | | | | | | | | | | Various code referred to "mpctx->demuxer" where it should really have referred to the one used for audio/subtitles in case those differ. Fix by using "mpctx->d_audio->demuxer" etc instead. Disable the copying of streams in demux_demuxers; that was a partial workaround for things referring to the main demuxer (and it wasn't enough anyway). This fixes, among other things, switching audio tracks within the file specified by -audiofile.
* demux_demuxers: initialize stream_pts to MP_NOPTS_VALUEUoti Urpala2010-11-081-0/+1
| | | | | | | demux_demuxers doesn't run the normal demuxer.c initialization for new demuxers. Initialize stream_pts separately (it won't ever be changed with the current implementation). This at least avoids other code assuming it was set properly.
* core: move video pos/length query functions from demux to coreUoti Urpala2010-11-083-70/+1
| | | | | | | | | Move functions to query current playback position, percentage position and total video length from from the demuxer layer to top level. The functions need access to playback state that doesn't belong on the demuxing level. Make the new functions more capable and simplify some code that can now rely on them. This fixes some errors in displayed in OSD and slave mode information when using timeline (ordered chapters).
* demux: fix -correct-pts autoselection with -audiofileUoti Urpala2010-11-081-1/+1
| | | | | | Make demuxer-based -correct-pts autoselection base the decision on the video demuxer in case several are being used, such as with -audiofile.
* demuxer.c: add missing parser list fourccscehoyos2010-11-081-0/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32596 b3059339-0415-0410-9bf9-f77b7e298cf2
* demuxer.c: fix parser list fourcc typo: 'MPE '->'MP3 'cehoyos2010-11-081-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32595 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_ts: Fix subtitle sync issuesreimar2010-11-081-0/+5
| | | | | | | Ensure we queue all subtitle packets before demuxing the next video packet. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32587 b3059339-0415-0410-9bf9-f77b7e298cf2
* codecs_conf, mp_taglists: Use only one fourcc for LATMreimar2010-11-081-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32584 b3059339-0415-0410-9bf9-f77b7e298cf2
* demuxer.c: Add support for parsing LATMreimar2010-11-081-0/+5
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32582 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_lavf: Fix program switchingreimar2010-11-081-0/+12
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32580 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_lavf: Print PROGRAM_ID -identify output similar to demux_tsreimar2010-11-081-0/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32579 b3059339-0415-0410-9bf9-f77b7e298cf2
* codecs.conf, mp_taglists: Support FFmpeg LATM decodingcehoyos2010-11-081-0/+3
| | | | | | | | Also move libfaad codecs.conf entry into the same position as in svn (no functionality change since ffaac is marked buggy so only faad is used by default regardless or order). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32571 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_lavf: for avi, use packet .dts instead of .ptsUoti Urpala2010-11-061-4/+12
| | | | |