Commit Graph

38 Commits

Author SHA1 Message Date
wm4 c92538dfaa Remove dead code
This was done with the help of callcatcher [1]. Only functions which
are statically known to be unused are removed.

Some unused functions are not removed yet, because they might be needed
in the near future (such as open_output_stream for the encode branch).

There is one user visible change: the --subcc option did nothing, and is
removed with this commit.

[1] http://www.skynet.ie/~caolan/Packages/callcatcher.html
2012-08-01 17:07:35 +02:00
wm4 89a17bcda6 mplayer: turn playtree into a list, and change per-file option handling
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.
2012-07-31 21:33:26 +02:00
Uoti Urpala 3bdcbba496 asxparser: remove code confusing asx/player options 2011-07-26 05:31:30 +03:00
diego 12d3e0df99 cleanup: don't check for NULL before free()
patch by Clément Bœsch, ubitux gmail com

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32598 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-08 18:05:12 +02:00
Uoti Urpala 4c6e3ac01b Merge svn change r31134
Fix some search/replace errors introduced in the svn commit.
2010-05-07 22:03:48 +03:00
diego a535f7bfca the great MPlayer tab removal: part II
some extra indentation fixes are put in as a bonus


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31134 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-05-03 23:34:38 +00:00
Uoti Urpala bc1d0ca37d Merge svn changes up to r30798 2010-03-10 02:35:02 +02:00
Uoti Urpala e74708f619 Merge svn changes up to r30748 2010-03-10 01:50:55 +02:00
Uoti Urpala c37f09693d Merge svn changes up to r30643 2010-03-10 00:00:06 +02:00
Uoti Urpala 12d3caebc7 Merge svn changes up to r30475 2010-03-09 19:18:43 +02:00
cehoyos e2a81b9be1 Remove unused static functions asx_list_add() and asx_list_remove().
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30769 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-02-27 20:50:20 +00:00
diego b63759b175 Do not cast the results of malloc/calloc/realloc.
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
2010-02-26 15:01:37 +00:00
diego 93c1e23c47 Mark some more functions that are not used outside of their files as static.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30632 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-02-18 09:26:00 +00:00
diego 99c1bbca2a Add license header to all top-level files missing them.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30471 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-01-30 23:24:23 +00:00
Uoti Urpala 0eb321bf2c Remove trailing whitespace from most files 2009-07-07 02:34:35 +03:00
diego 6e9cbdc104 whitespace cosmetics: Remove all trailing whitespace.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-05-13 02:58:57 +00:00
Uoti Urpala fb33e286b5 Move global mconfig to mpctx
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.
2008-04-26 10:44:59 +03:00
reimar d794982367 Disable http->mmshttp rewriting hack introduced in r25168,
unfortunately WMP is not the only one using asx.
Fixes http://www.fresh80s.de/listen.wax


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25960 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-02-08 18:28:12 +00:00
reimar b32b64d559 Replace http:// URLs in asx files by mmshttp://.
Avoid some infinite-loop problems when stream and playlist have the same URL.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25168 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-11-26 19:04:31 +00:00
reimar 697c307bdb Remove two unused functions in asxparser
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23630 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-06-24 10:16:18 +00:00
ben 49867bd432 introduce new 'stream' directory for all stream layer related components and split them from libmpdemux
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19277 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-07-31 17:39:17 +00:00
reynaldo 58ed2c3fe0 marks several read-only string parameters which aren't modified inside the called function as const. Patch by Stefan Huehner, stefan AT huehner-org
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19109 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-07-15 16:03:12 +00:00
reynaldo 1a16cbfec3 marks several string parameters as const, as they are not modified inside the function, Patch by Stefan Huehner, stefan AT huehner-org
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19058 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-07-13 05:03:43 +00:00
reynaldo 5b4ec50d44 rm unnecesary void* casts - part 1
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18874 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-07-01 03:56:13 +00:00
rtognimp 3641b52010 Fix possible use of body uninitialized. Remove an unneeded free (body
is not allocated before it). CID 243 and more


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17804 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-03-10 22:15:50 +00:00
rtognimp e3daf3ca75 Respect -playlist for asx streams
Patch by adland


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12224 b3059339-0415-0410-9bf9-f77b7e298cf2
2004-04-17 16:46:41 +00:00
diego 8838b4afa6 output typo fixes: unknow --> unknown
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10398 b3059339-0415-0410-9bf9-f77b7e298cf2
2003-07-09 01:30:24 +00:00
albeu 50f296d10a Remove STREAMTYPE_PLAYLIST.
Add support for quoting attribs vals with with '
Use new config headers


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9745 b3059339-0415-0410-9bf9-f77b7e298cf2
2003-03-30 17:02:05 +00:00
albeu 91a54c2e9e Fix some memleaks
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9586 b3059339-0415-0410-9bf9-f77b7e298cf2
2003-03-14 17:45:33 +00:00
arpi 89875edb32 this patch adds an fallback to playlist (any but the plaintext-list format)
after all demuxers failed. so -playlist is not needed any more!
patch by Fabian Franz <FabianFranz@gmx.de>, with some small modifications


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8926 b3059339-0415-0410-9bf9-f77b7e298cf2
2003-01-12 19:41:38 +00:00
albeu 2f58e31c26 Allow to use the asx parser for some other purposes
A few 10L fix


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8171 b3059339-0415-0410-9bf9-f77b7e298cf2
2002-11-12 14:19:53 +00:00
albeu 126725660d New config system + cleanup of header inter dependency
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8165 b3059339-0415-0410-9bf9-f77b7e298cf2
2002-11-12 01:56:42 +00:00
arpi 6f3e7cffaa patch for crashes/memory corruptions in ASX playlist parser.
by Gregory Kovriga <gkovriga@techunix.technion.ac.il>


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7910 b3059339-0415-0410-9bf9-f77b7e298cf2
2002-10-25 14:13:32 +00:00
albeu e87d472777 Portability fix with realloc
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5803 b3059339-0415-0410-9bf9-f77b7e298cf2
2002-04-23 20:06:00 +00:00
albeu fdcd870075 Bug fix in entry parsing.
Support for param entry (to add your config options)


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4821 b3059339-0415-0410-9bf9-f77b7e298cf2
2002-02-23 21:11:01 +00:00
albeu 88a6227cbb Implementation of entryref
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4310 b3059339-0415-0410-9bf9-f77b7e298cf2
2002-01-22 22:47:17 +00:00
nexus 0573693a2b FreeBSD fix
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4051 b3059339-0415-0410-9bf9-f77b7e298cf2
2002-01-08 12:10:33 +00:00
arpi 10d82182e0 tree-based playlist parser code by Alban Bedel <albeu@free.fr>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4044 b3059339-0415-0410-9bf9-f77b7e298cf2
2002-01-08 01:24:25 +00:00