summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* demuxer.h: avoid including stream.hUoti Urpala2011-08-195-1/+6
| | | | | | Drop the unnecessary include and add a missing direct include in some files. This also revealed that demux_rtp_internal.h was missing a config.h include, fix that too.
* aviheader.h: avoid including demuxer.hUoti Urpala2011-08-193-2/+4
| | | | | | | Remove unnecessary demuxer.h include from aviheader.h. Through stheader.h aviheader.h is included in a lot of files. Add missing mp_msg.h includes to av_sub.c and sd_ass.c (previously hidden by indirect inclusion through demuxer.h and stream.h).
* demux: avoid a copy of demux packets with lavf, reduce paddingUoti Urpala2011-08-193-26/+45
| | | | | | | | | | | | | When demux_lavf read a new packet it used to copy the data from libavformat's struct AVPacket to struct demux_packet and then free the lavf packet. Change it to instead keep the AVPacket allocated and point demux_packet fields to the buffer in that. Also change MP_INPUT_BUFFER_PADDING_SIZE to 8 which matches FF_INPUT_BUFFER_PADDING SIZE; demux_lavf packets won't have more padding now anyway (it was increased from 8 earlier when FF_INPUT_BUFFER_PADDING_SIZE was increased in libavcodec, but that change was reverted).
* talloc.[ch]: remove "type safety" hack that violates C typesUoti Urpala2011-08-192-8/+4
| | | | | | | | | | | | The destructors used by talloc take a "void *" first parameter. However talloc.h had a #define hack that treated the destructor as a function taking first parameter of type "typeof(ptr)" where ptr is the pointer the destructor is set for. I suppose this was done to add some kind of "type safety" against adding a destructor expecting another type of pointer; however this hack is questionable and violates the real C level typing. Remove the hack from the header and adjust talloc.c to avoid a warning about a C type violation that became visible after removing the hack.
* vf_screenshot: better check for pixel format swscale supportharklu2011-08-171-40/+14
| | | | | | | | | | vf_screenshot checked for a list of pixel formats that were known to work with swscale. However, the list was incomplete. If a pixel format was used that was not on the vf_screenshot list, but was supported both by swscale and the VO driver, mplayer2 would insert a useless scale filter to convert to a format supported by vf_screenshot. Fix this by making vf_screenshot check directly whether the pixel format is supported by swscale with sws_isSupportedInput().
* av_log: don't crash if called with NULL AVClassUoti Urpala2011-08-151-2/+6
| | | | | | At least libavformat mpegts demuxer may give bad parameters with NULL AVClass to the av_log callback. Check for this and print a warning instead of crashing.
* options, subs: add --ass-vsfilter-aspect-compatharklu2011-08-1210-3/+58
| | | | | | | | | Add option --ass-vsfilter-aspect-compat and corresponding property ass_vsfilter_aspect_compat. The setting controls whether to enable the emulation of traditional VSFilter behavior where subtitles are stretched if the video is anamorphic (previously always enabled for native SSA/ASS subtitles). Enabled by default. Add 'V' as a new default keybinding to toggle the property.
* vo_vpdau: fix preemption recovery broken in decec7f2a37e559dUoti Urpala2011-08-111-11/+22
| | | | | | | | Commit decec7f2a3 ("vo_vdpau: skip resize code if not fully initialized") broke preemption recovery because the resize code stayed incorrectly disabled when it would have been used to reinitialize things during recovery. Revert that commit and add different checks to avoid running various code when not in a fully functional state.
* ao_pcm: fix pointless message due to uninitialize variableUoti Urpala2011-08-111-1/+1
| | | | | | The variable corresponding to the "fast" suboption of ao_pcm was uninitialized. Fix. The only effect was possibly printing a warning about the suboption being deprecated even if it wasn't used.
* 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.
* demux_lavf: don't interpret MPEG codec tags as generic tagsUoti Urpala2011-08-101-3/+8
| | | | | | | | Don't interpret native MPEG codec tags using our generic format-agnostic codec tag tables. MPEG may use tag 3 for MP3, whereas the generic tables map 3 to uncompressed PCM. Make the code ignore the codec_tag field for the "mpeg" and "mpegts" libavformat demuxers and rely on the codec_id value provided by lavf only.
* core: allocate OSD text buffers dynamicallyharklu2011-08-094-17/+25
| | | | | | | 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: remove old disabled options that just print an errorUoti Urpala2011-08-091-60/+1
| | | | | | | Remove several old options that were deprecated and disabled years ago and whose only effect now was to show a custom error message about the option in question being deprecated and then exit. Also remove the -vd option which was just a stupid joke and never had useful functionality.
* 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.
* subs: libass: apply option changes to all track typesUoti Urpala2011-08-084-10/+13
| | | | | | | | | Libass rendering uses two renderer objects to support both VSFilter aspect ratio (mis)behavior emulation and correct rendering. When option values were changed during playback the changes were applied to the renderer used for the currently active track only, and old values could be used if the user then switched to a track using the other renderer object. Fix to update both renderers.
* subs: libass: remove bad ass_set_margins() on settings resetUoti Urpala2011-08-081-1/+4
| | | | | | | | | | | When libass-related options were changed at runtime, the reinitilization code executed ass_set_margins() with arguments that were correct for the vf_ass case but wrong for EOSD. This could cause the subtitles to be displayed incorrectly for one frame (vf_vo would run ass_set_margins() again with the correct parameters for the next frame). The call is actually redundant for the vf_ass case too as it's currently not possible to modify the margins during playback, so fix the problem by disabling the call.
* cleanup: move global ass_force_reload to struct osd_stateUoti Urpala2011-08-086-27/+27
|
* commands: property sub_scale: update old subs immediatelyharklu2011-08-081-0/+2
| | | | | | When using the "old" subtitle renderer (i.e. not libass), changes to this property were not reflected immediately, and came into effect only when the next subtitle event was rendered.
* cleanup: reformat command.cUoti Urpala2011-08-071-1022/+1014
|
* 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.
* commands: osd_show_property_text: fix \xNN escapesharklu2011-08-051-1/+1
| | | | | When handling escapes of the form '\xNN', m_properties_expand_string() incorrectly copied the last N to the output. Fix.
* commands: parsing: fix string argument quoting/escapingUoti Urpala2011-08-051-38/+26
| | | | | | | | | | | | | | Parsing of commands with string arguments had several problems. First, escape handling modified the original string, which broke keyboard command definitions with strings containing escapes. Second, in an argument like "\\" the second quote was incorrectly considered escaped even though the preceding '\' was itself escaped. Third, an unterminated quoted string resulted in the argument being set to NULL even if this violated the declared the minimum number of arguments to the command type; this could cause a crash in the code executing the parsed commands. Fix by rewriting the string argument parsing. Also change int/float argument parsing so that the whole command is rejected on error.
* 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.
* demux_mkv: skip files faster in ordered chapter file searchUoti Urpala2011-08-044-51/+95
| | | | | | | | | | | | Ordered chapter code tries opening files to find those matching the SegmentUID values specified in the timeline. Previously this scan did a full initialization of the Matroska demuxer for each file, then checked whether the UID value in the demuxer was a match. Make the scan code instead provide a list of searched-for UIDs to the demuxer open code, and make that do a comparison against the list as soon as it sees the UID in the file, aborting if there is no match. Also fix units used in "Merging timeline part" verbose message.
* options: commandline: don't print video filter list twiceUoti Urpala2011-07-311-14/+14
| | | | | | | | | Video filter help output was printed twice since it used a MSGT type that was not suppressed during preparsing. Fix. This removes a "ID_VIDEO_FILTERS" line that was printed --identify, but I'm not aware of anything using that and other things like audio filters have no such ID_ output either. Also change some printf() calls to mp_msg() in code printing filter-specific help.
* options: fix failure to parse trailing ',' in string listUoti Urpala2011-07-312-4/+5
| | | | | | A trailing separator in string list options was ignored after recent commit e873d703e9 ("options: change option parsing to use bstr"), which broke uses such as "-vo vdpau,". Fix.
* audio: export audio pts to AO driversUoti Urpala2011-07-315-28/+40
| | | | | Currently the pts value is not directly used by any AO. Will be used by encoding code.
* options: commandline: don't set bogus playtree option paramsUoti Urpala2011-07-311-0/+2
| | | | | | | | | | | | | | The command line parsing code recorded the next commandline argument, if any, as the parameter of any option recorded to playtree. Thus a command line like "mplayer file -fs -aid 1" would record option "-fs" with a bogus argument "-aid". Historically this triggered no visible problems because such bogus arguments were silently ignored when interpreting the options later. However after recent commit 507fa7e2c2 ("options: indicate ambiguous option parameters explicitly") parameters to flag options are no longer ignored, and the bogus values now triggered parsing errors. Add a check to stop recording parameters for old-style single-dash options if m_config_check_option() says the option did not consume any arguments.
* core: audio: improve audio-only seeks and position reportingUoti Urpala2011-07-312-11/+32
| | | | | | | | | | | | | | 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-302-3/+8
| | | | | | | 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).
* build: fix --enable-debug, remove some "#ifdef MP_DEBUG"Uoti Urpala2011-07-306-124/+1
| | | | | | | | | | | Recent commit 5d5ca22a6d ("options: commandline: accept --foo=xyz style options") left some bad code under "#ifdef MP_DEBUG" in playtree.c, which caused a compilation failure if configured with "--enable-debug". Fix this. Having the "#ifdef MP_DEBUG" there was completely unnecessary; it only increased the risk for this kind of problems for no real benefit - executing the asserts under it would have no noticeable performance or other penalty in default builds either. Remove several cases of such harmful "#ifdef MP_DEBUG".
* stream_cdda: fix incorrectly allocated option fieldUoti Urpala2011-07-301-3/+5
| | | | | | | After commit 39e373aa8d ("options: allocate dynamic options with talloc") dynamically allocated options must be allocated with talloc. stream_cdda allocated a string used with the option machinery using strdup(). Fix. Also silence a warning.
* vo: X key input: remove ambiguous KeySym remappingUoti Urpala2011-07-292-68/+63
| | | | | | | | | | | | Code mapping X keyboard events to internal player key names remapped the incoming KeySym values in a way that only kept information about the lowest byte of the value and whether or not the value was below 256. This caused collisions between values. Remove this obviously broken mapping and use the raw KeySym values instead. I'm not familiar enough with X key handling to tell whether there was any valid motivation whatsoever for the mapping, but the implementation was certainly broken; if something else breaks it'll have to be fixed later.
* options: commandline: print error type for parse failuresUoti Urpala2011-07-293-2/+29
| | | | | | | | | | | | If parsing an option fails, print a string corresponding to the parse function return value (M_OPT_MISSING_PARAM etc). The primary motivation is that the parsing code already outputs messages explaining most problems, but does not itself print anything in the missing parameter case. Before double-dash --options such errors were rare (or rather they resulted in the next commandline argument being silently misinterpreted as an argument to the previous option instead); but now an argument like "--ss" should give a better indication about the problem than just "Error parsing option".
* options: commandline: accept --foo=xyz style optionsUoti Urpala2011-07-297-132/+131
| | | | | | | | | | | | 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").
* playtree: use talloc to allocate file parametersUoti Urpala2011-07-291-23/+12
|
* options: commandline: allow "--" without filenames after itUoti Urpala2011-07-291-8/+2
| | | | | | | | | A "--" argument on the command line is used to indicate that all following arguments should be interpreted as filenames, not options. Specifying it as the last argument was considered an error. I see no particular reason to forbid the following filename list to be empty, nor do other programs with similar functionalitly I know about treat it that way. So just ignore a "--" with no more arguments.
* core: improve --loop handlingUoti Urpala2011-07-294-7/+9
| | | | | | | | 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.
* options: change option parsing to use bstrUoti Urpala2011-07-2917-690/+685
| | | | | | Using bstr allows simpler parsing code, especially because it avoids the need to modify or copy strings just to terminate extracted substrings.
* cosmetics: parser-cfg.c: reformatUoti Urpala2011-07-291-208/+208
|
* options: indicate ambiguous option parameters explicitlyUoti Urpala2011-07-2911-85/+96
| | | | | | | | Command line options like "-foo xyz" are ambiguous: "xyz" may be a parameter to the option "foo" or an unrelated argument. Instead of relying on the struct m_config mode field (commandline/file) pass parameters to specify ambiguous mode explicitly. Meant for "--foo" options which are never ambiguous on command line either.
* bstr: rename BSTR() -> bstr()Uoti Urpala2011-07-279-30/+31
| | | | | | Rename the BSTR() function to bstr(). The former caused a conflict with some Windows OS name, and it's no longer a macro so uppercase naming is less appropriate.
* options: move command line preparse together with parseUoti Urpala2011-07-264-53/+55
|
* asxparser: remove code confusing asx/player optionsUoti Urpala2011-07-261-25/+0
|
* cleanup: reformat parser-mpcmd.cUoti Urpala2011-07-261-218/+200
| | | | Also remove some redundant code.
* subs: fix per-file --ass-force-styleUoti Urpala2011-07-235-5/+5
| | | | | | | | | | | | | 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-236-15/+18
|
* input: fix input.conf parse errorsUoti Urpala2011-07-203-115/+67
| | | | | | | | | Commit df899f59be removing a write outside a buffer triggered another problem, as for some reason the code did not 0-terminate its read buffer in the specific case that it had encountered an EOF, and as a result could parse contents left in the buffer for a second time. Usually this resulted in parsing error messages. Fix the problem by rewriting the offending code in a less hacky form.
* input: fix problem with key autorepeatUoti Urpala2011-07-181-4/+3
| | | | | | | Recent commit 82b8f89baeaf ("input: rework event reading and command queuing") had a problem in the handling of commands generated by autorepeat code (this code is only used with joystick and Apple IR remote input). Fix (still untested though).
* cleanup: do libav* initialization on startupUoti Urpala2011-07-1820-79/+10
| | | | | | | 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.
* vf_qp: enable compilation depending on libavutil eval APIUoti Urpala2011-07-183-11/+6
| | | | | | Libavutil eval API seems to be enough for vf_qp, so enable the filter if the API is available. Also clean up some left over lines for other filters in Makefile.
* configure: make libavutil eval API check require newer versionUoti Urpala2011-07-181-1/+1
| | | | | The code now uses a newer syntax (av_expr_*), so require a newer version of libavutil which supports that.
* vo_vdpau: skip resize code if not fully initializedUoti Urpala2011-07-171-0/+5
| | | | | | | Window events or user commands could trigger a call to resize() before config() had been called. This caused at least error messages. Add a check to make resize() exit without doing anything in this case. It will be called again later when the output is configured.
* input: don't make fd 0 nonblockingUoti Urpala2011-07-172-10/+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-179-227/+224
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* cleanup: remove some unnecessary input.[ch] typedefsUoti Urpala2011-07-167-117/+85
| | |