summaryrefslogtreecommitdiffstats
path: root/mplayer.c
Commit message (Collapse)AuthorAgeFilesLines
* 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
* 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 'mplayer1_changes'Uoti Urpala2011-05-021-5/+33
|\
| * OSD: support displaying fractional part of current positionUoti Urpala2011-04-121-5/+33
| | | | | | | | | | | | | | | | Add option -osd-fractions which enables display of fractional seconds when showing the current playback time on OSD. Based on a patch from Christian <herr.mitterlehner@gsmpaaiml.com> but with several modifications.
* | 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).
* | config: remove pointless cfg-mplayer-def.h fileClément Bœsch2011-04-201-3/+3
| |
* | subs: options: add -sub-pathsClément Bœsch2011-04-201-2/+2
| |
* | find_subfiles: allow subtitle search in multiple directoriesClément Bœsch2011-04-201-4/+3
| |
* | subs: move vobsub loading logic down to find_subfiles.cUoti Urpala2011-04-201-21/+7
| | | | | | | | | | | | | | 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-201-9/+6
| | | | | | | | | | | | 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-201-0/+1
| | | | | | | | | | | | | | | | | | | | 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-201-11/+8
| |
* | options: change -alang and -slang to use string list typeClément Bœsch2011-04-201-1/+1
| | | | | | | | | | | | | | | | | | 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-091-65/+63
| | | | | | | | | | | | | | | | 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-081-261/+109
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | * 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-051-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * core: ordered chapters: move timeline creation to timeline/Uoti Urpala2011-02-261-207/+0
| | | | | | | | | | | | | | | | | | | | 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.
| * cleanup: demuxer.[ch]: remove unused code, make functions staticUoti Urpala2011-02-221-8/+3
| | | | | | | | | | | | | | Remove some unused lines from demuxer.h. Make some demuxer.c functions static. Move new_ds_stream() declaration from demuxer.h to stream.h (the function is defined in stream.c). Clean up some code in mplayer.c that had commented-out free_demuxer_stream() calls.
* | core: do proper audio track selection for -audiofile demuxerUoti Urpala2011-04-021-6/+3
| | | | | | | | | | | | | | The select_audio() call was done on the main demuxer, not -audiofile one (the "if (mpctx->num_sources)" test in the previous code was always true). Call it on the -audiofile demuxer instead. The -audiofile stuff still needs a proper cleanup later though.
* | configure, Windows: support static pthreads on WindowsDiogo Franco2011-03-301-0/+13
| | | | | | | | | | | | Windows pthreads requires certain functions to be called to initialize itself. It can do that through DllMain but no such luck when linked statically; mplayer needs to call the initialization explicitly.
* | core: hr-seek: fix soft hang with hrseek past EOFUoti Urpala2011-03-031-2/+3
|/ | | | | | | | | | | | | | | | When doing a precise seek video_out->frame_loaded was left to true while frames were being skipped. However vo_get_buffered_frame() always returns success if a frame is already loaded; due to this the EOF detection in update_video() never triggered, and a hr-seek past EOF could cause a soft hang (commands were still processed and it was possible to seek again to exit the loop). This could also happen with Matroska files using ordered chapters if an underlying file was actually shorter than the chapter that was supposed to come from it. Then seeking to a timestamp after the end of the file but before the end of the chapter would trigger the bug. Fix the problem by setting frame_loaded to false when we decide to skip the frame in question.
* terminal output: change program name to "MPlayer2"Uoti Urpala2011-02-151-1/+1
|
* subs: Print a message when lavc subtitle decoding failsreimar2011-02-151-1/+4
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32865 b3059339-0415-0410-9bf9-f77b7e298cf2
* cleanup: mplayer.c: clean up pause_loop() a bitUoti Urpala2011-02-151-11/+11
|
* terminal output: show cache fill changes in "PAUSED" messagereimar2011-02-151-1/+22
| | | | | | | | | | | Convert cache_fill_status into a function so we always get the latest state, not whatever it was after the last read. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32818 b3059339-0415-0410-9bf9-f77b7e298cf2 Update PAUSED status line with cache fill status if it changed. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32819 b3059339-0415-0410-9bf9-f77b7e298cf2
* terminal output: change infamous "Core dumped" messageUoti Urpala2011-02-011-2/+2
| | | | | | The "Core dumped ;)" message printed after finishing a stream dump is known to confuse users but was kept as "humor". Change it to say "Stream dump complete." instead.
* translation: remove \r and \n from translated PAUSE stringUoti Urpala2011-01-311-8/+3
|
* mplayer.c: simplify code a bit, remove "main:" labelcboesch2011-01-311-13/+7
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32791 b3059339-0415-0410-9bf9-f77b7e298cf2
* cleanup: define ROUND() macro in mpcommon.hcboesch2011-01-311-2/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32751 b3059339-0415-0410-9bf9-f77b7e298cf2
* core: timing: fix overflow with extreme playback speedUoti Urpala2011-01-281-1/+5
| | | | | | | | With extreme playback speed changes it was possible to trigger an overflow in code calculating frame timing. This could break the VDPAU frame scheduling mechanism and lead to the shown picture not changing until reset by events such as seeking. Add an extra check to prevent the overflow.
* Merge branch 'sub'Uoti Urpala2011-01-261-49/+342
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sub: sub/OSD: move some related files to sub/ subtitles: options: enable -ass by default subtitles: change default libass rendering style demux_mkv, chapters: change millisecond arithmetic to ns cleanup: rename ass_* functions to mp_ass_* subs: use correct font aspect ratio for libass + converted subs cleanup: some random minor code simplification and cleanup vf_vo: fix EOSD change detection bug sd_ass: remove subreader use, support plaintext markup subtitles: style support for common SubRip tags and MicroDVD core: ordered chapters: