summaryrefslogtreecommitdiffstats
path: root/playtree.c
Commit message (Collapse)AuthorAgeFilesLines
* mplayer: turn playtree into a list, and change per-file option handlingwm42012-07-311-908/+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.
* playtree: --shuffle shouldn't make playlist navigation uselesswm42012-01-181-0/+54
| | | | | | | | | | | | When --shuffle was used, the pt_step -1 jumped to the next file, instead of the previously played file. This was because the playtree entries were never actually shuffled, but instead a random unplayed file was picked. Fix this by actually shuffling the playtree in advance. I couldn't see any clear location where exactly this should happen, so it's done when a playtree iterator is created. Not removing the old code, since new playtree entries could be added while an iterator is active.
* build: fix --enable-debug, remove some "#ifdef MP_DEBUG"Uoti Urpala2011-07-301-94/+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-4/+4
| | | | | | | | | | | | 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: change option parsing to use bstrUoti Urpala2011-07-291-2/+2
| | | | | | Using bstr allows simpler parsing code, especially because it avoids the need to modify or copy strings just to terminate extracted substrings.
* options: indicate ambiguous option parameters explicitlyUoti Urpala2011-07-291-1/+2
| | | | | | | | 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.
* playtree: make some char * function arguments constreimar2011-07-061-6/+5
| | | | | | | | | | | Remove a pointless "return". git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33607 b3059339-0415-0410-9bf9-f77b7e298cf2 Mark some char * arguments that are strdup'd const, makes the API slightly clearer. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33608 b3059339-0415-0410-9bf9-f77b7e298cf2
* playtree: free parameter values when entry is freedreimar2011-06-291-1/+8
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33364 b3059339-0415-0410-9bf9-f77b7e298cf2
* cleanup: shut up more warningsClément Bœsch2011-05-061-2/+1
|
* cleanup: don't check for NULL before free()diego2010-11-081-3/+3
| | | | | | 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: fix segfault on empty playlistsiretart2010-11-021-1/+8
| | | | | | | | Add a sanity check to avoid a segmentation fault in playtree.c on empty playlists. This is Debian Bug: http://bugs.debian.org/591525 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31960 b3059339-0415-0410-9bf9-f77b7e298cf2
* Merge svn changes up to r30798Uoti Urpala2010-03-101-14/+0
|\
| * Remove unused static function play_tree_set_flag().cehoyos2010-02-271-14/+0
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30771 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30748Uoti Urpala2010-03-101-6/+6
|\|
| * Do not cast the results of malloc/calloc/realloc.diego2010-02-261-6/+6
| | | | | | | | | | | | | | | | 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
| * Mark some more functions that are not used outside of their files as static.diego2010-02-181-2/+2
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30632 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
* | Merge svn changes up to r29912Uoti Urpala2009-11-161-13/+3
|\|
| * Remove redundant duplicate option handling in the playtree.adrian2009-10-101-13/+3
| | | | | | | | | | | | | | Fixes the use of options on the command line which should not override each other (like -vf-add). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29768 b3059339-0415-0410-9bf9-f77b7e298cf2
| * whitespace cosmetics: Remove all trailing whitespace.diego2009-05-131-31/+31
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Remove the internal GUIAnton Khirnov2009-07-071-14/+0
| | | | | | | | | | | | | | | | | | The GUI is badly designed and too closely coupled to the internal details of other code. The GUI code is in bad shape and unmaintained for years. There is no indication that anyone would maintain it in the future either. Even if someone did volunteer to implement a better integrated GUI having the current code in the tree probably wouldn't help much. So get rid of it.
* | Remove trailing whitespace from most filesUoti Urpala2009-07-071-31/+31
| |
* | Merge svn changes up to r28366Uoti Urpala2009-01-261-1/+3
|\| | | | | | | | | | | | | | | | | Contains more changes needed to sync build system with latest FFmpeg. Conflicts: Makefile configure mplayer.c
| * Actually abort (return NULL) in the alloc-failure check in play_tree_newreimar2009-01-251-1/+3
| | | | | | | | | | | | | | | | instead of going right ahead and crashing. Patch by Luis Felipe Strano Moraes (luis strano gmail com). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28355 b3059339-0415-0410-9bf9-f77b7e298cf2
| * revert non-acked r27106ben2008-06-211-2/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27120 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Only "pop" subtree params if they had previously been "pushed",ben2008-06-201-1/+2
| | | | | | | | | | | | | | | | | | | | and afterwards reset the "pushed" value to 0 again. Similarly only set the PLAY_TREE_RND_PLAYED flag if the entry had been pushed before. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27106 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Make various functions staticUoti Urpala2008-08-121-2/+2
|/
* typo: begining --> beginningdiego2007-12-231-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25517 b3059339-0415-0410-9bf9-f77b7e298cf2
* typo fix: childs --> childrendiego2007-07-281-10/+10
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23892 b3059339-0415-0410-9bf9-f77b7e298cf2
* Cast sizeof() to int in mp_msg arguments so it fits the format string on 64bitreimar2007-06-241-10/+10
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23634 b3059339-0415-0410-9bf9-f77b7e298cf2
* Remove unused variable, patch by Stefan Huehner stefan [at] huehner [dot] orgdiego2006-07-031-1/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18891 b3059339-0415-0410-9bf9-f77b7e298cf2
* rm unnecesary casts from void* - part 3reynaldo2006-07-021-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18884 b3059339-0415-0410-9bf9-f77b7e298cf2
* rm unnecesary void* casts - part 1reynaldo2006-07-011-2/+2
| | | | 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
* fix "last file is always played last" bug.reimar2004-11-051-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13885 b3059339-0415-0410-9bf9-f77b7e298cf2
* fix -loop in combination with -shufflereimar2004-10-201-0/+8
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13709 b3059339-0415-0410-9bf9-f77b7e298cf2
* string handling security fixesdiego2004-06-251-1/+1
| | | | | | | | patch by Nicholas Kain, Alexander Strasser <eclipse7@gmx.net> reviewed by Pontscho, Alex, Rich git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12647 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix -shuffle with remote playlistalbeu2003-07-081-0/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10395 b3059339-0415-0410-9bf9-f77b7e298cf2
* Use new config headersalbeu2003-03-301-55/+3
| | | | | | | Remove the hack used to support dvd://, tv:// and vcd:// git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9749 b3059339-0415-0410-9bf9-f77b7e298cf2
* this patch adds a high-level-api to playtree, allowing to use it more easilyarpi2003-02-051-4/+123
| | | | | | | | | and hopefully also letting one doing less mistakes, as current low-level-api is not rock-solid ... patch by Fabian Franz <FabianFranz@gmx.de> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9291 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add random stepping supportalbeu2002-11-121-7/+85
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8175 b3059339-0415-0410-9bf9-f77b7e298cf2
* New config system + cleanup of header inter dependencyalbeu2002-11-121-0/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8165 b3059339-0415-0410-9bf9-f77b7e298cf2
* 10L found by jeroen dobbelaere <jeroen dot dobbelaere at acunia dot com>albeu2002-11-021-2/+8
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8063 b3059339-0415-0410-9bf9-f77b7e298cf2
* Portability fix with reallocalbeu2002-04-231-1/+6
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5803 b3059339-0415-0410-9bf9-f77b7e298cf2
* fix playlist bug with gui and rewrite mousecursor show/hide codepontscho2002-04-161-0/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5652 b3059339-0415-0410-9bf9-f77b7e298cf2
* Set the params given to a playlist url to the playlistalbeu2002-03-201-0/+17
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5218 b3059339-0415-0410-9bf9-f77b7e298cf2
* small bug fixed and workarounds :(pontscho2002-03-071-2/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4975 b3059339-0415-0410-9bf9-f77b7e298cf2
* workaround for gui a short time.pontscho2002-03-061-1/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4961 b3059339-0415-0410-9bf9-f77b7e298cf2
* In the good way this time, (1 and 0 was swaped 10*10^10l for me ;))albeu2002-02-211-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4782 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fixed (I hope) little bug wich lead to sig11 after last playtree entryalbeu2002-02-201-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4769 b3059339-0415-0410-9bf9-f77b7e298cf2
* Bug fix for subconfig option. A -tv option containing the on parameteralbeu2002-01-211-2/+3
| | | | | | | | is now take as an entry. New functions to set/get options and know if an option is alredy set. A few comments. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4293 b3059339-0415-0410-9bf9-f77b7e298cf2
* Some improvment and make -vcd -dvd options considered as playlist entryalbeu2002-01-191-58/+51
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4269 b3059339-0415-0410-9bf9-f77b7e298cf2
* Few bug fix and improvment in config/playtree systemalbeu2002-01-191-1/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4255 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fixed a few bugs and added support for VCD/DVD/TV in playlist using virtual urlalbeu2002-01-171-24/+102
| | | | | | | like dvd://1 vcd://2 tv://5 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4221 b3059339-0415-0410-9bf9-f77b7e298cf2
* playtree-based config patch by Alban Bedel <albeu@free.fr>arpi2002-01-141-40/+110
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4157 b3059339-0415-0410-9bf9-f77b7e298cf2
* FreeBSD fixnexus2002-01-081-0/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4051 b3059339-0415-0410-9bf9-f77b7e298cf2
* tree-based playlist parser code by Alban Bedel <albeu@free.fr>arpi2002-01-081-0/+631
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4044 b3059339-0415-0410-9bf9-f77b7e298cf2