summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* input: modify interpretation of doubleclick eventsUoti Urpala2011-05-023-16/+19
| | | | | | | | | | | | | The code combining button presses into multibutton commands prevented single click commands from triggering if a doubleclick event had been generated from the same button press. As a result using the mouse wheel to seek worked very badly. Special-case doubleclick events in the event interpretation code to avoid this issue. This changes the sequence of generated "keys" for press-release-press-release from MOUSE_BTN0 MOUSE_BTN0-MOUSE_BTN0_DBL MOUSE_BTN0_DBL to MOUSE_BTN0 MOUSE_BTN0_DBL MOUSE_BTN0. "Keys" like MOUSE_BTN0-MOUSE_BTN0_DBL will never be generated now; any existing configuration files using those need to be changed.
* command.c: fix sub_remove crashUoti Urpala2011-05-021-1/+8
| | | | | The sub_remove slave command tried to access a NULL pointer when removing an external subtitle file displayed with libass. Fix.
* cleanup: input.c: simplify some string handling codeUoti Urpala2011-05-021-17/+11
| | | | Replace manual loops with strspn() / strcspn().
* cleanup: reformat input.cUoti Urpala2011-05-021-921/+957
|
* input: move all key code lists to input/keycodes.hUoti Urpala2011-05-0232-242/+225
| | | | | | | | | | | | | Move the definitions of all special key codes (those not passed by ASCII value) to input/keycodes.h. Before they were spread between osdep/keycodes.h, input/joystick.h, input/mouse.h and input/ar.h, plus some special values in input.h. This was especially inconvenient as the codes had to be coordinated to not conflict between the files. The change requires a bit of ugliness as appleir.c includes <linux/input.h> which contains various conflicting KEY_* definitions. Work around this by adding a special preprocessor variable which can be used to avoid defining these in keycodes.h.
* input: don't interrupt processing at unbound eventsUoti Urpala2011-05-011-6/+7
| | | | | | | | | | The input code read at most one event per input or command fd. If this event was not bound to any recognized command then no command was returned, and higher-level code could not distinguish this case from there being no pending events left. As a result unbound events would cause extra latency in event processing. Change the input code to continue reading events until it either finds one that maps to a command or hits EOF/error.
* input: make stdin non-blocking for terminal inputUoti Urpala2011-04-281-1/+7
| | | | | | | getch2.c did not make stdin non-blocking, and relied on only being called after select() had shown readability. Stop relying on that assumption and set stdin to non-blocking mode. Hopefully no relevant platform has problems with this...
* find_subfiles: fix unintended modification of global filenameUoti Urpala2011-04-281-1/+1
| | | | | | | | | | Commit a2d28010cc ("cleanup: find_subfiles.c: simplify (mainly using bstr)") was missing a bstrdup() in subtitle search code, and thus the code erroneously modified the original filename string passed in. As a result anything which printed or otherwise used the filename after that would use a lowercase-converted version instead of the actual file name. Fix by adding the bstrdup() to operate on a local copy of the name instead.
* vf_*: fix pts values passed to the next filterRudolf Polzer2011-04-2416-56/+269
| | | | | | | | | | | | Many video filters failed to calculate or even just pass through pts values for their output frames. Fix this, and also make the two remaining filters that called vf_next_put_image() twice for the same input frame (vf_softpulldown, vf_telecine) use vf_queue_frame() so that e.g. framestepping properly sees both frames. Changed filters: vf_bmovl, vf_detc, vf_divtc, vf_filmdint, vf_ivtc, vf_lavc, vf_phase, vf_pullup, vf_softpulldown, vf_telecine, vf_tile, vf_tinterlace.
* bstr.h: change BSTR() from macro to inline functionUoti Urpala2011-04-241-2/+6
| | | | | | | | Change BSTR() from a macro producing a compound literal to an inline function returning the same value. This works for all existing uses, and avoids a warning from BSTR(NULL) (the macro expansion contained strlen(NULL); this was valid code because the strlen call was never evaluated, but still triggered a GCC warning).
* demux_ogg: fix slang selectionClément Bœsch2011-04-231-10/+4
| | | | | | Commit 59fff90d94 ("options: change -alang and -slang to use string list type") failed to change demux_ogg accordingly. Add the missing change.
* input: sleep in event loop even if there are no input fdsUoti Urpala2011-04-221-19/+14
| | | | | | | | | The input loop select() call was only run if there was at least one input file descriptor. However other code uses the input loop to wait; this could result in the wait becoming a busy loop when running with -noconsolecontrols (without that there is at least one input fd for terminal input). Make the input loop call select() to sleep even if there are no input file descriptors.
* audio: fill small AO buffers more often in audio-only caseUoti Urpala2011-04-221-7/+16
| | | | | | | | | | | | | | | | Commit cbeed30ae8 ("core: wake up a bit less often for audio-only files") increased the sleep time between audio buffer fills. This turned out to cause problems on some machines where available audio buffer sizes are extremely limited (example cases included 85 ms for stereo and less for multichannel audio). Change the code to check the amount of buffered audio and shorten sleep times accordingly if needed. Such short buffers violate some assumptions made by video timing code, so they may still cause visible problems in some cases. At least on some machines using ALSA the problem seems to be caused by bad configuration defaults (small buffer memory limit which can be increased).
* configure: abort if certain libraries can't be foundUoti Urpala2011-04-201-2/+10
| | | | | | | Change the behavior of the iconv, freetype, fontconfig and libass tests when autodetection fails. They now abort instead of silently creating a crippled build. Users who really want to build without those features can use explicit --disable flags.
* configure: fix --enable-3dfx override without dgaUoti Urpala2011-04-201-0/+1
| | | | | | | | | If --enable-3dfx is specified but dga is not available then 3dfx is disabled nonetheless. However, this disabling is not done properly, and libvo/vo_3dfx.c is still compiled (but cannot be used). Fix. The behavior of automatically disabling vo_3dfx despite --enable-3dfx is itself questionable, but I'm not changing that now.
* Update libav API usesUoti Urpala2011-04-207-24/+25
| | | | | | | | | | | Update various code to use newer alternatives instead of deprecated functions/fields that are being dropped at libav API bump. An exception is avcodec_thread_init() which is being dropped even though it's still _necessary_ with fairly recent libav versions, so there's no good alternative which would work with both those recent versions and latest libavcodec. I think there are grounds to consider the drop premature and revert it for now; if that doesn't happen I'll add a version-test #if check around it later.
* manpage: restore -lavfdopts doc accidentally removed in d76ad5f2Uoti Urpala2011-04-201-0/+37
| | | | | | | | | For some reason the -lavfdopts option was documented under MEncoder options (despite not being MEncoder-specific), and was removed together with MEncoder documentation in commit d76ad5f227. Restore the documentation and convert it from its own section to normal option documentation form. Also fix the example to actually work with current lavf.
* config: remove pointless cfg-mplayer-def.h fileClément Bœsch2011-04-202-31/+3
|
* options: merge cfg-mplayer.h and cfg-common.hClément Bœsch2011-04-202-712/+680
| | | | | | Remove obsolete extern declarations for demuxer_type, audio_demuxer_type, sub_demuxer_type and noconfig_opts in the process.
* vo_dga: replace xf86dga.h with Xxf86dga.hClément Bœsch2011-04-203-4/+4
| | | | xf86dga.h is deprecated and may be removed in the future.
* cleanup: avoid various GCC warningsClément Bœsch2011-04-2014-33/+32
|
* ao_alsa: remove warning by simplifying error handling caseClément Bœsch2011-04-201-4/+4
| | | | | Avoid a gcc warning about potentially uninitialized variable 'err' (there was no actual problem with the code).
* cleanup: find_subfiles.c: simplify (mainly using bstr)Uoti Urpala2011-04-203-157/+139
|
* cleanup: find_subfiles.c: simplify declarations and allocationsClément Bœsch2011-04-201-36/+25
| | | | | Also clarify compare_sub_priority() and remove a typedef for the subfn structure in the process.
* find_subfiles: select subtitle files matching -slangClément Bœsch2011-04-201-57/+59
| | | | Also simplify subtitle selection a bit.
* find_subfiles: try to determine if a .sub file is text or vobsubClément Bœsch2011-04-201-0/+14
| | | | | | | A file with the ambiguous extension .sub could be either VOBsub or MicroDVD. If there's a corresponding .idx file it's certainly VOBsub, so don't add it to the list of potential text subtitles. This will avoid the annoying warning "SUB: Could not determine file format".
* subs: options: add -sub-pathsClément Bœsch2011-04-206-16/+59
|
* options: support string list separators other than ','Uoti Urpala2011-04-202-5/+15
| | | | | | Allow specifying a custom separator character for options of string list type, and use that to define OPT_PATHLIST which takes a list of strings separated by ':' (or ';' on Windows).
* find_subfiles: allow subtitle search in multiple directoriesClément Bœsch2011-04-202-121/+106
|
* subs: move vobsub loading logic down to find_subfiles.cUoti Urpala2011-04-206-21/+47
| | | | | | | Analogously to the previous commit, move path handling logic for loading external vobsub files from mplayer.c to find_subfiles.c. Based on a commit from Clément Bœsch but fixed and simplified.
* subs: move text sub loading logic down to find_subfiles.cClément Bœsch2011-04-203-11/+17
| | | | | | Move path handling for loading external subtitle files from mplayer.c to find_subfiles.c. Now the remaining code in mplayer.c only gets a list of potential filenames and tries opening those.
* find_subfiles: move sub_filenames() hereClément Bœsch2011-04-207-283/+300
| | | | | | | | | | Move sub_filenames() and related code from subreader.c to new file find_subfiles.c. This function is used to find subtitle files that should be loaded for the current video; this functionality is not specific to the particular kind of text subtitle handling implemented in subreader.c. Also reindent and prettify the moved code a bit.
* options: move sub_name, sub_auto and vobsub_name to structClément Bœsch2011-04-206-17/+15
|
* options: change -alang and -slang to use string list typeClément Bœsch2011-04-2012-60/+45
| | | | | | | | | There is no reason to use manual language list splitting when an automatic split function is already available. Some types change from "unsigned char" to "char", but this shouldn't cause issues since [as]lang settings are unlikely to have characters above 127.
* audio: change external AO interface to "ao_[method](ao, ...)"Uoti Urpala2011-04-099-120/+197
| | | | | | | | Make the outside interface of audio output handling similar to the video output one. An AO object is first created, and then methods called with ao_[methodname](ao, args...). However internally libao2/ still holds all data in globals, and trying to create multiple simultaneous AO instances won't work.
* Merge branch 'edl'Uoti Urpala2011-04-0819-666/+1347
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * edl: core: support timeline with audio-only files core: wake up a bit less often for audio-only files core: audio: cut audio writes at end of timeline part EDL: add support for new EDL file format stream.[ch], ass_mp: new stream function for whole-file reads tl_matroska.c: move the find_files() function here bstr.[ch], path.[ch]: add string and path handling functions core: ordered chapters: move timeline creation to timeline/ options: drop support for numeric -demuxer values cleanup: demuxer.[ch]: remove unused code, make functions static cleanup: reindent demuxer.h, use struct names for types
| * core: support timeline with audio-only filesUoti Urpala2011-04-081-12/+35
| |
| * core: wake up a bit less often for audio-only filesUoti Urpala2011-04-081-19/+11
| | | | | | | | | | | | Sleep 100 ms between filling audio output buffers. Also do the sleeping in input read functions to enable immediate wakeups on new input.
| * core: audio: cut audio writes at end of timeline partUoti Urpala2011-04-071-15/+34
| | | | | | | | | | | | | | | | | | | | Cut audio data written to AO at the point where current timeline part ends (before, AO buffers were always completely filled, but playback of the "extra" audio was then cut short by resetting the AO when switching timeline parts). This doesn't make much difference for current playback behavior, but will be used by timeline support for audio-only files and is necessary for future encoding support where "playback" of written audio cannot be aborted later.
| * EDL: add support for new EDL file formatUoti Urpala2011-04-058-18/+491
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The timeline code previously added to support Matroska ordered chapters allows constructing a playback timeline from segments picked from multiple source files. Add support for a new EDL format to make this machinery available for use with file formats other than Matroska and in a manner easier to use than creating files with ordered chapters. Unlike the old -edl option which specifies an additional file with edits to apply to the video file given as the main argument, the new EDL format is used by giving only the EDL file as the file to play; that file then contains the filename(s) to use as source files where actual video segments come from. Filename paths in the EDL file are ignored. Currently the source files are only searched for in the directory of the EDL file; support for a search path option will likely be added in the future. Format of the EDL files The first line in the file must be "mplayer EDL file, version 2". The rest of the lines belong to one of these classes: 1) lines specifying source files 2) empty lines 3) lines specifying timeline segments. Lines beginning with '<' specify source files. These lines first contain an identifier used to refer to the source file later, then the filename separated by whitespace. The identifier must start with a letter. Filenames that start or end with whitespace or contain newlines are not supported. On other lines '#' characters delimit comments. Lines that contain only whitespace after comments have been removed are ignored. Timeline segments must appear in the file in chronological order. Each segment has the following information associated with it: - duration - output start time - output end time (= output start time + duration) - source id (specifies the file the content of the segment comes from) - source start time (timestamp in the source file) - source end time (= source start time + duration) The output timestamps must form a continuous timeline from 0 to the end of the last segment, such that each new segment starts from the time the previous one ends at. Source files and times may change arbitrarily between segments. The general format for lines specifying timeline segments is [output time info] source_id [source time info] source_id must be an identifier defined on a '<' line. Both the time info parts consists of zero or more of the following elements: 1) timestamp 2) -timestamp 3) +duration 4) * 5) -* , where "timestamp" and "duration" are decimal numbers (computations are done with nanosecond precision). Whitespace around "+" and "-" is optional. 1) and 2) specify start and end time of the segment on output or source side. 3) specifies duration; the semantics are the same whether this appears on output or source side. 4) and 5) are ignored on the output side (they're always implicitly assumed). On the source side 4) specifies that the segment starts where the previous segment _using this source_ ended; if there was no previous segment time 0 is used. 5) specifies that the segment ends where the next segment using this source starts. Redundant information may be omitted. It will be filled in using the following rules: - output start for first segment is 0 - two of [output start, output end, duration] imply third - two of [source start, source end, duration] imply third - output start = output end of previous segment - output end = output start of next segment - if "*", source start = source end of earlier segment - if "-*", source end = source start of a later segment As a special rule, a last zero-duration segment without a source specification may appear. This will produce no corresponding segment in the resulting timeline, but can be used as syntax to specify the end time of the timeline (with effect equal to adding -time on the previous line). Examples: ----- begin ----- mplayer EDL file, version 2 < id1 filename 0 id1 123 100 id1 456 200 id1 789 300 ----- end ----- All segments come from the source file "filename". First segment (output time 0-100) comes from time 123-223, second 456-556, third 789-889. ----- begin ----- mplayer EDL file, version 2 < f filename f 60-120 f 600-660 f 30- 90 ----- end ----- Play first seconds 60-120 from the file, then 600-660, then 30-90. ----- begin ----- mplayer EDL file, version 2 < id1 filename1 < id2 filename2 +10 id1 * +10 id2 * +10 id1 * +10 id2 * +10 id1 * +10 id2 * ----- end ----- This plays time 0-10 from filename1, then 0-10 from filename1, then 10-20 from filename1, then 10-20 from filename2, then 20-30 from filename1, then 20-30 from filename2. ----- begin ----- mplayer EDL file, version 2 < t1 filename1 < t2 filename2 t1 * +2 # segment 1 +2 t2 100 # segment 2 t1 * # segment 3 t2 *-* # segment 4 t1 3 -* # segment 5 +0.111111 t2 102.5 # segment 6 7.37 t1 5 +1 # segment 7 ----- end ----- This rather pathological example illustrates the rules for filling in implied data. All the values can be determined by recursively applying the rules given above, and the full end result is this: +2 0-2 t1 0-2 # segment 1 +2 2-4 t2 100-102 # segment 2 +0.758889 4-4.758889 t1 2-2.758889 # segment 3 +0.5 4.4758889-5.258889 t2 102-102.5 # segment 4 +2 5.258889-7.258889 t1 3-5 # segment 5 +0.111111 7.258889-7.37 t2 102.5-102.611111 # segment 6 +1 7.37-8.37 t1 5-6 # segment 7
| * stream.[ch], ass_mp: new stream function for whole-file readsUoti Urpala2011-03-033-34/+56
| | | | | | | | | | | | Add new stream_read_complete() function which reads the complete contents of file. Use that in ass_mp.c which had custom code to do the same.
| * tl_matroska.c: move the find_files() function hereUoti Urpala2011-03-035-83/+60
| | | | | | | | | | | | Move the find_files() function from findfiles.c to tl_matroska.c. Delete the findfiles.c file. Add a check against opendir() failure in find_files().
| * bstr.[ch], path.[ch]: add string and path handling functionsUoti Urpala2011-02-265-32/+190
| | | | | | | | | | | | | | Add some new string and path handling functions to be used in following commits. Use new path handling functions to simplify find_files().
| * core: ordered chapters: move timeline creation to timeline/Uoti Urpala2011-02-264-207/+240
| | | | | | | | | | | | | | | | | | | | Add new file timeline/tl_matroska.c. Move the code that parses ordered chapter information from Matroska files and creates the timeline structure based on that to the new file. Initialize the format parameter given to open_stream() in the moved code. The previous uninitialized value shouldn't have caused any visible effects.
| * options: drop support for numeric -demuxer valuesUoti Urpala2011-02-223-85/+68
| | | | | | | | | | | | | | Drop support for specifying demuxer types by numeric ID (options -demuxer, -audio-demuxer and -sub-demuxer). Stop printing the numeric values in "-demuxer help" output. Convert the list of DEMUXER_TYPE_XXX defines to "enum demuxer_type".
| * cleanup: demuxer.[ch]: remove unused code, make functions staticUoti Urpala2011-02-224-32/+9
| | | | | | | | | | | | | | Remove some unused lines