summaryrefslogtreecommitdiffstats
path: root/mplayer.c
Commit message (Collapse)AuthorAgeFilesLines
* subtitles: style support for common SubRip tags and MicroDVDUoti Urpala2011-01-181-2/+2
| | | | | | | | | | | SubRip subtitles have no "official" spec for any styling support, but various tags are in common use; previous code filtered out text between <> to remove HTML-style tags. Add support for those tags and for MicroDVD subtitle styling. The style display is implemented by converting the subtitles to the ASS subtitle format and displaying them with libass, so libass needs to be enabled. Original patch by Clément Bœsch <ubitux@gmail.com>.
* core: ordered chapters: fix bad subtitle parameterUoti Urpala2011-01-181-1/+1
| | | | | | | | | | | | mp_property_do() takes the value to set a property to through a pointer. The calling code used '&mpctx->global_sub_pos' as the pointer; however that variable could be changed during the mp_property_do() call. Use a pointer to a copy of the original value instead. I think this only caused problems if you switched subtitle tracks from a real one to "disabled" and then switched to a timeline part from another source.
* subtitles/demux: store duration instead of endpts in demux packetsUoti Urpala2011-01-181-6/+6
|
* subtitles: add framework for subtitle decodersUoti Urpala2011-01-181-30/+30
| | | | | | | | | | 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.
* options: add special -leak-report optionUoti Urpala2011-01-151-1/+2
| | | | | | | | | | | | Add a special option "-leak-report" that enables talloc leak reporting. It only works if it's given as the first argument. The code abuses the CONF_TYPE_PRINT option type to make main option parsing ignore the option. The parser incorrectly consumed the following commandline argument as a "parameter" for options of this type when they had the flag to not exit after printing the message. Fix this. It makes no difference for any previously existing option I think.
* subtitles: remove code trying to handle text subs with libavcodecUoti Urpala2011-01-151-5/+2
| | | | | | | | | | The avsub implementation tries to fall back to MPlayer's other text subtitle decoding if libavcodec returns text as the 'decoded' subtitle. The code implementing this is buggy, and as far as I can see it should not be triggered normally (libavcodec decoding is only used for xvid, pgs and dvb subtitles, and for those libavcodec should return bitmaps). Remove the buggy code (don't try to support non-bitmap results) and simplify things a bit.
* subtitles: move global ass_track to struct osd_stateUoti Urpala2011-01-151-9/+6
|
* core: move most mpcommon.c contents to mplayer.cUoti Urpala2011-01-151-9/+305
| | | | | | | | | | | | | | | | The contents of mpcommon.c were quite arbitrary; the most common reason to place some functions in this file had been "MEncoder happens to need similar code as MPlayer and we want to share some parts, but we have no clue whatsoever how to organize things in a sensible way, so we'll just dump those parts we want to share in mpcommon.c". As a result of containing an essentially random subset of top-level player functionality the mpcommon.h header required access to central structs and was unsuitable for inclusion in lower-level code, but was nonetheless included there for the mplayer_version symbol. Move almost all contents from mpcommon.c to mplayer.c. mplayer.c is already big and should perhaps be split further, but keeping a few random functions in mpcommon.c would not be an improvement.
* core: move global "subdata" and "vo_sub_last" to mpctxUoti Urpala2011-01-111-9/+9
|
* options: move -noconfig to option struct, simplifyUoti Urpala2011-01-111-2/+3
|
* core: add timing workaround for PulseAudio misbehaviorUoti Urpala2011-01-011-0/+3
| | | | | | | PulseAudio could keep reporting high delay values after a reset of playing audio. This broke playback after seeking in some cases. Add a workaround that should make things more robust against such misbehavior.
* core: fix audio-only + framestep weird behaviorUoti Urpala2010-12-201-0/+5
| | | | | | | Trying to do a framestep while playing an audio-only file would play the file until the end, then start the next file in paused state. Make framestep state enter pause again immediately if there is no video. Also reset framestep state when switching files.
* Merge branch 'hr-seek'Uoti Urpala2010-12-201-364/+465
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * hr-seek: input: add default keybindings Shift+[arrow] for small exact seeks input: support bindings with modifier keys for X input core: audio: make ogg missing audio timing workaround more complex core: add support for precise non-keyframe-limited seeks core: add struct for queued seek info commands: add generic option -> property wrapper options: add "choice" option type, use for -pts-association-mode core: remove looping in update_video(), modify command handling a bit core: seek: use accurate seek mode with audio-only files core: avoid using sh_video->pts as "current pts" libvo: register X11 connection fd in input event system core: timing: add special handling of long frame intervals core: move central play loop to a separate function Conflicts: DOCS/tech/slave.txt
| * core: audio: make ogg missing audio timing workaround more complexUoti Urpala2010-12-201-2/+15
| | | | | | | | | | | | | | | | | | | | | | After the addition of exact seeking the code to work around missing audio timestamps with ogg/ogm needs improvement. Now it's normal to need adjustment at stream start time 0 (seeking to a position after start of video but before second keyframe) with any video format, and for exact seeks with ogg it's now more important not to skip the sync. Make the check to detect the problem case more precise to avoid affecting most other formats, and try to decode a second of audio (hoping to get timestamps for those packets) before giving up.
| * core: add support for precise non-keyframe-limited seeksUoti Urpala2010-12-201-10/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | Add support for seeking to an arbitrary non-keyframe position by decoding video starting from the previous keyframe. Whether to use this functionality when seeking is controlled by the new option -hr-seek and a new third argument to the "seek" command. The default is to use it for absolute seeks (like chapter seeks) but not for relative ones. Because there's currently no support for cutting encoded audio some desync is expected if encoded audio passthrough is used. Currently precise seeks always go to the first frame with timestamp equal to or greater than the target position; there's no support for "matching or earlier" backwards seeks at frame level.
| * core: add struct for queued seek infoUoti Urpala2010-12-201-39/+83
| | | | | | | | | | | | | | | | To prepare for the addition of exact seek support, add a struct for queued seek state and a helper function to update its state. It would have been cumbersome to update additional state (showing whether the seek is forced to be exact or non-exact) manually at every point that handles seeks.
| * core: remove looping in update_video(), modify command handling a bitUoti Urpala2010-12-161-27/+44
| | | | | | | | | | | | | | | | | | 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-141-8/+11
| | | | | | | | | | | | 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).
| * 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
| |
* | cosmetics: remove unused code, small formatting tweaksUoti Urpala2010-12-201-2/+1
| |
* | commands: clean up get_metadata() and related codeUoti Urpala2010-12-201-73/+40
| | | | | | | | | | | | | | Code in get_metadata() allocated too small a buffer for the text it wrote (noticed by Clément Bœsch). Make the code cleaner and more robust by changing it to use talloc_asprintf(). Also make it always return non-NULL and remove checks on caller side.
* | Change some filename-handling code to use mp_basename()cboesch2010-12-161-22/+3
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32675 b3059339-0415-0410-9bf9-f77b7e298cf2
* | core: avoid using build_afilter_chain() directlyreimar2010-12-161-1/+2
| | | | | | | | | | | | | | | | | | | | build_afilter_chain is not safe to use directly, thus make it static and instead use reinit_audio_chain which should have better error handling. Fixes a crash with -af hrtf and changing speed, audio will still stop playing though. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32648 b3059339-0415-0410-9bf9-f77b7e298cf2
* | path.c: add function for mp_basename, remove duplicated macroscboesch2010-12-161-7/+4
|/ | | | | | | | | | | | | | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32630 b3059339-0415-0410-9bf9-f77b7e298cf2 Fix crash on path without directories. Regression introduced in r32630. Patch by Yuriy Kaminskiy yumkam at mail ru. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32631 b3059339-0415-0410-9bf9-f77b7e298cf2 Handle correctly paths with mixed '/' and '\' in it. Patch by Yuriy Kaminskiy (yumkam at mail ru) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32632 b3059339-0415-0410-9bf9-f77b7e298cf2 Handle ':' on systems with DOS paths: it allows paths like C:foo.avi. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32642 b3059339-0415-0410-9bf9-f77b7e298cf2
* core: ordered chapters: add heuristic for merging inaccurate chaptersUoti Urpala2010-11-261-6/+18
| | | | | | | | | | 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>.
* 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.
* cleanup: remove NULL checks before free() all over the codecboesch2010-11-141-2/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32624 b3059339-0415-0410-9bf9-f77b7e298cf2
* demux_lavf: mark AVI timestamps non-pts to avoid messagesUoti Urpala2010-11-141-1/+2
| | | | | | | | 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-141-32/+26
| | | | | | 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-131-19/+11
| | | | | Following options were moved: [no]quiet, [no]autosync, softsleep, [no]rtc, rtc-device.
* core: do initial A-V sync by modifying audio streamUoti Urpala2010-11-131-12/+91
| | | | | | | 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-131-4/+4
| | | | | | | | | 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.
* audio: add -gapless-audio optionUoti Urpala2010-11-121-12/+20
| | | | | | | | | 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-111-4/+2
|
* options: move some demux options to option structClément Bœsch2010-11-111-8/+3
| | | | | Following options were moved: audiofile, audiofile-cache, subfile, demuxer, audio-demuxer, sub-demuxer, [no]extbased.
* core: rename update_video_immediately->restart_playbackUoti Urpala2010-11-111-6/+6
|
* 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.
* demux: improve -alang / -slang track choosing logicUoti Urpala2010-11-081-4/+3
| | | | | | | | | | | | 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.
* core: use correct demuxer with -audiofile / -subfileUoti Urpala2010-11-081-3/+4
| | | | | | | | | | | 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.
* core: move video pos/length query functions from demux to coreUoti Urpala2010-11-081-26/+76
| | | | | | | | | 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).
* cleanup: don't check for NULL before free()diego2010-11-081-4/+3
| | | | | | patch by Clément Bœsch, ubitux gmail com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32598 b3059339-0415-0410-9bf9-f77b7e298cf2
* options: move -name and -title to option structClément Bœsch2010-11-041-2/+2
|
* options: move -dumpfile to option structUoti Urpala2010-11-021-5/+4
|
* cosmetics: remove some #if 0 code from mplayer.creimar2010-11-021-8/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32468 b3059339-0415-0410-9bf9-f77b7e298cf2
* mplayer.c: remove some obsolete commented-out linesdiego2010-11-021-10/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32427 b3059339-0415-0410-9bf9-f77b7e298cf2
* options: move audio_output_channels, audio_output_format to structUoti Urpala2010-11-021-2/+1
|
* mplayer.c: remove unnecessary #definediego2010-11-021-2/+0
| | | | | | | | Remove cache_fill_status #define. The #define is only set if CONFIG_STREAM_CACHE is not defined, but in this case the variable is not used. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32131 b3059339-0415-0410-9bf9-f77b7e298cf2
* cache: Move cache_fill_status extern declaration to cache2.hdiego2010-11-021-2/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32120 b3059339-0415-0410-9bf9-f77b7e298cf2
* menu: Move vf_info_menu extern declaration to menu.hdiego2010-11-021-1/+0
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32089 b3059339-0415-0410-9bf9-f77b7e298cf2 Mark vf_info_menu declaration as const. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32109 b3059339-0415-0410-9bf9-f77b7e298cf2
* loader: Disable loading codecs from the current directoryreimar2010-11-021-1/+5
| | | | | | | | | | While convenient, it is too risky. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32025 b3059339-0415-0410-9bf9-f77b7e298cf2 100l, we need to search for SetDllDirectoryA instead of SetDllDirectory git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32026 b3059339-0415-0410-9bf9-f77b7e298cf2
* core: Do not call *_aid_from_lang when audio_lang is NULLreimar2010-11-021-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31963 b3059339-0415-0410-9bf9-f77b7e298cf2
* cosmetics: Remove useless castreimar2010-11-021-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31916 b3059339-0415-0410-9bf9-f77b7e298cf2
* dvdnav: Support for image highlights for dvdnav menus.reimar2010-11-021-0/+6
| | | | | | Does not work 100% reliably and needs -sid 0. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31828 b3059339-0415-0410-9bf9-f77b7e298cf2
* audio: support parameter changes (e.g. channel count) during playbackreimar2010-11-021-43/+62
| | | | | | | | | | | | | | | | | Add support for parameter changes (e.g. channel count) during playback. This makes decoding AC3 files that switch between 2 and 6 channels work reasonably well even with -channels 6 and ffac3 decoder. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31737 b3059339-0415-0410-9bf9-f77b7e298cf2 Fix typo in error message: ACC -> AAC git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32473 b3059339-0415-0410-9bf9-f77b7e298cf2 Avoid printing AAC with SBR warning on every decode call, instead print it only after eve