summaryrefslogtreecommitdiffstats
path: root/mplayer.c
Commit message (Collapse)AuthorAgeFilesLines
* translations: add infrastructure for translated OSD messagesUoti Urpala2010-01-121-6/+21
| | | | | | | Add function set_osd_tmsg() which is a version of set_osd_msg that translates its format argument. Pass OSD message strings in the command.c property_osd_display table through mp_gtext before they're used.
* Merge svn changes up to r30185Uoti Urpala2010-01-081-0/+4
|\
| * Fixup SDL configure check:reimar2010-01-031-0/+4
| | | | | | | | | | | | | | | | | | | | - Make it work without sdl-config which adds at least useless or even hurtful cflags and also does not work for cross-compiling - If using sdl-config, make it use the CFLAGS we actually use for compiling instead of something else. Thus #undef main is needed in the test program. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30178 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30136Uoti Urpala2009-12-301-0/+7
|\| | | | | | | Ignore another broken correct-pts change in 30134.
| * Set some freed pointers to NULL.reimar2009-12-261-0/+5
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30118 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Free playtree_iter upon exiting MPlayerreimar2009-12-261-0/+2
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30117 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Remove more direct includes of libass/ass.hreimar2009-12-241-1/+0
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30105 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Add braces to avoid ambiguous else.reimar2009-12-071-1/+2
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29979 b3059339-0415-0410-9bf9-f77b7e298cf2
* | audio: Remove fixed decode_audio() return size limit (MAX_OUTBURST)Uoti Urpala2009-12-291-48/+41
| | | | | | | | | | | | | | | | | | | | | | | | A couple of months ago MPlayer's ALSA driver started rounding the amount of input data it was willing to accept in one call down to an integer multiple of the value it set in ao_data.outburst. In some configurations it was possible for this value to exceed the 64 KiB limit on the amount MPlayer was willing to write in a single call to the AO. As a result ao_alsa accepted 0 bytes in each play() call and audio playback failed. Fix this by removing the fixed 64 KiB limit on the amount of audio sent to AO at once; the limit was mostly a remnant of older code anyway.
* | Fix printf format strings with invalid '%lf' conversionUoti Urpala2009-12-151-1/+1
| | | | | | | | | | | | | | Some code used an invalid '%lf' conversion specification for double arguments. Maybe they were written that way due to confusion with scanf where doubles are indicated by '%lf'; however it is not a valid printf format specifier. Change those cases to use '%f'.
* | -identify output: use ordered chapters length for ID_LENGTHUoti Urpala2009-12-131-1/+3
| | | | | | | | | | | | Print the overall timeline length as ID_LENGTH instead of the length of the main file. This may help external GUIs handle ordered chapters somewhat better.
* | options: Move ass_enabled to options structUoti Urpala2009-12-021-5/+6
| |
* | core: Fix timeline state at start of playbackUoti Urpala2009-12-021-2/+2
| | | | | | | | | | | | A timeline starting in the middle of a source file resulted in initial playback state not being set up properly. Fix this by forcing an absolute seek to initialize timeline state before playback starts.
* | mplayer.c: Remove unneeded blit_frame argumentsUoti Urpala2009-12-021-10/+7
| | | | | | | | | | | | | | The video updating functions no longer need to separately track whether a frame is available for flipping. That information is now available in video_out->frame_loaded, and all the separate tracking did was present opportunities for things to go out of sync.
* | core: Fix ordered chapter timeline building memory corruptionUoti Urpala2009-12-021-2/+5
| | | | | | | | | | | | | | | | | | Two arrays were allocated one element too small, causing writes beyond the allocated area. The bug was triggered when playing a Matroska file with ordered chapters where each chapter came from a different source and none of the sources was the original file. Noticed by Daniel Dawson <ddawson@icehouse.net>
* | Merge svn changes up to r29971Uoti Urpala2009-11-291-0/+1
|\|
| * Readjust the global number of subs when switching dvdnav track to takereimar2009-11-241-0/+1
| | | | | | | | | | | | | | into account any change in the number of DVD subtitles available. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29964 b3059339-0415-0410-9bf9-f77b7e298cf2
* | core: Fix rare corner cases in video frame generationUoti Urpala2009-11-231-3/+3
| | | | | | | | | | | | | | Check that frames added by filters reach the screen and are not just buffered by the VO, and give filters a chance to output added frames if previous frame at EOF was buffered by VO. It's unlikely that anyone ever noticed practical problems caused by these issues.
* | core: Handle VO-added frames even with correct-pts disabledUoti Urpala2009-11-231-3/+7
| | | | | | | | | | | | At least show the extra frames even if correct-pts mode is disabled. They cannot be timed properly though; the most practical way to fix that is to just move to correct-pts mode instead.
* | Merge svn changes up to r29962Uoti Urpala2009-11-231-4/+0
|\|
| * Remove useless check for valid fd with -dumpstream, the code does notreimar2009-11-171-4/+0
| | | | | | | | | | | | | | necessarily need it. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29927 b3059339-0415-0410-9bf9-f77b7e298cf2
* | core: Do OSD/subtitle updates at a more accurate pointUoti Urpala2009-11-221-10/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OSD contents such as video position and non-libass subtitles were updated just before feeding a video frame through filters. The updates were done at that point mainly for the benefit of vf_expand OSD rendering functionality, which draws the OSD contents when the frame passes through that filter. However this gave the wrong results for VO-drawn OSD if the filter chain or VO had any delay or timestamp manipulation: the OSD contents should reflect the most recent contents that were _output_ after any filtering, not the last frame that was fed _into_ the filtering machinery. This issue became more important after vo_vdpau started buffering frames by default. Move the OSD updates to be done just before the OSD is drawn, using the most accurate available information. This fixes the common case but worsens vf_expand OSD behavior (adding extra latency). A special case could be added to fall back to the previous behavior when vf_expand OSD is being used; however I don't consider that a high priority at the moment especially when other problems with vf_expand OSD would still remain. This has little effect on libass-rendered subtitles either way, because both vf_ass and VO libass rendering use timestamps from the filter chain and do not rely on separate position updates.
* | core: Add support for decoder reordering of pts valuesUoti Urpala2009-11-211-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a mode where libavcodec's reordered_opaque feature is used to associate container packet timestamps with decoded frames. This should improve behavior at least for MPEG files with interlaced h264; the previous code does not cope well with the libavformat demuxer producing two field packets with separate timestamps but the libavcodec h264 decoder only producing a single output frame for those two packets (so half the timestamps have no associated output frame). The current libavformat mpeg demuxer seems to finally work with interlaced h264 files and produce valid timestamps which are useful with a mode like this. By default MPlayer now selects between this new mode and the old one automatically based on the number of timestamp problems they cause; by default the new mode is used if both seem to work. The new option -pts-association-mode can be used to force a particular mode. If correct-pts mode is disabled this has no effect on timing. Also remove the "EXPERIMENTAL" marker from the manpage description of -correct-pts.
* | cosmetics: remove some unused variablesUoti Urpala2009-11-171-1/+0
| |
* | mplayer.c: Fix compilation with dvdnav enabledUoti Urpala2009-11-161-3/+3
| | | | | | | | | | I had forgotten to check dvdnav-specific code after last merge of svn changes.
* | Merge svn changes up to r29912Uoti Urpala2009-11-161-83/+106
|\|
| * Check that mpctx->audio_out is not NULL when trying to uninit it.reimar2009-11-131-1/+2
| | | | | | | | | | | | | | | | Make audio uninit consistent with e.g. the demuxer uninit code and also avoids a possible crash. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29908 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Added -name, -title and -use-filename-title options and implementation in ↵ptt2009-11-121-1/+5
| | | | | | | | | | | | X11 vos git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29904 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Whitespace cosmetics: fix pause_loop indentation/remove inconsistently used ↵reimar2009-11-111-37/+37
| | | | | | | | | | | | tabs. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29899 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Do not call resume on unpausing if we have already reached eof whilereimar2009-11-111-0/+3
| | | | | | | | | | | | | | being paused (e.g. because of a "pausing_keep_force pt_step 1"). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29898 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Remember which subtitle was auto-selected for dvdnav due to -slangreimar2009-11-111-1/+14
| | | | | | | | | | | | | | | | | | | | and if it is unchanged re-apply -slang on stream reset. This makes -slang work when used with menu navigation or in general when the subtitle is not available for parts of the playback or the subtitle stream ID changes during playback. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29897 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Factor out code that decides which subtitle to play.reimar2009-11-111-24/+28
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29896 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Use switch_program property from mplayer.c to set ts_prog.reimar2009-11-071-0/+4
| | | | | | | | | | | | | | | | This seems to leave the ts demuxer unaffected, but fixes -tsprog with the lavf demuxer. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29846 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Whitespace cosmetics: reindent reinit_audio_chain functionreimar2009-11-061-43/+43
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29843 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Remove some useless comments/commented-out code.reimar2009-11-061-3/+0
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29842 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Split assignment from error value check to avoid overcomplicated if () ↵reimar2009-11-061-2/+3
| | | | | | | | | | | | condition. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29841 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Reuse the init_error exit path also for init_best_audio_codec errors.reimar2009-11-061-3/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29840 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Simplify: use &= instead of a = b & a;reimar2009-11-061-1/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29839 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Remove some unnecessary else blocksreimar2009-11-061-3/+2
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29838 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Use an early return instead of a {} block over the whole function in ↵reimar2009-11-061-2/+2
| | | | | | | | | | | | reinit_audio_chain git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29837 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Disable audio when initializing the filter chain fails (can happen e.g. when ↵reimar2009-11-061-7/+8
| | | | | | | | | | | | | | | | | | | | | | the hwmpa decoder is used but the hardware does not support hardware MPEG audio). Otherwise this will lead to a crash later on when the decode code tries to access the audio filter chain. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29836 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Change dvdnav_reset_stream to not disable subtitles, since that breaksreimar2009-11-051-2/+0
| | | | | | | | | | | | | | | | | | selecting the subtitle via -slang or -sid. It is quite possible that removing it will cause other issues, though I could not see any with the DVDs I had available for testing. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29827 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge branch 'vdpau'Uoti Urpala2009-11-161-2/+28
|\ \
| * | Implement vsync-aware frame timing for VDPAUUoti Urpala2009-11-151-2/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Main things added are custom frame dropping for VDPAU to work around the display FPS limit, frame timing adjustment to avoid jitter when video frame times keep falling near vsyncs, and use of VDPAU's timing feature to keep one future frame queued in advance. NVIDIA's VDPAU implementation refuses to change the displayed frame more than once per vsync. This set a limit on how much video could be sped up, and caused problems for nearly all videos on low-FPS video projectors (playing 24 FPS video on a 24 FPS projector would not work reliably as MPlayer may need to slightly speed up the video for AV sync). This commit adds a framedrop mechanism that drops some frames so that no more than one is sent for display per vsync. The code tries to select the dropped frames smartly, selecting the best one to show for each vsync. Because of the timing features needed the drop functionality currently does not work if the correct-pts option is disabled. The code also adjusts frame timing slightly to avoid jitter. If you for example play 24 FPS video content on a 72 FPS display then normally a frame would be shown for 3 vsyncs, but if the frame times happen to fall near vsyncs and change between just before and just after then there could be frames alternating between 2 and 4 vsyncs. The code changes frame timing by up to one quarter vsync interval to avoid this. The above functionality depends on having reliable vsync timing information available. The display refresh rate is not directly provided by the VDPAU API. The current code uses information from the XF86VidMode extension if available; I'm not sure how common cases where that is inaccurate are. The refresh rate can be specified manually if necessary. After the changes in this commit MPlayer now always tries to keep one frame queued for future display using VDPAU's internal timing mechanism (however no more than 50 ms to the future). This should make video playback somewhat more robust against timing inaccuracies caused by system load.
* | | av_log callback handling overhaulUoti Urpala2009-10-311-0/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move av_log callback handling from vd_ffmpeg.c to a new file av_log.c and install the callback immediately when starting the program. Main functionality improvements of the new code: - The old version only installed the callback when opening an FFmpeg video decoder. If nothing had triggered that then av_log() messages from other sources (libavformat, audio decoding, swscale usage) bypassed MPlayer's output system completely. Now the callback is always installed. - Current av_log message severity levels are handled correctly. The old code used MSGL_ERR for some messages that should be MSGL_V. - Message type is now set for libavformat contexts (MSGT_DEMUXER / MSGT_MUXER). - The old code did "mp_msg_test(type, mp_level)" before actually determining the type, so that it always used MSGT_FIXME. This led to some messages being incorrectly dropped in case the user had specified module-specific verbosity levels. The old check in question was originally motivated by performance problems when there were a lot of callbacks; however it's not clear whether the part about it skipping the type determination was intentional (most of the performance problems must have come from the way the original code used snprintf) and in my tests current FFmpeg libraries have not generated unreasonable amounts of callbacks anyway.
* | Merge svn changes up to r29752Uoti Urpala2009-10-061-12/+40
|\| | | | | | | | | | | | | | | | | As part of merging subtitle-in-terminal changes make update_subtitles() only clear existing subtitles if called with the reset argument, and not try to set new ones. Later calls should set the needed new subtitles, and this change avoids some problems with trying to set subtitles when mp_property_sub() in command.c gets called from initialization code before full initialization.
| * Make -nosub work to disable subtitles even if -slang and dvd streams are used.reimar2009-09-291-2/+0
| | | | | | | | | | | | | | This sti