summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* options: add "choice" option type, use for -pts-association-modeUoti Urpala2010-12-184-5/+59
| | | | | | | | | | | | | Add a "choice" option type. Options of this type take a string as input and set an int option variable to the value corresponding to the string. The string->int mapping is option-specific and is given in the option definition. Strings not found in the mapping are rejected as invalid option values. Change the option -pts-association-mode to use this new option type and accept values "auto, decoder, sort" instead of "0, 1, 2". The change in accepted values shouldn't cause problems as this option is not appropriate to use in normal user config files.
* core: remove looping in update_video(), modify command handling a bitUoti Urpala2010-12-162-27/+47
| | | | | | | | | Let higher-level code call update_video() again instead of looping inside it until there's a frame ready to show. Change the conditions for running user commands somewhat. Overall effect shouldn't be that big. Now other commands can be executed after a seek before a video frame is decoded; in this case the seek target time may be used as the "current position".
* core: seek: use accurate seek mode with audio-only filesUoti Urpala2010-12-141-1/+1
| | | | Allow more accurate absolute-only seeks even if there is no video.
* core: avoid using sh_video->pts as "current pts"Uoti Urpala2010-12-143-15/+19
| | | | | | Add a new field "video_pts" to mpctx. It records the time of the last frame flipped visible on VO. Change various code which used sh_video->pts to use either the new field or get_current_time(mpctx).
* libvo: register X11 connection fd in input event systemUoti Urpala2010-12-144-17/+26
| | | | | | | | | | | | | | Register the X11 connection fd in the input system so that mp_input_get_cmd() can immediately wake up and handle keyboard or other X events. The callback calls vo_check_events() and tells the input system to handle any input possibly recorded during that. Before this was done for vo_xv only; this commit generalizes it to all VOs that call vo_x11_create_vo_window() - those are hopefully ones that will handle all X events in check_events(). The callback is only kept registered while the vo is properly configured. At other times calling check_events() would not clear pending input and so could lead to a busy loop.
* core: timing: add special handling of long frame intervalsUoti Urpala2010-12-141-35/+36
| | | | | | | | | Add separate handling for the case where the time to flip the next frame on the VO is more than 50 ms away. In that case don't update OSD contents yet, but wait for possible changes until 50 ms before the frame. Sleep until that time in mp_input_get_cmd(), so the sleep is done in select() and input events can be responded to immediately. Also raise the limit on audio out delay used to limit sleep.
* core: move central play loop to a separate functionUoti Urpala2010-12-131-289/+287
|
* vo_vdpau: remove wrong mp_image usage_count change (no visible effect)Uoti Urpala2010-12-131-1/+1
| | | | | | | The wrong variable was used as a function argument, and as a result the code modified the usage_count field of non-refcounted mp_image types. This error did not have any effect on visible behavior as no code cares about the field value in the affected case.
* 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.
* ao_pcm: change message to mention "-novideo" instead of "-vc null"Uoti Urpala2010-12-082-2/+2
| | | | | | | | | -novideo is the right way to disable video, and should also work in more cases now that lavf is used as the default demuxer for more formats (like AVI; internal AVI demuxer fails with -novideo). Also change the man page description of -novideo a bit to make it sound less negative about the chances of the option working.
* core: ordered chapters: add heuristic for merging inaccurate chaptersUoti Urpala2010-11-265-6/+32
| | | | | | | | | | Some Matroska files have inaccurate ordered chapter endpoints, and so parts where one chapter should end and the next begin at the same timestamp were not merged. This resulted in an unnecessary seek over a minimal distance. Add a heuristic to merge parts with a minimal gap or overlap between them. Based on patch by Hector Martin <hector@marcansoft.com>.
* ad_liba52: fix -a52drc handlingUoti Urpala2010-11-231-1/+1
| | | | Custom values other than 0 were ignored. Fix.
* core: make initial audio sync more robust against bad demuxersUoti Urpala2010-11-211-41/+45
| | | | | | | | | | | | | | | | | ogg/ogm demuxers can give first audio packets without timestamp after a seek. Due to some backwards compatibility code this results in the sync code getting audio timestamp 0. In this case a lot of audio was dropped unnecessarily when seeking to a position later in the file, as the code saw audio starting from 0, video from something larger. Make the code more robust in two ways. First, add a special case to not try syncing if we get audio timestamp <= 0 (hopefully there aren't many files where we'd really get audio starting from 0 and video from a later timestamp). Second, when throwing audio away, make the code recalculate from scratch the amount of bytes that still need to be thrown away after every decode call. This limits the amount of damage initial too-small timestamps can do, as the code will see the better timestamps after a while.
* demux_mkv, ad_ffmpeg: use Matroska OutputSamplingFrequency if availableUoti Urpala2010-11-213-11/+25
| | | | | | | | | | | | | | | | | | 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-213-6/+39
| | | | | | 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...
* options: fix autoloaded profile handling of flag optionsUoti Urpala2010-11-151-0/+3
| | | | | | | When loading automatically enabled profiles (like "[extension.avi]") flag options were handled as on the command line; for example "fs=no" was interpreted like "-fs" on command line, ignoring the "no" part. Fix the parsing to treat them the same as other config file entries.
* 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-14119-481/+277
| | | | 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
* stream/url.c: Unescape username/password when parsing URLsreimar2010-11-141-1/+4
| | | | | | | This makes MPlayer handle it the same way as curl, and it also is the only method that works with http_proxy://...http://user:password@... git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32621 b3059339-0415-0410-9bf9-f77b7e298cf2
* vo_gl: create stereo-capable window when using Quadbuffer 3Dreimar2010-11-143-0/+5
| | | | | | | Select a stereo pixel format for window when Quadbuffer OpenGL was selected as 3D mode. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32620 b3059339-0415-0410-9bf9-f77b7e298cf2
* libvo/w32_common.c: Move setting of pixel format from init to configreimar2010-11-141-21/+21
| | | | | | This allows it to depend on flags etc. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32619 b3059339-0415-0410-9bf9-f77b7e298cf2
* cache: read up to 64 KiB at once from stream_filereimar2010-11-143-1/+7
| | | | | | | | | Make the file protocol read up to 64 KiB at once when the cache is used, assuming that files will generally be readable with high bandwidth. This should improve performance when playing e.g. from high-latency network shares. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32616 b3059339-0415-0410-9bf9-f77b7e298cf2
* mp3lib/dct64_sse.c: fix compilation with clangcehoyos2010-11-141-34/+34
| | | | | | | | Use fist(p)s instead of fist(p), fixes compilation with clang. Patch by İsmail Dönmez, ismail namtrac org git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32613 b3059339-0415-0410-9bf9-f77b7e298cf2
* libvo/w32_common.c: minor cleanupreimar2010-11-141-18/+19
| | | | | | | | | | Some indentation fixes. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32611 b3059339-0415-0410-9bf9-f77b7e298cf2 Simplify: Use early return instead of large if block. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32612 b3059339-0415-0410-9bf9-f77b7e298cf2
* sub_cc: modify parsing to fix problem with one samplereimar2010-11-141-6/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32609 b3059339-0415-0410-9bf9-f77b7e298cf2
* sub_cc: Allow selecting the Close Captioning channelreimar2010-11-143-13/+19
| | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32607 b3059339-0415-0410-9bf9-f77b7e298cf2 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32608 b3059339-0415-0410-9bf9-f77b7e298cf2
* cosmetics: Fix Bluray vs. Blu-ray typodiego2010-11-141-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32606 b3059339-0415-0410-9bf9-f77b7e298cf2
* codecs.conf: Prefer FFmpeg AAC decoder over libfaad2diego2010-11-141-2/+1
| | | | | | | | | | FFmpeg's AAC decoder is much faster than libfaad2. The only known exception is libfaad2 compiled in fixed-point mode on systems with slow FPUs. Now that LATM support in FFmpeg is complete, FFmpeg's AAC decoder has a similar feature set as libfaad2. This leaves no reason not to use FFmpeg by default. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32605 b3059339-0415-0410-9bf9-f77b7e298cf2
* DOCS/tech/codecs.conf.txt: document how to add ffmpeg codecscompn2010-11-141-0/+40
| | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32604 b3059339-0415-0410-9bf9-f77b7e298cf2 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32615 b3059339-0415-0410-9bf9-f77b7e298cf2
* stream/network.c: Replace hardcoded str size with sizeofcboesch2010-11-141-5/+5
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32603 b3059339-0415-0410-9bf9-f77b7e298cf2
* sub_cc.c: minor cleanupreimar2010-11-141-6/+5
| | | | | | | | | | Avoid unnecessary (). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32599 b3059339-0415-0410-9bf9-f77b7e298cf2 Use calloc instead of malloc+memset. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32600 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_lavf: mark AVI timestamps non-pts to avoid messagesUoti Urpala2010-11-143-1/+9
| | | | | | | | 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.
* options: more mplayer.c options moved to option structClément Bœsch2010-11-146-47/+46
| | | | | | Following options were moved: autoq, benchmark, [no]term-osd, term-osd-esc, playing-msg, [no]idle, [no]consolecontrols, list-properties.
* options: move various mplayer.c options to option structClément Bœsch2010-11-135-28/+22
| | | | | Following options were moved: [no]quiet, [no]autosync, softsleep, [no]rtc, rtc-device.
* 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: do initial A-V sync by modifying audio streamUoti Urpala2010-11-138-19/+130
| | | | | | | Add code to enforce matching pts with video when (re)starting the audio stream, by either cutting away the first samples or inserting silence at the beginning. New option -noinitial-audio-sync can be used to disable this and return to old behavior.
* core: give pts as parameter to demuxer_get_current_chapter()Uoti Urpala2010-11-133-11/+7
| | | | | | | | | 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
|
* .gitignore: add /tags, /TAGSUoti Urpala2010-11-131-2/+2
| | | | | Ignore index files from ctags/etags. Remove obsolete entries for ffmpeg and mencoder.
* audio: add -gapless-audio optionUoti Urpala2010-11-125-14/+37
| | | | | | | | | If the option is enabled and all audio has been buffered to the AO, then the player will move to the next file without waiting for the buffered audio to drain, while leaving the AO initialized. If the playback of the next file starts quickly enough (before the AO buffer empties) then it should continue writing audio to the same AO with no gap in between.
* audio: don't try to send partial samples to AO at EOFUoti Urpala2010-11-121-1/+2
| | | | | | | | | | At least with PCM it's possible to get an audio stream that doesn't end at a multiple of whole sample per channel. At least ao_alsa refuses to accept that part of input, and so EOF detection in fill_audio_out_buffers didn't trigger until the 0.04 second sanity check (as there "was still audio not sent to AO left"). Change the logic to detect EOF if there's less than one sample per channel of unsent data left.
* options: move -cache-min and cache-seek-min to option structClément Bœsch2010-11-115-11/+10
|
* options: move [no]hr-mp3-seek to option structClément Bœsch2010-11-114-9/+6
|
* options: move some demux options to option structClément Bœsch2010-11-116-57/+47
| | | | | Following options were moved: audiofile, audiofile-cache, subfile, demuxer, audio-demuxer, sub-demuxer, [no]extbased.
* core: rename update_video_immediately->restart_playbackUoti Urpala2010-11-112-9/+9
|
* 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".
* core: print an explicit error if file format detection failsUoti Urpala2010-11-101-2/+4
| | | | | | | When file format detection failed the output only said "Exiting... (End of file)" after "Playing <file>." (or possibly error messages triggered by format-specific check functions in between). Add an explicit "Failed to recognize file format." error message.
* 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-084-64/+57
| | | | | | | | | | | | 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.
* TOOLS/matroska.py: recognize MaxCache elementUoti Urpala2010-11-081-0/+1
|
* 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-083-22/+23
| | | | | | | | | | | 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
| |