summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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
| | | | | | | | | | | | Remove some unnecessary typedefs and remove pointless mp_ prefix from some internal struct names. Change the type of the "close_func" pointers from "void f(int fd)" to "int f(int fd)" so that using standard close() there is valid. Delete some useless assert() statements. Move internal MP_MAX_KEY_DOWN define from input.h to input.c.
* cosmetics: reformat input.h, fix commentsUoti Urpala2011-07-161-184/+181
|
* img_format.h, vo_gl: fix IMGFMT_IS_YUVP16() definitionUoti Urpala2011-07-141-1/+3
| | | | | | | Commit aba8a1838aa which added 9- and 10-bit formats failed to change the definition of the IMGFMT_IS_YUVP16() macro (which is misnamed btw, it matches 9, 10 and 16 bits). This prevented vo_gl from accepting input in supported 9 and 10 bit colorspaces. Fix.
* input.c: remove write to buffer[-1] in parse_config()Uoti Urpala2011-07-111-1/+0
|
* stream_bluray: switch to new libbluray APIRico Tzschichholz2011-07-102-8/+8
| | | | | | Switch to new libbluray API with three parameters to bd_get_title_info(). libbluray versions using the old API are no longer supported.
* 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.
* vd_ffmpeg: make "-lavdopts lowres" handling more robustUoti Urpala2011-07-091-11/+11
| | | | | | | | Remove the copy of the "lowres" field that vd_ffmpeg kept in its private struct and use the value from AVCodecContext directly instead. The copy gave no benefit and it could be set to the wrong value if someone used "-lavdopts o=lowres=X" (which would change the real value but not the copy).
* vd_ffmpeg: fix "-lavdopts skipframe" supportUoti Urpala2011-07-091-1/+5
| | | | | | | Support for -lavdopts skipframe had been broken since commit bc767c2a9 as framedrop logic now set the same field and thus overwrote the value set from the option. Change that code to set it to the original value instead of 0 when not dropping frames.
* cleanup: silence most of the clang warningsClément Bœsch2011-07-099-16/+17
|
* build: add a hack to prevent name collision with libtallocUoti Urpala2011-07-071-0/+10
| | | | | | | | | | | libsmbclient uses dynamically linked libtalloc.so which has symbols with names matching those in the internal talloc.c. This name collision caused a crash under stream_smb when trying to play anything with smb://. Add a "#pragma GCC visibility" hack to talloc.h to hide the internal symbols from being visible to the outside libtalloc.so. Hopefully this doesn't break any platform worse than possibly causing a compiler warning about an unknown pragma (at least GCC and clang recognize it).
* vo_directx: include <libavutil/common.h> for FFMINUoti Urpala2011-07-071-0/+1
| | | | | 070491f1029ca3d74322146e646d653f9f5dc153 added an use of FFMIN to vo_directx.c but failed to include a header for the macro. Fix.
* configure: clang: set custom warning flags for clangUoti Urpala2011-07-071-0/+2
| | | | | | | | | | Before there was no attempt to set warning flags sanely when compiling with clang. Set some reasonable defaults that cut down noise and enable various non-default warnings that are enabled with GCC too. I'm not sure whether clang is supposed to support more of the options now used with GCC - it accepts some of those options but they apparently have no effect; I didn't find any real documentation about the individual warnings.
* build: Revert "codec-cfg.c: avoid including aviheader.h"Uoti Urpala2011-07-071-3/+2
| | | | | | | | This reverts commit 1e544365bfd09e4649cb720716f86ec5b75d86ce. I was careless when cherry-picking the reverted commit - the only effect it had was add an unnecessary libavutil dependency to a HOST_CC compiled file.
* configure: rename "--disable-ass" to "--disable-libass"Uoti Urpala2011-07-061-4/+4
| | | | | | | The name of the project is "libass". "ASS" alone refers only to the subtitle format, not the library, and --disable-ass did not completely disable handling of subtitles in this format - only advanced rendering with libass. Thus --disable-libass is a better name.
* demux/mp_taglists: Move Bink audio tags to override listAnton Khirnov2011-07-061-2/+2
| | | | | | | | Some versions of lavf abuse codec_tag for passing Bink version information to the decoder, which broke detection based on codec tag (though this has already stopped again in latest Libav). Move bink audio codec IDs from mp_wav_tags to mp_codecid_override_tags so that codec tags are completely ignored for them.
* Merge branch 'mplayer1_changes'Uoti Urpala2011-07-0653-1158/+1072
|\
| * stream.c: make reconnect checks more robustreimar2011-07-061-14/+21
| | | | | | | | | | | | | | | | | | | | | | Improve checks for when to try reconnecting to be more thorough and readable. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33809 b3059339-0415-0410-9bf9-f77b7e298cf2 Reindent, add empty lines. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33810 b3059339-0415-0410-9bf9-f77b7e298cf2
| * stream.c: Pass streaming_ctrl eof on to struct stream fieldreimar2011-07-061-0/+2
| | | | | | | | | | | | | | | | Fixes a possible endless loop with HTTP files where seeking to the very end returns the full file again instead of e.g. an error. Apache/2.2.4 seems to show this behaviour. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33808 b3059339-0415-0410-9bf9-f77b7e298cf2
| * stream/network: don't clobber buffer byte counts on errorreimar2011-07-061-0/+1
| | | | | | | | | | | | | | Ensure we do not add strange values to amount of buffered bytes read on error. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33807 b3059339-0415-0410-9bf9-f77b7e298cf2
| * stream/network: distinguish EOF/error in streaming control APIreimar2011-07-061-1/+2
| | | | | | | | | | | | Signal EOF vs. error also via streaming control API (not yet evaluated). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33806 b3059339-0415-0410-9bf9-f77b7e298cf2
| * cache: don't modify argument when stream control failsreimar2011-07-061-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When handling STREAM_CTRL calls for the cached stream, do not modify the return parameter if the underlying stream returns an error for the operation. Avoids issues with some places that don't check the return value of stream_control. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33802 b3059339-0415-0410-9bf9-f77b7e298cf2 Remove condition that is now always true. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33803 b3059339-0415-0410-9bf9-f77b7e298cf2
| * cleanup: silence some clang warningsreimar2011-07-063-4/+4
| |