summaryrefslogtreecommitdiffstats
path: root/libmpdemux
Commit message (Collapse)AuthorAgeFilesLines
* 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
| | | | | | | | | | | | When playing avi files take timestamps from the .dts field of the packet instead of .pts. For avi libavformat returns the original avi timestamps in .dts; without GENPTS set .pts is sometimes unset, with GENPTS set it'll contain some made up values which are not correct pts. Current libavformat also has a bug take makes it loop over the whole avi file if you use GENPTS with video streams disabled. The timing code can cope with the avi timestamps even though they're not really pts.
* demux_lavf: avoid deprecated "first_iformat" by using newer APIUoti Urpala2010-11-061-2/+2
|
* demux_lavf: add hack for stream-changing ogg input (internet radio)Uoti Urpala2010-11-061-1/+56
| | | | | | | | | | | | | | | Some internet radio streams are ogg/vorbis with a new stream for each track (and the previous stream stops receiving data). Add a hack to ignore the stream number in packets when input seems to match this case; all packets will be effectively regarded as parts of the same audio stream. This workaround can't work perfectly with current lavf because it will keep adding streams and then hit its 20 stream maximum; at that point playback will likely fail. Print a warning about this problem and mention "-demuxer ogg" as a possible workaround. Currently there's no check that the vorbis extradata is actually compatible between the streams.
* demux_lavf: more future proof AVInputFormat name comparisonUoti Urpala2010-11-061-6/+20
| | | | | | | | AVInputFormat name fields consist of comma-separated components, more of which may be added in backwards-compatible versions. demux_lavf did a strcmp against the whole field at once; this would break if a component was added. Change the code to search for individual component matches within the field instead.
* Remove #warning preprocessor directivesdiego2010-11-021-1/+1
| | | | | | | | The #warning preprocessor directive is non-standard and not available with all compilers. Furthermore, the warnings it causes are noisy and have not led to getting any of the underlying issues fixed in the space of a decade. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32480 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_ts: fix subtitle stream breaking audio track switchcehoyos2010-11-021-2/+3
| | | | | | | | | Fix switching audio track with the native MPEG-TS demuxer after an additional subtitle stream was detected. Patch by KS Ng, hk D dmbth A gmail git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32445 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_lavf: handle new streams appearing during playbackreimar2010-11-021-0/+8
| | | | | | Based on patch by KS Ng - dmbth [hk.dmbth gmail com] git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32439 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_pva: move functions, add "static"diego2010-11-021-90/+88
| | | | | | | | | | Mark pva_get_payload() as static, it is not used outside of the file. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32435 b3059339-0415-0410-9bf9-f77b7e298cf2 Move pva_get_payload() around to avoid a forward declaration. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32436 b3059339-0415-0410-9bf9-f77b7e298cf2
* mpeg_hdr.c: move function to avoid forward declarationdiego2010-11-021-36/+34
| | | | | | Move mp_unescape03 function around to avoid forward declaration. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32433 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_real.c: Remove unused hexdump() forward declarationdiego2010-11-021-2/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32432 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_[mpg|ts|ty]: #include dec_audio.h for skip_audio_frame()diego2010-11-023-5/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32431 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_mkv: fix decoded length calculation of LZO decompressionreimar2010-11-021-2/+4
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32305 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_mkv: add some sanity checksUoti Urpala2010-11-021-16/+31
| | | | | | | | Add some checks to prevent bad files from creating arbitrarily large buffer blocks (which could result in integer overflows and memory corruption). Remove a test with little use from demux_mkv_decode(); it compared an int with size_t, and was useless on 64-bit platforms at least.
* build: enable/disable all FFmpeg libraries togetherUoti Urpala2010-11-024-16/+16
| | | | | | | | | Enable all of libavcodec, libavformat, libswscale, and libpostproc together (libavutil is always required). based on svn commit by diego: git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32226 b3059339-0415-0410-9bf9-f77b7e298cf2
* Remove MEncoderUoti Urpala2010-11-027-4328/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Disable MEncoder compilation and remove files used by MEncoder only. There's no attempt to remove all references to MEncoder from the build system, documentation etc at this point. Removed files: (muxers, audio/video encoders, misc) mencoder.c cfg-mencoder.h parser-mecmd.[ch] xvid_vbr.[ch] libmpdemux/muxer* libmpcodecs/ae* libmpcodecs/ve* libmpcodecs/native/rtjpegn.[ch] libmpcodecs/native/mmx.h // was used by rtjpegn only Rationale: MEncoder is still useful for some people, but there's not much potential for further development; in the long run almost all use cases can be handled better by solutions based on something else (for example using FFmpeg or encoding MPlayer output). FFmpeg is already getting video filtering support which should work for some common MEncoder uses. Keeping MEncoder working takes extra work that is away from player development. While that amount of work is not huge (mostly MEncoder can be just ignored), it's not completely insignificant either. MEncoder is still maintained to some degree in the svn tree, so if necessary it's possible to use it from there for now. This tree has never had major improvements for the MEncoder side, so using svn MEncoder instead should be no major loss.
* demux_nemesi: Remove a pointless ifreimar2010-11-021-15/+6
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32208 b3059339-0415-0410-9bf9-f77b7e298cf2 Reindent. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32209 b3059339-0415-0410-9bf9-f77b7e298cf2
* cleanup: malloc+memset->calloc, sizeof(TYPE)->sizeof(*ptr)reimar2010-11-0230-126/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace malloc+memset by calloc git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32181 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace malloc+memset by calloc. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32182 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace malloc+memset by calloc. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32183 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace some sizeof(type) by sizeof(*pointer) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32184 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace malloc+memset by calloc. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32186 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace malloc+memset by calloc. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32187 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace malloc+memset by calloc git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32188 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace sizoef(type) by sizeof(*ptrvar). Besides being consistent with FFmpeg style, this reduces the size of a patch to rename these types to not conflict with the windows.h definitions. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32189 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace malloc+memset by calloc. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32191 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace malloc+memset by calloc. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32192 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace sizeof(type) by sizeof(*ptrvar) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32193 b3059339-0415-0410-9bf9-f77b7e298cf2 Remove a useless cast. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32194 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace sizeof(type) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32195 b3059339-0415-0410-9bf9-f77b7e298cf2 Remove a useless cast. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32196 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace several sizeof(WAVEFORMATEX) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32197 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace one more instance of sizeof(WAVEFORMATEX); fix compilation. patch by Clément Bœsch, ubitux gmail com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32199 b3059339-0415-0410-9bf9-f77b7e298cf2 Avoid some pointless uses of sizeof() and one related cast. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32200 b3059339-0415-0410-9bf9-f77b7e298cf2 Merge one malloc() + memset() invocation into calloc(). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32202 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace malloc+memset by calloc git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32203 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace sizeof(WAVEFORMATEX) occurrences. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32205 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace malloc+memset by calloc. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32206 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace sizeof(BITMAPINFOHEADER) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32207 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_rtp: Remove pointless typedef keyworddiego2010-11-021-1/+1