summaryrefslogtreecommitdiffstats
path: root/mplayer.c
Commit message (Collapse)AuthorAgeFilesLines
* OSD: support displaying fractional part of current positionUoti Urpala2011-04-121-5/+33
| | | | | | | | Add option -osd-fractions which enables display of fractional seconds when showing the current playback time on OSD. Based on a patch from Christian <herr.mitterlehner@gsmpaaiml.com> but with several modifications.
* core: do proper audio track selection for -audiofile demuxerUoti Urpala2011-04-021-6/+3
| | | | | | | The select_audio() call was done on the main demuxer, not -audiofile one (the "if (mpctx->num_sources)" test in the previous code was always true). Call it on the -audiofile demuxer instead. The -audiofile stuff still needs a proper cleanup later though.
* configure, Windows: support static pthreads on WindowsDiogo Franco2011-03-301-0/+13
| | | | | | Windows pthreads requires certain functions to be called to initialize itself. It can do that through DllMain but no such luck when linked statically; mplayer needs to call the initialization explicitly.
* core: hr-seek: fix soft hang with hrseek past EOFUoti Urpala2011-03-031-2/+3
| | | | | | | | | | | | | | | | When doing a precise seek video_out->frame_loaded was left to true while frames were being skipped. However vo_get_buffered_frame() always returns success if a frame is already loaded; due to this the EOF detection in update_video() never triggered, and a hr-seek past EOF could cause a soft hang (commands were still processed and it was possible to seek again to exit the loop). This could also happen with Matroska files using ordered chapters if an underlying file was actually shorter than the chapter that was supposed to come from it. Then seeking to a timestamp after the end of the file but before the end of the chapter would trigger the bug. Fix the problem by setting frame_loaded to false when we decide to skip the frame in question.
* terminal output: change program name to "MPlayer2"Uoti Urpala2011-02-151-1/+1
|
* subs: Print a message when lavc subtitle decoding failsreimar2011-02-151-1/+4
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32865 b3059339-0415-0410-9bf9-f77b7e298cf2
* cleanup: mplayer.c: clean up pause_loop() a bitUoti Urpala2011-02-151-11/+11
|
* terminal output: show cache fill changes in "PAUSED" messagereimar2011-02-151-1/+22
| | | | | | | | | | | Convert cache_fill_status into a function so we always get the latest state, not whatever it was after the last read. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32818 b3059339-0415-0410-9bf9-f77b7e298cf2 Update PAUSED status line with cache fill status if it changed. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32819 b3059339-0415-0410-9bf9-f77b7e298cf2
* terminal output: change infamous "Core dumped" messageUoti Urpala2011-02-011-2/+2
| | | | | | The "Core dumped ;)" message printed after finishing a stream dump is known to confuse users but was kept as "humor". Change it to say "Stream dump complete." instead.
* translation: remove \r and \n from translated PAUSE stringUoti Urpala2011-01-311-8/+3
|
* mplayer.c: simplify code a bit, remove "main:" labelcboesch2011-01-311-13/+7
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32791 b3059339-0415-0410-9bf9-f77b7e298cf2
* cleanup: define ROUND() macro in mpcommon.hcboesch2011-01-311-2/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32751 b3059339-0415-0410-9bf9-f77b7e298cf2
* core: timing: fix overflow with extreme playback speedUoti Urpala2011-01-281-1/+5
| | | | | | | | With extreme playback speed changes it was possible to trigger an overflow in code calculating frame timing. This could break the VDPAU frame scheduling mechanism and lead to the shown picture not changing until reset by events such as seeking. Add an extra check to prevent the overflow.
* Merge branch 'sub'Uoti Urpala2011-01-261-49/+342
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-261-7/+7
| |
| * demux_mkv, chapters: change millisecond arithmetic to nsUoti Urpala2011-01-261-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | 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).
| * cleanup: rename ass_* functions to mp_ass_*Uoti Urpala2011-01-261-4/+4
| | | | | | | | | | | | | | | | The various ass_* functions were created when libass was part of the MPlayer tree and the distinction between MPlayer-specific and other functions was less clear. Now that libass is a clearly separate library, using the same ass_* namespace for player functions is ugly. Rename the functions to use mp_ass_ prefix instead.
| * subs: use correct font aspect ratio for libass + converted subsUoti Urpala2011-01-261-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rendering of ASS subtitles tries to be bug compatible with VSFilter and stretches fonts when the video is anamorphic (some scripts try to compensate for this VSFilter behavior, so trying to render them "correctly" would give the wrong result). However this behavior is not appropriate for subtitles we converted to ASS format ourselves for libass rendering, as they certainly don't have VSFilter bug workarounds. Change the code to use different behavior for "native" ASS tracks and converted ones. It's questionable whether the VSFilter-compatible behavior is appropriate for external .ass files either, as there could be anamorphic and non-anamorphic versions of the same video and the bug-compatible behavior can only be correct for one alternative at most. However it's probably better to keep it as a default at least, so that extracting a muxed subtitle track and using that does not give behavior different from the original muxed one. The aspect ratio setting is per ASS_Renderer, and changing it resets libass caches. For that reason this commit adds separate renderer instances to use for the "correct" and "VSFilter bug compatible" cases.
| * cleanup: some random minor code simplification and cleanupUoti Urpala2011-01-261-6/+3
| |
| * 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
| |
* | mp_msg: Remove uses of MSGT_MENCODERClément Bœsch2011-01-251-2/+2
| | | | | | | | | | Some of the code that could run outside MEcoder used MSGT_MENCODER. Replace those with appropriate MSGT_ types.
* | cleanup: remove unused MEncoder-related codeClément Bœsch2011-01-251-1/+0
| | | | | | | | | | Remove some code and variables that were no longer used after MEncoder removal. Also remove some MEncoder references in comments.
* | cleanup: mplayer.c: use VFCAP_ names instead of numeric valuesUoti Urpala2011-01-171-2/+2
|/
* 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: o