summaryrefslogtreecommitdiffstats
path: root/playtreeparser.c
Commit message (Collapse)AuthorAgeFilesLines
* mplayer: turn playtree into a list, and change per-file option handlingwm42012-07-311-985/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: - There is no playtree anymore. It's reduced to a simple list. - Options are now always global. You can still have per-file options, but these are optional and require special syntax. - The slave command pt_step has been removed, and playlist_next and playlist_prev added. (See etc/input.conf changes.) This is a user visible incompatible change, and will break slave-mode applications. - The pt_clear slave command is renamed to playlist_clear. - Playtree entries could have multiple files. This is not the case anymore, and playlist entries have always exactly one entry. Whenever something adds more than one file (like ASX playlists or dvd:// or dvdnav:// on the command line), all files are added as separate playlist entries. Note that some of the changes are quite deep and violent. Expect regressions. The playlist parsing code in particular is of low quality. I didn't try to improve it, and merely spent to least effort necessary to keep it somehow working. (Especially ASX playlist handling.) The playtree code was complicated and bloated. It was also barely used. Most users don't even know that mplayer manages the playlist as tree, or how to use it. The most obscure features was probably specifying a tree on command line (with '{' and '}' to create/close tree nodes). It filled the player code with complexity and confused users with weird slave commands like pt_up. Replace the playtree with a simple flat playlist. Playlist parsers that actually return trees are changed to append all files to the playlist pre-order. It used to be the responsibility of the playtree code to change per-file config options. Now this is done by the player core, and the playlist code is free of such details. Options are not per-file by default anymore. This was a very obscure and complicated feature that confused even experienced users. Consider the following command line: mplayer file1.mkv file2.mkv --no-audio file3.mkv This will disable the audio for file2.mkv only, because options are per-file by default. To make the option affect all files, you're supposed to put it before the first file. This is bad, because normally you don't need per-file options. They are very rarely needed, and the only reasonable use cases I can imagine are use of the encode backend (mplayer encode branch), or for debugging. The normal use case is made harder, and the feature is perceived as bug. Even worse, correct usage is hard to explain for users. Make all options global by default. The position of an option isn't significant anymore (except for options that compensate each other, consider --shuffle --no-shuffle). One other important change is that no options are reset anymore if a new file is started. If you change settings with slave mode commands, they will not be changed by playing a new file. (Exceptions include settings that are too file specific, like audio/subtitle stream selection.) There is still some need for per-file options. Debugging and encoding are use cases that profit from per-file options. Per-file profiles (as well as per-protocol and per-VO/AO options) need the implementation related mechanisms to backup and restore options when the playback file changes. Simplify the save-slot stuff, which is possible because there is no hierarchical play tree anymore. Now there's a simple backup field. Add a way to specify per-file options on command line. Example: mplayer f1.mkv -o0 --{ -o1 f2.mkv -o2 f3.mkv --} f4.mkv -o3 will have the following options per file set: f1.mkv, f4.mkv: -o0 -o3 f2.mkv, f3.mkv: -o0 -o3 -o1 -o2 The options --{ and --} start and end per-file options. All files inside the { } will be affected by the options equally (similar to how global options and multiple files are handled). When playback of a file starts, the per-file options are set according to the command line. When playback ends, the per-file options are restored to the values when playback started.
* bstr: rename bstr() function to bstr0(), and typedef bstr to struct bstrwm42012-07-281-1/+1
| | | | | Replace all uses of bstr() with bstr0(). Also remove the ridiculous C++ workaround.
* build: fix --enable-debug, remove some "#ifdef MP_DEBUG"Uoti Urpala2011-07-301-7/+0
| | | | | | | | | | | 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".
* options: commandline: accept --foo=xyz style optionsUoti Urpala2011-07-291-9/+16
| | | | | | | | | | | | 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").
* playlist: Support "Length" option in .pls playlist filesreimar2011-07-061-2/+10
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33620 b3059339-0415-0410-9bf9-f77b7e298cf2
* playtreeparser.c: Add playlist parser for .nsc filesreimar2010-12-161-0/+114
| | | | | | | | | | | Tested to properly decode .nsc files, but not properly tested since no publically available stream could be found. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32710 b3059339-0415-0410-9bf9-f77b7e298cf2 Remove pointless NULL checks before free. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32715 b3059339-0415-0410-9bf9-f77b7e298cf2
* cleanup: don't check for NULL before free()diego2010-11-081-16/+8
| | | | | | patch by Clément Bœsch, ubitux gmail com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32598 b3059339-0415-0410-9bf9-f77b7e298cf2
* playtree: don't try to parse playlists without recognized entriessiretart2010-11-021-0/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31961 b3059339-0415-0410-9bf9-f77b7e298cf2
* Merge svn changes up to r30798Uoti Urpala2010-03-101-4/+19
|\
| * Use negative return values for errors in pls_read_entry to make it matchreimar2010-02-281-3/+3
| | | | | | | | | | | | | | with the checks later on. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30793 b3059339-0415-0410-9bf9-f77b7e298cf2
| * A playlist entry number of 0 is invalid for pls playlists.reimar2010-02-281-1/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30792 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Improve integer overflow and realloc error handling in playlist parser.reimar2010-02-281-3/+18
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30791 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30748Uoti Urpala2010-03-101-5/+5
|\|
| * Do not cast the results of malloc/calloc/realloc.diego2010-02-261-5/+5
| | | | | | | | | | | | | | | | These functions return void*, which is compatible with any pointer, so there is no need for casts. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30744 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30675Uoti Urpala2010-03-101-3/+1
|\|
| * Add asx_parser_build_tree() to asxparser.h instead of forward declaring it.diego2010-02-201-3/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30674 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30475Uoti Urpala2010-03-091-0/+17
|\|
| * Add license header to all top-level files missing them.diego2010-01-301-0/+17
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30471 b3059339-0415-0410-9bf9-f77b7e298cf2
| * whitespace cosmetics: Remove all trailing whitespace.diego2009-05-131-22/+22
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Remove trailing whitespace from most filesUoti Urpala2009-07-071-22/+22
| |
* | Merge svn changes up to r28366Uoti Urpala2009-01-261-0/+2
|\| | | | | | | | | | | | | | | | | Contains more changes needed to sync build system with latest FFmpeg. Conflicts: Makefile configure mplayer.c
| * add "<!DOCTYPE smil" to smil playlistcompn2009-01-241-0/+2
| | | | | | | | | | | | | | patch by Gavin McCullagh gmccullagh!gmail!com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28349 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r28310Uoti Urpala2009-01-151-3/+7
|\| | | | | | | | | | | | | | | The libdvdread4 and libdvdnav directories, which are externals in the svn repository, are at least for now not included in any form. I added configure checks to automatically disable internal libdvdread and libdvdnav if the corresponding directories are not present; if they're added manually then things work the same as in svn.
| * 1000l, play_tree_parser_stop_keeping broke 0-termination of bufferreimar2009-01-011-0/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28219 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Add zero termination missing in two cases.reimar2009-01-011-1/+2
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28218 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Add asserts to detect when assumptions for play_tree_parser_get_linereimar2009-01-011-2/+4
| | | | | | | | | | | | | | fail (mostly due to parsers using it incorrectly). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28217 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Move global mconfig to mpctxUoti Urpala2008-04-261-11/+12
|/ | | | | | | | | | | The global was used in the function cfg_include which handles the -include option. Make the address available in that function by creating a new dynamically allocated option in m_config_new that has the address in the option's private data. asxparser.c also used the global. Making it available through all ways the code could get called required a number of relatively straightforward changes to playtree and menu code.
* 100l in play_tree_parser_get_line, check that there actually isreimar2007-11-261-1/+1
| | | | | | | | a previous character before comparing it against '\r'. Fixes a possible crash on playlist file that is empty or starts with an empty line. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25169 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix possible null-pointer-dereference in parse_smil().cehoyos2007-11-081-0/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24990 b3059339-0415-0410-9bf9-f77b7e298cf2
* warning fixes:diego2007-09-131-1/+1
| | | | | | | | | | | | | | | | | input.c: In function 'mp_input_set_section': input.c:1640: warning: suggest parentheses around assignment used as truth value input.c:1643: warning: suggest parentheses around assignment used as truth value mga_common.c: In function 'mga_init': mga_common.c:394: warning: suggest parentheses around assignment used as truth value playtreeparser.c: In function 'parse_smil': playtreeparser.c:523: warning: suggest parentheses around assignment used as truth value libmpdemux/demux_ts.c: In function 'ts_parse': libmpdemux/demux_ts.c:2795: warning: suggest parentheses around assignment used as truth value libmpdemux/demux_ts.c: In function 'demux_open_ts': libmpdemux/demux_ts.c:591: warning: 'frame_length' may be used uninitialized in this function git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24444 b3059339-0415-0410-9bf9-f77b7e298cf2
* realrtsp smil files can also use ' as field delimiter instead of "rtogni2007-07-161-1/+5
| | | | | | | Fixes rtsp://video.rootvision.net/xxc17.smil git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23794 b3059339-0415-0410-9bf9-f77b7e298cf2
* Support multiple tags in a single line and tags on the same line as the rtogni2007-03-181-8/+15
| | | | | | | | <smil> signature. Fixes http://www.cartalk.com/Radio/Show/01.smil git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22730 b3059339-0415-0410-9bf9-f77b7e298cf2
* Remove code duplication in smil parserrtogni2007-03-121-24/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22538 b3059339-0415-0410-9bf9-f77b7e298cf2
* Support smil embedded into xml, fixes bugzilla #768rtogni2007-03-121-0/+2
| | | | | | | Patch by Pavel Fedin | sonic_amiga |a| rambler : ru | (on bugzilla) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22536 b3059339-0415-0410-9bf9-f77b7e298cf2
* 100l, allocated buffer was too small.rtogni2007-03-081-1/+1
| | | | | | | From a patch by Nicholas Kain git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22495 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add support for smil playlist served over realrtsprtogni2007-02-181-4/+65
| | | | | | | (audio and video playback only, not full smil support) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22260 b3059339-0415-0410-9bf9-f77b7e298cf2
* 10l, fix inverted check for "<media" in smil playlistrtogni2007-01-141-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21928 b3059339-0415-0410-9bf9-f77b7e298cf2
* Skip empty lines in front of winamp playlist.rtogni2006-11-101-2/+6
| | | | | | | Fixes http://www.radioseven.se/radioseven.pls git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20850 b3059339-0415-0410-9bf9-f77b7e298cf2
* introduce new 'stream' directory for all stream layer related components and ↵ben2006-07-311-1/+1
| | | | | | split them from libmpdemux git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19277 b3059339-0415-0410-9bf9-f77b7e298cf2
* relative-to-absolute path fixes: Do not prepend drive letter to \\ paths.reimar2006-07-071-1/+3
| | | | | | | Do not exit after prepending drive letter to first file, process other files as well. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18933 b3059339-0415-0410-9bf9-f77b7e298cf2
* several function from playtreeparser.c maked static,reynaldo2006-07-061-7/+7
| | | | | | | | | as these are not used outside. Patch by Stefan Huehner stefan AT huehner-org git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18921 b3059339-0415-0410-9bf9-f77b7e298cf2
* rm unnecesary casts from void* - part 3reynaldo2006-07-021-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18884 b3059339-0415-0410-9bf9-f77b7e298cf2
* rm unnecesary void* casts - part 1reynaldo2006-07-011-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18874 b3059339-0415-0410-9bf9-f77b7e298cf2
* Doxygen Attack! - Chapter 3albeu2006-04-251-0/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18266 b3059339-0415-0410-9bf9-f77b7e298cf2
* preliminary support for wpl playlists, closes #362reynaldo2005-10-281-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16872 b3059339-0415-0410-9bf9-f77b7e298cf2
* Don't prepend basepath to a full unix path. ( 10l to Joey. )al2004-09-101-2/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13306 b3059339-0415-0410-9bf9-f77b7e298cf2
* windows path seperator fixesjoey2004-08-121-8/+11
| | | | | | | | | | | | mp_basename now looks for \ and / both new playlist parsing: /path/to/thing is treated as a full path c:\windows is treated as a full path \windows is "near-full" and we prepend drive letter file.avi is relative and we prepend path to playlist git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13011 b3059339-0415-0410-9bf9-f77b7e298cf2
* Support for comments in plaintext playlist by adlandalex2004-06-261-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12690 b3059339-0415-0410-9bf9-f77b7e298cf2
* Enhance detection of embedded smil playlist, add embedded ram playlistrtognimp2004-06-061-3/+8
| | | | | | | | support Patch by adland git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12539 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix embedded smil playlist detection if there are parameters on the urlrtognimp2004-04-261-6/+16
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12301 b3059339-0415-0410-9bf9-f77b7e298cf2
* Respect -playlist for asx streamsrtognimp2004-04-171-2/+3
| | | | | | | Patch by adland git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12224 b3059339-0415-0410-9bf9-f77b7e298cf2
* Support for smil playlist, both standalone and embedded into otherrtognimp2004-04-011-7/+136
| | | | | | | | playlists. Pathc by adland git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12098 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix the bug found by Martin Wulffeldalbeu2003-08-251-0/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10695 b3059339-0415-0410-9bf9-f77b7e298cf2
* Typos fixed, based on patch sent by Alex.diego2003-07-271-8/+8
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10488 b3059339-0415-0410-9bf9-f77b7e298cf2
* output typo fixes: unknow --> unknowndiego2003-07-091-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10398 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix the incredible slowness with very long list. Now a 10^6 entriesalbeu2003-04-021-8/+12
| | | | | | | list take ~1 sec instead of several minutes. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9790 b3059339-0415-0410-9bf9-f77b7e298cf2
* Use new config headersalbeu2003-03-301-11/+4
| | | | | | | Remove STREAMTYPE_PLAYLIST. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9750 b3059339-0415-0410-9bf9-f77b7e298cf2
* this patch fixes latest bug, discovered by .so ... (relative filenames &arpi2003-02-061-7/+21
| | | | | | | | playlists) This affects also the gui (filenames with space) patch by Fabian Franz <FabianFranz@gmx.de> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9302 b3059339-0415-0410-9bf9-f77b7e298cf2
* 100larpi2003-01-251-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9090 b3059339-0415-0410-9bf9-f77b7e298cf2
* this patch adds an fallback to playlist (any but the plaintext-list format)arpi2003-01-121-11/+18
| | | | | | | | after all demuxers failed. so -playlist is not needed any more! patch by Fabian Franz <FabianFranz@gmx.de>, with som