summaryrefslogtreecommitdiffstats
path: root/mplayer.c
Commit message (Collapse)AuthorAgeFilesLines
* core: print pause status message only once on consolewm42012-01-101-31/+55
| | | | | | | | | | | Since the recent OSD redraw changes, every GUI expose event causes the message "===== PAUSE =====" to be printed on console. This was a bit annoying, so change it so that it is only printed once when going into paused mode. It's also printed again if the cache status changes (when playing URLs), or when the status line is printed during pause mode (when you seek while paused). This also removes some minor code duplication.
* osd: always display pause icon when frame steppingwm42012-01-091-0/+3
| | | | | | | When the OSD was enabled and the player was paused by executing the frame_step command, the OSD still displayed the icon indicating playback. Fix this and always set the proper icon when the pause state is changed.
* cleanup: remove left over access_mpcontext.h (from GUI)Uoti Urpala2012-01-091-31/+0
| | | | | | access_mpcontext.h and the declared functions in mplayer.c were only used by the now deleted internal GUI. Remove the unused header and functions.
* ad_ffmpeg: pass packet side data from libavformatUoti Urpala2012-01-081-1/+1
| | | | | Pass avpacket->side_data when using a libavcodec audio decoder together with libavformat demuxer (this was already done for video).
* configure, build: remove --disable-libav supportUoti Urpala2011-12-111-4/+0
| | | | | Remove support for building the player without libavcodec and libavformat. These libraries are now always required.
* core: minor hrseek tweak (affects vo_vdpau deint frames)Uoti Urpala2011-12-061-3/+2
| | | | | | Remove no longer necessary tests from hrseek code. As a result each field of vo_vdpau framerate-doubling deinterlace modes is now considered as a possible seek target.
* core, vo: new window refresh logic, add slow-video OSD redrawUoti Urpala2011-12-061-6/+9
| | | | | | | | | | | | | | | | | | | | Remove code refreshing window contents after events such as resize from vo_vdpau, vo_gl and vo_xv. Instead have them simply set a flag indicating that a refresh is needed, and have the player core perform that refresh by doing an OSD redraw. Also add support for updating the OSD contents over existing frames during slow-but-not-paused playback. The VOs now also request a refresh if parameters affecting the picture change (equalizer settings, colormatrix, VDPAU deinterlacing setting). Even previously the picture was typically redrawn with the new settings while paused because new OSD messages associated with setting changes triggered a redraw, but this did not happen if OSD was turned off. A minor imperfection is that now window system events can trigger a single one-frame step forward when using vo_xv after pausing so that vo_xv does not yet have a copy of the current image. This could be fixed but I think it's not important enough to bother.
* core, vo: modify OSD redraw architecture, support EOSDUoti Urpala2011-12-061-1/+18
| | | | | | | | | | | | | | | | Previously the core sent VFCTRL_REDRAW_OSD to change OSD contents over the current frame. Change this to VFCTRL_REDRAW_FRAME followed by normal EOSD and OSD drawing calls, then vo_flip_page(). The new version supports changing EOSD contents for libass-rendered subtitles and simplifies the redraw support code needed per VO. vo_xv doesn't support EOSD changes because it relies on vf_ass to render EOSD contents earlier in the filter chain. vo_xv logic is additionally simplified because the previous commit removed the need to track the status of current and next images separately (now each frame is guaranteed to become "visible" soon after we receive it as "next", with no VO code running in the interval between).
* vo: do final frame draw only near page flipUoti Urpala2011-12-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Separate passing a new frame to VOs using the new API into two steps. The first, vo_draw_image(), happens after a new frame is available from the filter chain. In constrast to old behavior, now the frame is not actually rendered yet at this point (though possible slice draw calls can already reach the VO before). The second step, vo_new_frame_imminent(), happens when we're close enough to the display time of the new frame that we'll commit to flipping it as the next action and will not change the OSD over the previous frame any more. This new behavior fixes a previous problem with vo_vdpau and vo_gl in the situation where the player is paused after decoding a new frame but before flipping it; previously changing OSD in that state would switch to the new frame as a side effect. It would also allow an easy way to fix extra output files produced with something like "--vo=png --frames=1" with precise seeking, but this is not done yet. The code now relies on a new mp_image from the filter chain staying valid even after the vf_vo put_image() call providing it returns. In other words decoders/filters must not deallocate or otherwise invalidate their output frame between passing it forward and returning from the decode/filter call.
* Merge branch 'screenshot' (early part)Uoti Urpala2011-11-251-1/+6
|\
| * core: add infrastructure to get screenshots from VOswm42011-11-251-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a VO command (VOCTRL_SCREENSHOT) which requests a screenshot directly from the VO. If VO support is available, screenshots will be taken instantly (no more 1 or 2 frames delay). Taking screenshots when hardware decoding is in use will also work (vdpau). Additionally, the screenshots will now use the same colorspace as the video display. Change the central MPContext to be allocated with talloc so that it can be used as a talloc parent context. This commit does not yet implement the functionality for any VO (added in subsequent commits). The old screenshot video filter is not needed anymore if VO support is present, and in that case will not be used even if it is present in the filter chain. If VO support is not available then the filter is used like before. Note that the filter still has some of the old problems, such as delaying the screenshot by at least 1 frame.
* | options, core/hrseek: add --hr-seek-demuxer-offsetUoti Urpala2011-11-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | Some demuxers do not accurately seek to a keyframe before a given time but instead start too late. This means that precise seeks cannot work either. Most notably the libavformat mpeg demuxer exhibits this behavior depending on the file being played (with the internal mpeg demuxer precise seeks don't work at all). Add new option --hr-seek-demuxer-offset which can be used as a workaround with such demuxers. The value of the option is subtracted from the seek target position given to the demuxer when doing a precise seek.
* | core/hrseek: support precise seeks in audio-only caseUoti Urpala2011-11-141-4/+18
|/ | | | | | | Before, precise seeking only worked if there was a video stream; in the audio-only case playback always started from the demuxer seek position. Add code to cut away samples from the demuxer seek position to the seek target position.
* core, demux: fix --identify chapter output with ordered chapterswm42011-10-251-15/+50
| | | | | | | | | | | | | | | Information about individual chapters was printed during demuxer opening phase, and total chapter count (ID_CHAPTERS) was printed according to mpctx->demuxer->num_chapters. When playing a file with ordered chapters, this meant that chapter information about every source file was printed individually (even though only the chapters from the first file would be used for playback) and the total chapter count could be wrong. Remove the printing of chapter information from the demuxer layer and print the chapter information and count actually used for playback in core print_file_properties(). Also somewhat simplify the internal chapters API and remove possible inconsistencies.
* libmenu: remove OSD menu functionality (--menu)Uoti Urpala2011-10-251-63/+0
| | | | | | | | | | Something like the OSD menu functionality could be useful. However the current implementation has several problems and would require a relatively large amount of work to get into good shape. As far as I know there are few users of the existing functionality. Nobody is working on the existing code and keeping it compiling at all while changing other code would require extra work. So delete the menu code and some related code elsewhere that's used by nothing else.
* terminal output: show libav version numbers in verbose modeUoti Urpala2011-10-011-0/+1
|
* core: fix --sstepUoti Urpala2011-09-041-1/+1
| | | | | The --step option had broken at some point. Probably nobody uses it, but it was easy to fix.
* cosmetics: mplayer.c: minor tweaksUoti Urpala2011-09-041-21/+8
|
* options: move libass-related options to structUoti Urpala2011-09-031-3/+3
|
* core: remove bad workaround for files without FPS setUoti Urpala2011-08-251-7/+2
| | | | | | | | | | | | | Commit dde8b753e4 merged an mplayer1 change (r31328) that set correct_pts to true if FPS was not set (on the assumption that correct-pts mode could provide proper timing without FPS). As the merge commit noted this change was somewhat questionable, as the option shouldn't really change after things have already been initialized. After recent changes it can cause an outright crash (assert in ds_get_packet2() from 9c7c4e5b7d fails). Remove the hack. Also only print a warning about not having FPS if correct_pts is not set (in correct_pts mode not having FPS shouldn't be a real problem, as everything is based on timestamps anyway).
* core, demux, vd_ffmpeg: pass side data from demux_lavf to vd_ffmpegUoti Urpala2011-08-201-13/+13
| | | | | | | | | | | | Pass the libavformat packet side_data field from demux_lavf to vd_ffmpeg. Libavcodec/libavformat use this field for palette data, and passing it is required for the playback of some paletted video codecs. The implementation works by giving vd_ffmpeg a copy of the struct demux_packet used to store the video packet (from which it can access the avpacket field). The definition of struct demux_packet is moved to new file demux_packet.h so that vd_ffmpeg.c can use it without including all of demuxer.h.
* dvdnav: fix crash caused by missing line from 58834653c0Uoti Urpala2011-08-101-0/+1
| | | | | | The committed version of 58834653c0 ("dvdnav: make mp_dvdnav_save_smpi() more robust") was somehow missing one line which caused a crash with dvdnav. Add it back.
* core: allocate OSD text buffers dynamicallyharklu2011-08-091-14/+12
| | | | | | | The OSD text buffers (mp_osd_msg_t.text and osd_state.text) used to be static arrays, with the buffer sizes spread all over the code as magic constants. Make the buffers dynamically allocated and remove the arbitrary length limits.
* options: support --leak-report (double dash form)Uoti Urpala2011-08-081-1/+2
| | | | | The special option --leak-report is manually checked so didn't automatically get double-dash support. Update the test.
* core: minor audio-only+timeline fix for chapter handlingUoti Urpala2011-08-081-2/+2
| | | | | | Remove outdated "!mpctx->sh_video" checks in chapter seeking and naming functions left over from when timeline functionality did not support audio-only case.
* cleanup: reformat mplayer.cUoti Urpala2011-08-071-2000/+2174
| | | | | | I had delayed reformatting mplayer.c as I wanted to split it, but since I didn't come up with a good way to do that I'll clean up the messy formatting now.
* core: fix detection of files with no chaptersUoti Urpala2011-08-041-3/+3
| | | | | | | | Initialize mpctx->last_chapter_seek to -2 instead of -1. This changes get_current_chapter() return value to -2 for files which have no chapters. -2 is used by some commands related to chapters to recognize files without chapters and return failure without any effect in that case.
* audio: export audio pts to AO driversUoti Urpala2011-07-311-17/+28
| | | | | Currently the pts value is not directly used by any AO. Will be used by encoding code.
* core: audio: improve audio-only seeks and position reportingUoti Urpala2011-07-311-11/+31
| | | | | | | | | | | | | | Seeking while paused could result in the current audio pts being reported incorrectly due to relevant variables not being reinitialized after the seek until more audio was played. When playing audio-only files, this meant that current overall playback position could be reported incorrectly which in turn could break further seeks. Improve things on two levels: First, store the seek target position and use that as the current playback position for audio-only files until things can be reinitialized. Second, try to reinitialize audio decoding enough to know its current pts even while paused. Also avoid printing the actual huge negative value of MP_NOPTS_VALUE on the status line when pts could not be determined.
* core: audio: if audio pts is missing return MP_NOPTS_VALUEUoti Urpala2011-07-301-2/+7
| | | | | | | Change written_audio_pts() and playing_audio_pts() to return MP_NOPTS_VALUE if no reasonable pts estimate is available. Before they returned some incorrect value typically around zero (but not necessarily exactly that).
* options: commandline: accept --foo=xyz style optionsUoti Urpala2011-07-291-2/+2
| | | | | | | | | | | | Allow writing commandline options with two leading dashes. In this mode a parameter for the option, if any, follows after a '='; following separate commandline arguments are never consumed as a parameter to a previous double-dash option. Flag options may omit parameter and behave like old single-dash syntax. "--fs=yes", "--fs=no" and "--fs" are all valid; the first two behave like configuration file "fs=yes" and "fs=no", and last is the same as old "-fs" (same effect as "--fs=yes").
* core: improve --loop handlingUoti Urpala2011-07-291-6/+6
| | | | | | | | Make per-file loop option start from --ss position, not always 0. Do looping in more cases; before looping was only done when encountering real end of file, now it also happens for example at --endpos or --frames limits. Also move the --ss option to the option struct.
* subs: fix per-file --ass-force-styleUoti Urpala2011-07-231-1/+3
| | | | | | | | | | | | | The --ass-force-style option was only applied when the main libass library handle was created. Thus any per-file option changes later had no effect. Do the ass_set_style_overrides() call in per-file initialization instead so that possible changes will be applied. Also move the option variable to the option struct. Current libass will crash (usually) if you set style overrides to a nonempty value, then an empty one. It'll be easier to trigger this bug after this commit, but the problem is not on mplayer2 side. The fix is trivial so hopefully there will be a fixed libass soon.
* cleanup: subs: remove global ass_library variableUoti Urpala2011-07-231-11/+14
|
* cleanup: do libav* initialization on startupUoti Urpala2011-07-181-1/+1
| | | | | | | Do the global initialization of libavcodec and libavformat (avcodec_register_all(), av_register_all()) immediately on program startup and remove the initialization calls from various individual modules that use libavcodec/libavformat functionality.
* input: don't make fd 0 nonblockingUoti Urpala2011-07-171-5/+0
| | | | | | | | | | | | | | | Setting O_NONBLOCK on a file descriptor also affects all other fds that share the same underlying open file description, and in case of stdin such sharing is likely. Making stdin nonblocking can also make stdout nonblocking (they may be the same connection to a terminal), and it can also affect other processes (in "program1 | program2", the shell may give the same terminal connection to program1 as stdin and to program2 as stdout, thus program1 making its stdin nonblocking also turns program2's stdout nonblocking). To avoid these problems stop making fd 0 nonblocking. After the previous commit this should no longer cause problems as long as select() does not spuriously report the fd as readable.
* input: rework event reading and command queuingUoti Urpala2011-07-171-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rework much of the logic related to reading from event sources and queuing commands. The two biggest architecture changes are: - The code buffering keycodes in mp_fifo.c is gone. Instead key input is now immediately fed to input.c and interpreted as commands, and then the commands are buffered instead. - mp_input_get_cmd() now always tries to read every available event from every event source and convert them to (buffered) commands. Before it would only process new events until one new command became available. Some relevant behavior changes: - Before commands could be lost when stream code called mp_input_check_interrupt() which read commands (to see if they were of types that triggered aborts during slow IO tasks) and then threw them away. This was especially an issue if cache was enabled and slow to read. Fixed - now it's possible to check whether there are queued commands which will abort playback of the current file without throwing other commands away. - mp_input_check_interrupt() now prints a message if it returns true. This is especially useful because the failures caused by aborted stream reads can trigger error messages from other code that was doing the read; the new message makes it more obvious what the cause of the subsequent error messages is. - It's now possible to again avoid making stdin non-blocking (which caused some issues) without reintroducing extra latency. The change will be done in a subsequent commit. - Event sources that do not support select() should now have somewhat lower latency in certain situations as they will be checked both before and after select()/sleep in input reading; before the sleep always happened first even if such sources already had queued input. Before the key fifo was also handled in this manner (first key triggered select, but if multiple were read then rest could be delayed; however in most cases this didn't add latency in practice as after central code started doing command handling it queried for further commands with a max sleep time of 0). - Key fifo limiting is more accurate now: it now counts actual commands intead of keycodes, and all queued keys are read immediately from input devices so they can be counted correctly. - Since keypresses are now interpreted immediately, commands which change keybindings will no longer affect following keypresses that have already been read before the command is executed. This should not be an issue in practice with current keybinding behavior.
* options: fix -use-filename-title crash after recent 39e373aaUoti Urpala2011-07-101-1/+2
| | | | | | | | After commit 39e373aa8d ("options: allocate dynamic options with talloc") dynamically allocated options must be allocated with talloc. Code implementing -use-filename-title still set opts->vo_wintitle to a value from strdup(), triggering an abort when the option was freed. Fix.
* cleanup: silence most of the clang warningsClément Bœsch2011-07-091-1/+1
|
* Merge branch 'mplayer1_changes'Uoti Urpala2011-07-061-11/+73
|\
| * cleanup: mplayer.c: Factor out a bit of spudec codereimar2011-07-061-4/+8
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33662 b3059339-0415-0410-9bf9-f77b7e298cf2
| * dvdnav: make mp_dvdnav_save_smpi() more robustreimar2011-07-061-6/+10
| | | | | | | | | | | | | | | | | | | | Make mp_dvdnav_save_smpi more robust and ensure consistency of nav buffer. It seems that in_size could be negative sometimes, this would cause crashes if the malloc somehow succeeded. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33599 b3059339-0415-0410-9bf9-f77b7e298cf2
| * stream dump: print progress informationcigaes2011-07-051-1/+55
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33478 b3059339-0415-0410-9bf9-f77b7e298cf2
* | cleanup: remove useless set_codec_path() functionUoti Urpala2011-07-061-3/+0
|/ | | | | | | | This function was left over from older logic to manipulate the "codec_path" global variable. Now that variable is fully handled by the general option system, so that the only effect of the function was to introduce memory leaks in some circumstances. Delete the useless function.
* commands: change property mechanism to use talloc stringsUoti Urpala2011-07-031-1/+1
|
* audio: move ready-for-ao data buffer from decoder to AOUoti Urpala2011-07-021-47/+37
| | | | | | | | | | | | Move the buffer storing audio data ready to be fed to the audio output driver from the audio decoder object to the AO object. This will help encoding code deal with end of input, and may also be useful to improve other general gapless audio behavior (as AOs which do not accept chunks smaller than a certain size may keep them in the buffer while the decoder changes). Less data may be dropped now when changing audio filters or switching timeline parts.
* core: move m_config_free() last before exitreimar2011-06-291-5/+6
| | | | | | | | Move the call to m_config_free() to be the last thing done before exiting, otherwise mp_msg() might stop working if options it uses are freed/reset. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33380 b3059339-0415-0410-9bf9-f77b7e298cf2
* cleanup: remove warnings under libmenu/Clément Bœsch2011-06-241-1/+1
|
* input: add useful default pointer button bindingsGrigori Goronzy2011-06-141-0/+2
| | | | | | Add two mouse button bindings: 1) left button double click toggles fullscreen 2) right button pauses/unpauses
* audio: disallow partial samples, fix ad_pcm to complyUoti Urpala2011-05-071-0/+3
| | | | | | | | Add some asserts to check that decoders/filters produce complete samples (byte amounts must be multiples of channels*datatype_size) and that audio output drivers also accept input in complete units. Fix ad_pcm which was known to violate this if its last input packet didn't stop at a sample boundary.
* ao_pcm, core: use new API in ao_pcm, change timing with itUoti Urpala2011-05-051-3/+8
| | | | | | | | | | | | | | | | | Change ao_pcm to use the new audio output driver API and clean up some of the code. Rewrite the logic controlling how playback timing works when using -ao pcm. Deprecate the "fast" suboption; its only effect now is to print a warning, but it's still accepted so that specifying it is not an error. Before, timing with -ao pcm and video enabled had two possible modes. In the default mode playback speed was rather arbitrary - not realtime, but not particularly fast. -ao pcm:fast tried to play back at maximum video playback speed - mostly succeeding, but not quite guaranteed to work in all cases. Now the default is to play at realtime speed. The -benchmark option can now be used to get faster playback (same as the video-only case). In the audio-only case playback is always maximum speed.
* input: make slave command file descriptors nonblockingUoti Urpala2011-05-041-2/+8
| | | | | | | Neither fd 0 slave input (-slave) nor additional opened fds (-input file=X) were set to nonblocking mode as they should have been. Fix. Also rename the horribly generic USE_SELECT #define used for a specific slave input detail.
* Merge branch 'mp