summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* win32: fix compilation on MinGWwm42012-08-074-11/+15
| | | | | | | | | | | | | | | The commit 74df1d8e05aa2 (and f752212c62353) replaced the configure endian check with byte order macros defined by standard headers. It turns out that MinGW-w64 actually doesn't define these macros in the sys/types.h system header. (I assumed it does, because a quick test seemed to work. But that was because gcc -W -Wall doesn't warn against undefined macros. You need -Wundef for that.) MinGW-w64 has a sys/params.h header defining these macros, but sys/types.h doesn't include it, so it's useless without special casing the mplayer code. Add a hack top configure instead. Define the macros directly, and assume MinGW-w64 only works on little endian machines. The other changes are basically random typos and superficial oversights.
* vo_null: reformat and use new VO APIwm42012-08-071-48/+42
|
* Remove V4L2 decoder support (vo_v4l2 and ao_v4l2)wm42012-08-079-673/+0
| | | | | | | | | | | The removed VO and AO took MPEG data and decoded it with V4L2. I'm not exactly sure what's the use of this today, but get rid of it. As far as feeding video data to V4L2 is concerned, there are other ways. For example, there is this script, that feeds yuv4mpeg formatted raw video data to V4L2: https://raw.github.com/umlaeute/v4l2loopback/master/examples/yuv4mpeg_to_v4l2.c
* vo_v4l2: reformat, use new VO APIwm42012-08-071-165/+153
| | | | | Actually, this is probably completely broken, and there are better ways to get mplayer output into a V4L2 device.
* vo_caca: use new VO APIwm42012-08-071-33/+54
|
* vo_directfb2: reformat and convert to new VO APIwm42012-08-071-938/+1083
| | | | | | No effort was put into moving static variables into a priv struct. The VO wasn't tested, because DirectFB's X11 backend didn't work for me (it crashed, not just with mplayer, but also SDL applications).
* vo_x11: reformat, use new VO APIwm42012-08-071-375/+397
| | | | This also involves moving the static variables into a priv struct.
* TOOLS/uncrustify.cfg: add uncrustify profile for code reformattingwm42012-08-061-0/+158
| | | | | | | | | | | | There is lots of badly and inconsistently formatted code left, which leaves us with the frequent need for cleaning up. This uncrustify profile can be used for automatic reformatting. The author of this file is (perhaps) uau. It's different from mplayer-svn's TOOLS/mp-uncrustify-style.cfg. The differences and origins of these files are unclear, but the file added with this commit is probably more consistent with the heavily cleaned up areas of mplayer2 and this fork.
* manpage: reflect recent VO changeswm42012-08-061-108/+33
|
* image_writer: rename "filetype" option to "format"wm42012-08-063-5/+5
| | | | | | | Although slightly less precise, this sounds less clunky. This change also causes the --screenshot-filetype option to be renamed to --screenshot-format.
* libvo: remove videodev_mjpeg.hwm42012-08-061-141/+0
| | | | This was used by stream/tvi_v4l.c, which was removed a while ago.
* VO: remove vo_gif89a, vo_md5sum, vo_yuv4mpegwm42012-08-066-1033/+0
| | | | | | | | The encoding branch by divverent can handle of these via libavformat. Note: for some reason, libav/ffmpeg have a GIF muxer only, and no demuxer. The gif configure checks needef for the mplayer internal gif demuxer can't be removed yet.
* VO: remove vo_jpeg, vo_png, vo_pnm, vo_tgawm42012-08-067-1484/+1
| | | | All of these have been replaced by vo_image.
* vo_image: add outdir optionwm42012-08-061-8/+42
| | | | | The function checked_mkdir is taken from vo_jpeg, with the error handling stripped down to a reasonable level.
* vo_image: add new video output for writing imageswm42012-08-064-1/+173
| | | | This is supposed to replace vo_png and others.
* video_out: rename privsize member to priv_sizewm42012-08-063-5/+5
|
* image_writer: support all JPEG specific options vo_jpeg supportswm42012-08-062-1/+32
| | | | | | Most of these are useless or probably even dangerous. Support them anyway, because it's easy, and we want to replace vo_jpeg without any disadvantages.
* image_writer: add TGA image formatwm42012-08-061-0/+5
| | | | | | For getting rid of vo_tga. This makes use of the libavcodec TGA encoder.
* image_writer: add some PNM family image formatswm42012-08-061-9/+20
| | | | | | | | | | While the PNM formats are not that useful, supporting them helps getting rid of vo_pnm. This makes use of the libavcodec PNM encoder. Compared to vo_pnm, at least PNM ASCII mode is not supported. It doesn't look like libavcodec supports this mode for encoding.
* image_writer: add option parsingwm42012-08-065-15/+28
| | | | | image_writer now provides its own option parsing, and screenshot.c and the mplayer frontend use it.
* image_writer: allow specifying pixel formats for image writerswm42012-08-061-2/+13
|
* image_writer: never pass anamorphic images to image writerwm42012-08-061-1/+2
|
* screenshot: move image writer code into new file image_writer.cwm42012-08-064-204/+324
|
* m_config: support auto-allocated sub-structswm42012-08-064-37/+75
| | | | | | | | | | | | | | Given your option struct has a field that is a pointer to another struct, this commit allows you to declare options that write into that other struct. The code in m_config will dereference the pointer field on its own if such an option is accessed. If the field is NULL on initialization of the containing m_config, the struct is automatically allocated. OPT_SUBSTRUCT() can be used to declare such a field. struct m_sub_options is used to describe the pointed-to struct, and includes size and defaults if the struct has to be allocated by m_config.
* m_config: support flatten and merge flags for suboptionswm42012-08-063-14/+42
| | | | | | | | | | | | | | | | | | M_OPT_PREFIXED allows adding top-level options with the suboption mechanism. The point of this is that, even though these options are top-level options, they don't need to be added directly to a top- level option array (such as mplayer_opts[]). Instead, the suboption can be defined in a separate source file. Only a suboption declaration is needed to add these options. M_OPT_MERGE is similar to M_OPT_PREFIXED, but doesn't add the name of the suboptions entry as prefix. Given you have a suboption declaration "prefix" and the suboption "subopt", you can pass them as follows on the command line: normal: --prefix=subopt=value M_OPT_PREFIXED: --prefix-subopt=value M_OPT_MERGE: --subopt=value
* options: get rid of some compatibility stuffwm42012-08-065-53/+12
| | | | | | | | | Doesn't make sense because we broke/are going to break compatibility with everything anyway. Remove mechanism for warning the user against disabled options. Remove colorspace alternative option values.
* options: get rid of ambiguous option parsingwm42012-08-0514-306/+317
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Options parsing used to be ambiguous, as in the splitting into option and values pairs was ambiguous. Example: -option -something It wasn't clear whether -option actually takes an argument or not. The string "-something" could either be a separate option, or an argument to "-option". The code had to call the option specific parser function to resolve this. This made everything complicated and didn't even have a real use. There was only one case where this was actually used: string lists (m_option_type_string_list) and options based on it. That is because this option type actually turns a single option into a proxy for several real arguments, e.g. "vf*" can handle "-vf-add" and "-vf-clr". Options suffixed with "-clr" are the only options of this group which take no arguments. This is ambiguous only with the "old syntax" (as shown above). The "new" option syntax always puts option name and value into same argument. (E.g. "--option=--something" or "--option" "--something".) Simplify the code by making it statically known whether an option takes a parameter or not with the flag M_OPT_TYPE_OLD_SYNTAX_NO_PARAM. If it's set, the option parser assumes the option takes no argument. The only real ambiguity left, string list options that end on "-clr", are special cased in the parser. Remove some duplication of the logic in the command line parser by moving all argument splitting logic into split_opt(). (It's arguable whether that can be considered code duplication, but now the code is a bit simpler anyway. This might be subjective.) Remove the "ambiguous" parameter from all option parsing related code. Make m_config unaware of the pre-parsing concept. Make most CONF_NOCFG options also CONF_GLOBAL (except those explicitly usable as per-file options.)
* options: remove CONF_TYPE_PRINT_INDIRECTwm42012-08-052-10/+1
| | | | This was unused.
* input.conf: put dvdnav commands under {dvdnav}wm42012-08-051-8/+8
| | | | | This means these key binding will basically not exist, unless dvdnav is in use (at runtime).
* osd: free buffer allocated with av_malloc with av_freewm42012-08-041-4/+4
| | | | | | | | free() was used before, which could in theory lead to crashes if the OSD buffer was freed or resized. (Whether using free() actually works depends on what function libavutil's av_malloc() uses internally. On Linux, it seems to use memalign(), which uses free() as counterpart for deallocation, so the bug never triggered for me.)
* m_config: always reject setting global options in per-file modewm42012-08-042-6/+13
| | | | | | | | | | Now the command line parser sets the m_config object into file local mode, so that m_config can check for this condition. Makes trying to set global options from a profile fail. Note: global options can be considered read-only by m_config, so maybe there should be an additional check for this. Reusing the file- local check is more practical for now, though.
* m_options: get rid of CONF_NOSAVEwm42012-08-043-14/+6
| | | | | | | This was already treated like CONF_GLOBAL. Profiles can actually be file-local, as long as the profile sets file local options only. Allow them to do so.
* m_config: implement m_config_new in terms of m_config_simplewm42012-08-043-18/+14
| | | | | Also change m_config_simple() such that you need to register options using m_config_register_options().
* options: revert passing around talloc contextswm42012-08-045-75/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 48f0692ab9 "options: make option struct the talloc parent of options". This made things actually more complicated. It introduced a new parameter to the option parse and copy functions, which was used inconsistently. Some code passed a parent, some not. Morever, you have to call m_option_free() anyway, because not all options actually respect the talloc parent. There is also the question whether passing NULL as parent is supposed to work, or if you still have to implement m_config_free(). On the other hand, this simplifies nothing. I assume the intention was being able to free all option values with a single talloc_free() call, but the same goal can be reached by simply freeing the m_config struct. (The m_config talloc destructor will free each option values.) Get rid of the talloc parent context parameter. This essentially reverts commit 48f0692ab9 ("options: make option struct the talloc parent of options"). In video_out.c, make the VO priv struct the talloc parent for the m_config object, so that destroying the VO will free the options. The ability to free the m_config struct and all its managed options was introduced in commit 89a17bcda6c.
* mplayer: make OSD stack a member of MPContextwm42012-08-044-54/+54
| | | | | | | | | This also requires that the OSD stack related functions carry a pointer to MPContext. Free the OSD stack items (mp_osd_msg) at exit by making MPContext the talloc parent. (E.g. when exiting while something is still displayed on the OSD.)
* mplayer: free return value of chapter_name()wm42012-08-041-5/+8
|
* mplayer: never exit mplayer from within the play loopwm42012-08-045-25/+34
| | | | | | | | | | | | | | | | | The only place exit_player() should be called is the main() function. exit_player() should be the only function allowed to call exit(). This makes it easier to guarantee proper deinitialization, and allows using the --leak-report flag without showing false positives. The quit slave command now sets a flag only. It uses the same mechanism that's normally used to advance to the next file on the playlist, so the rest of the playback path should be able to react to the quit command quickly enough. That is, the player should react just as fast to quit requests in practice as before this commit. In reinit_audio_chain(), the player was actually exited if init_audio_filters() failed. Reuse the normal error handling path to handle this condition.
* command, mplayer: free return value of demuxer_stream_lang()wm42012-08-042-0/+2
|
* mplayer: fix invalid memory access in print_stream()wm42012-08-041-1/+1
| | | | This is a regression introduced by commit 9c02ae7e95108.
* playlist: rename params_count field to num_params for consistencywm42012-08-043-5/+5
| | | | | Other (newer) parts of mplayer use this convention, so don't introduce new conventions.
* mplayer: rearrange misleading codewm42012-08-041-3/+4
| | | | | | | The print_timeline() function actually had contained some code that changed the MPContext state. Since you wouldn't expect that from a function named print, move that code out of the function. The misleading code structure was introduced in commit 6f564fe82b.
* mplayer: fix idle mode regressionswm42012-08-043-42/+78
| | | | | | | | | | | | | | | | | | | | | Commit 89a17bcda6c16 simplified the idle loop to run any commands mplayer receives, not just playlist related commands. Unfortunately, it turns out many slave commands always assume the presence of a demuxer. MPContext->demuxer is assumed not to be NULL. This made the player crash when receiving slave commands like pause/unpause, chapter control, subtitle selection. We want mplayer being able to handle this. Any slave command or property, as long as it's backed by a persistent setting, should be run successfully, even if no file is being played. If the slave command doesn't make sense in this state, it shouldn't crash the player. Insert some NULL checks when accessing demuxers. If sh_video or sh_audio are not NULL, assume demuxer can't be NULL. (There actually aren't that many properties which need to be changed. If it gets too complicated, we could employ alternative mechanisms instead, such as explicitly marking safe properties with a flag.)
* options: fix forgotten --sound => --audio renamewm42012-08-031-1/+1
|
* demuxer: introduce a general stream structwm42012-08-037-169/+176
| | | | | | | | | | | | | | | | There are different C types for each stream type: sh_video for video, sh_audio for audio, sh_sub for sub. There is no type that handles all stream types in a generic way. Instead, there's a macro SH_COMMON, that is used to define common fields for all 3 stream structs. Accessing the common fields is hard if you want to be independent from the stream type. Introduce an actual generic stream struct (struct sh_stream), which is supposed to unify all 3 stream types one day. Once all fields defined by SH_COMMON have been moved into sh_stream, the transition is complete. Move some fields into sh_stream, and rewrite osd_show_tracks to use them.
* command: make audio switching persistent across file switcheswm42012-08-031-0/+1
| | | | | | | | | | | mp_property_audio switched the audio stream, but didn't store the newly requested audio ID to MPOpts.audio_id, which is used by --aid. This meant that the audio track would be reset when advancing to a new file. Change that to make it consistent with subtitle selection. (Whether this behavior is a good idea or not is a different question - maybe it's not a good idea, because tracks are essentially random, and this will disable default selection of tracks.)
* mplayer: fix output of audio/sub language in terminal outputwm42012-08-032-7/+14
| | | | | | | The SH_COMMON lang field seems to be blatantly unreliable and is not always set by demux_lavf (at least not with dvdnav:// ). Also fix the same for the show_tracks_osd slave command.
* mplayer: move file loading out of main()wm42012-08-031-253/+264
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The structure is now as follows: - main(): * basic initializations (e.g. init_libav() and more) * pre-parse command line (verbosity level, config file locations) * load config files (parse_cfgfiles()) * parse command line, add files from the command line to playlist (m_config_parse_mp_command_line()) * call: - handle_help_options(): * check each help-related option * print help if requested * main() exits if help was requested * call function that works down the playlist: - play_files(): * run idle loop (idle_loop()), until there are files in the playlist or an exit command was given (slave mode only) * actually load and play a file: - play_current_file(): * run all the dozens of functions to load the file and initialize playback * run a small loop that does normal playback, until the file is done or a slave command terminates playback (each iteration, run_playloop() is called) * uninitialize playback * determine next entry on the playlist to play * loop * call exit_player_with_rc() (there are many other places which use this function, though)
* mplayer: move things out of main()wm42012-08-031-213/+240
| | | | | | | The main() function used to be way too big, to the point that it was unreadable (> 1000 lines). Move random parts out of the main into new functions.
* sub: simplify code by always defining sub_cpwm42012-08-034-11/+3
|
* x11_common: remove some code duplicationwm42012-08-031-114/+54
| | | | This sin was committed in 2002.
* mplayer: do not create X11 state in player frontendwm42012-08-037-23/+24
| | | | | | | | | | | | | This is about the vo_x11_init_state() call. It basically opens a X11 connection. It's called in the main() function once. It's not really clear why this isn't done on VO creation instead. Maybe one reason was that --no-fixed-vo used to be the default: when playing a new file, the full VO state would be free'd and recreated. Keeping the X11 connection possibly improved things, although the question is how. In summary, there is no good reason to do this, and it only adds platform specific details to the player frontend. Do the X11 initialization in the respective VOs instead.
* mplayer: move highly OS specific initialization code out of main()wm42012-08-031-44/+47
| | | | | | | | The intention is to make the main() function smaller (which is at about 1000 lines currently). This commit also changes the order of some initializations, but that should be safe.
* mplayer, stream_tv: move variable initializationwm42012-08-032-5/+1
| | | | It's not clear why that was done in mplayer's main function.
* demux_audio: always enable parsing for audio streamsmplayer-svn2012-08-031-1/+2
| | | | | | | | | Generally enable parsing for audio streams. The formats I know of that do not need it (e.g. raw audio) do not have a parser anyway. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35050 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: reimar
* subassconvert: order colour names alphabetically / better match W3 listmplayer-svn2012-08-031-7/+23
| | | | | | | | | | | | | | | | Order colour names alphabetically / better match W3 list. Patch by Federico Kereki, fkereki gmail git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35006 b3059339-0415-0410-9bf9-f77b7e298cf2 Add a few new CSS colors. Patch by Federico Kereki, fkereki gmail git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35007 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: cehoyos
* tv: reduce code duplicationmplayer-svn2012-08-031-21/+14
| | | | | | | Reduce some code duplication. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34995 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: reimar
* vf_unsharp: direct rendering fixesmplayer-svn2012-08-031-5/+5
| | | | | | | | | | | | | | | | | | unsharp: actually process the frame we got. Previously it would always process the last frame allocated, but that might be a different one than the one first returned. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34975 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: reimar Request a sufficiently large image for direct rendering. Fixes broken video near the borders. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34979 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: ib
* vf_ass: use correct height when copying imagewm42012-08-031-1/+1
| | | | | | | The target image can be larger than the image size the video filter was configured for. Based on mplayer-svn commit 34973.
* vf_ass: request a sufficiently large image for direct renderingmplayer-svn2012-08-031-1/+3
| | | | | | | | | | | | Request a sufficiently large image for direct rendering. Due to alignment and similar, we might need a buffer larger than the output of the ASS filter. Fixes out of bound writes and/or broken video near the borders. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34970 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: reimar