Commit Graph

35367 Commits

Author SHA1 Message Date
wm4 7b16d4b3b2 stream_cdda, stream_vcd: check read buffer size
These assumed that the buffer provided with fill_buffer() was at least
sector sized, instead of checking the size parameter.

This is just a cleanup, since every caller made sure to align everything
on sector sizes, if a stream has the sector size set.
2013-06-09 22:06:03 +02:00
wm4 780d62f19e stream_dvd: remove some deadly insane code
Of course all of stream_dvd.c (as well as libdvdread) is completely
insane, but at least this hack for ancient broken compilers on really
obscure platforms should be safe to remove.
2013-06-09 22:06:02 +02:00
wm4 15f5b18e58 stream: misleading statement 2013-06-09 22:06:02 +02:00
wm4 005375bb7d core: use STREAM_CTRL instead of accessing stream_dvd internals
Some code in mplayer.c did stuff like accessing (dvd_priv_t *)st->priv.
Do this indirectly by introducing STREAM_CTRL_GET_DVD_INFO. This is
extremely specific to DVD, so it's not worth abstracting this further.

This is a preparation for turning the cache into an actual stream, which
simply wraps the cached stream. There are other streams which are
accessed in the way DVD was, at least TV/radio/DVB. We assume these
can't be used with the cache. The code doesn't look thread-safe or fork
aware.
2013-06-09 22:06:02 +02:00
wm4 9788789530 stream: rename cache2.c to cache.c
I never found cache1.c (whatever it was named, if it ever existed).

cache2.h will be deleted later, so don't go through the trouble of
renaming it.
2013-06-09 22:04:56 +02:00
wm4 40567fb101 cache2: uncrustify 2013-06-09 22:04:56 +02:00
Rudolf Polzer fc438061e8 encoding: fix -oneverdrop logic when -omaxfps is used
Not that anyone should ever do this...
2013-06-09 16:37:13 +02:00
Rudolf Polzer 3600bf348f encoding -omaxfps: rewrite logic
Now it properly hits the "0 times displayed" case when frames get
skipped; this means the candidate frame for the case the next frame is
"long" is set properly.
2013-06-09 16:31:09 +02:00
Rudolf Polzer 19d80e28e1 encoding -omaxfps: do not shift pts when pts are repeated entirely
This is just to make sure. I have no test case for this, but the logic
seems saner that way.
2013-06-09 15:50:53 +02:00
Rudolf Polzer 0cbc75c083 Option -omaxfps: limit fps when encoding
Lower-fps content is left alone (NOT aligned to this fps); higher fps
content is decimated to this frame rate.
2013-06-09 15:37:28 +02:00
wm4 4af59abbb4 manpage: improve documentation of property expansion 2013-06-08 18:09:58 +02:00
wm4 667c8352f3 core: make options.c compile standalone
This also removes the split between "mplayer" and "common" opts (common
opts used to be shared between mencoder and mplayer).
2013-06-08 17:08:20 +02:00
wm4 96338c6c17 core: rename cfg-mplayer.h to options.c 2013-06-08 17:08:20 +02:00
wm4 757c6d0394 core: merge defaultopts.c into cfg-mplayer.h
There isn't really any reason why this should be in a separate source
file.
2013-06-08 17:08:20 +02:00
wm4 c185b0ba4a command: replace some show_ commands with properties
show_chapters, show_tracks, and show_playlist are killed and replaced
with the properties chapter-list, track-list, and playlist. The code
and the output of these stays the same, this is just moving a lot of
code around and reducing the number of properties.

The "old" commands will still be supported for a while (to avoid making
everyone angry), so handle them with the legacy layer. Add something to
suppress printing the legacy warnings for these commands.
2013-06-07 18:00:34 +02:00
wm4 b15143b7e0 command: human readable output for metadata property
Slightly better output when printing ${metadata}. Print each metadata
item as "name: value", instead of the raw list. It's still not very
great, though. The old format is still available through ${=metadata}
for things which dare to use the broken slave mode.
2013-06-07 17:49:35 +02:00
wm4 812798c5ac core: reset pause state by default when going to next file
Apparently this behavior is more intuitive/better to users.
2013-06-07 17:07:04 +02:00
wm4 6fc91b44cd m_option: allow setting empty lists
There's no reason why this should be forbidden.
2013-06-07 17:05:07 +02:00
wm4 925662b193 ao_jack: remove global variables 2013-06-07 16:42:29 +02:00
wm4 e54ab16d1a ao_jack: align data sizes on audio frame size
Fixes crashes when playing with certain numbers of channels. The core
assumes AOs accept data aligned on channels * samplesize, and ao_jack's
play() function broke that assumption:

    mpv: core/mplayer.c:2348: fill_audio_out_buffers: Assertion `played % unitsize == 0' failed.

Fix by aligning the buffer and chunk sizes as needed.
2013-06-07 15:58:28 +02:00
wm4 4e6098ed49 ao_jack: switch to new AO API 2013-06-07 15:44:49 +02:00
wm4 5dec12f525 ao_jack: uncrustify 2013-06-07 15:39:32 +02:00
wm4 6cc60710e4 ao_oss: remove duplicated format info
Instead of having two big switch statements to convert between two
audio formats, use a single table.
2013-06-07 15:30:40 +02:00
wm4 32a898ff5d ao_oss: remove global variables 2013-06-07 15:20:07 +02:00
wm4 15202ebc76 ao_oss: switch to new AO API 2013-06-07 15:05:34 +02:00
wm4 f8f4285671 ao_oss: uncrustify 2013-06-07 14:29:59 +02:00
Stefano Pigozzi e8a6e1a201 macosx_events: handle key modifiers with media keys
This was overlooked in the previous inplementation. Adding it required some
refactoring of the `handleKeyDown:` method in order to extract common parts
with `handleMediaKey:`.
2013-06-06 21:33:31 +02:00
Stefano Pigozzi 6619905902 macosx_events: DRY up key lookup over dictionary
Two methods duplicated very similar behaviour. Extract method with the common
behaviour.
2013-06-05 21:39:59 +02:00
wm4 b9607b63a4 docs: update tech-overview.txt 2013-06-05 01:39:54 +02:00
Stefano Pigozzi b9cb011ba5 keycodes: fix copy paste error
Makes 213ad5d behave has intended.
2013-06-05 00:02:29 +02:00
Stefano Pigozzi 85c2a4a1d2 macosx_events: make remote property an instance variable
There was no reason for it to be public.
2013-06-05 00:02:29 +02:00
Jan-Marek Glogowski 953d225368 command: add the current local time as a property
This adds a the property 'clock', which returns the current
local time as the string hh:mm.

Additionally the keybinding 'shift' + 'o' was added to displaying
the clock as '[hh:mm]' .
2013-06-04 23:41:15 +02:00
Stefano Pigozzi 213ad5d6c4 osx: improve Media Keys support
This commit addresses some issues with the users had with the previous
implementation in commit c39efb9. Here's the changes:

  * Use Quartz Event Taps to remove Media Key events mpv handles from
    the global OS X queue. This prevents conflicts with iTunes. I did this on
    the main thread since it is mostly idling. It's the playloop thread that
    actually does all the work so there is no danger of blocking the event tap
    callback.
  * Introduce `--no-media-keys` switch so that users can disable all of mpv's
    media key handling at runtime (some prefer iTunes for example).
  * Use mpv's bindings so that users can customize what the media keys do via
    input.conf. Current bindings are:

      MK_PLAY cycle pause
      MK_PREV playlist_prev
      MK_NEXT playlist_next

An additional benefit of this implementation is that it is completly handled
by the `macosx_events` file instead of `macosx_application` making the
project organization more straightforward.
2013-06-04 23:02:23 +02:00
wm4 1b6888ae8e ao_openal: switch to new AO API 2013-06-04 01:42:57 +02:00
wm4 a933cf28f2 ao_openal: uncrustify 2013-06-04 01:34:53 +02:00
reimar 774dc23ab3 ao_jack: add (no-)connect suboption
Add (no)connect option to ao_jack.

Patch by Markus Appel [masolomaster3000 googlemail com].

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@36297 b3059339-0415-0410-9bf9-f77b7e298cf2

Conflicts:
	DOCS/man/de/mplayer.1
	DOCS/man/en/mplayer.1
	audio/out/ao_jack.c
2013-06-04 01:31:20 +02:00
wm4 3725ab980c ao_dsound: remove global variables 2013-06-04 01:22:50 +02:00
wm4 8afcb84ee5 ao_dsound: switch to new AO API 2013-06-04 01:07:56 +02:00
wm4 cee56e8623 ao_dsound: uncrustify 2013-06-04 00:56:28 +02:00
wm4 92ae48db0f Merge branch 'sub_mess'
This branch heavily refactors the subtitle code (both loading and
rendering), and adds support for a few new formats through FFmpeg.

We don't remove any of the old code yet. There are still some subtleties
related to subreader.c to be resolved: code page detection & conversion,
timing post-processing, UTF-16 subtitle support, support for the -subfps
option. Also, SRT reading and loading ASS via libass should be turned
into proper demuxers. (SRT is needed because Libav's is gravely broken,
and we want ASS loading via libass to cover full libass format support.
Both should be demuxers which are probed _before_ libavformat, so that
all subtitles can be loaded through the demuxer infrastructure, and
libavformat subtitles don't need to be treated in a special way.)
2013-06-04 00:29:44 +02:00
wm4 c1ac97b99b sub: always show subtitles on terminal with -no-video
Until now, this happened only when the -no-ass option was used. This
difference in behavior doesn't make much sense, so change it so that
whether -no-ass is used or not doesn't matter. (-no-ass enables the OSD
subtitle renderer, which has the terminal fallback, while the normal
path is video only.)

the changes in set_osd_subtitle() and reinit_video_chain() are for
resetting the state correctly when switching between video/no-video.
2013-06-04 00:21:57 +02:00
Stefano Pigozzi daf8ed831b fix build on linux
missing ifdef in the previous commit made the build fail
2013-06-03 23:02:16 +02:00
wm4 f3871193fc sd_srt, sd_microdvd: set ASS script resolution
Both converters can output \pos and deal with font sizes, so they assume
a specific script resolution (PlayResX/PlayResY). The implicit
assumption was that a specific resolution was guaranteed. The
MP_ASS_FONT_PLAYRESY constant is connected to this.

Better make it explicit, so that the implicit dependency on
MP_ASS_FONT_PLAYRESY is removed. (Unfortunately, libavcodec sub
converters still don't set PlayResX/PlayResY explicitly, so the value
set by that constant can't be declared as arbitrary yet.)

PlayResY=288 is most likely the SSA natural script resolution (or
something like this?), as well as the libass and VSFilter default.
PlayResX=384 is the fallback value set by libass if PlayResY is set to
288, and PlayResX is unset.
2013-06-03 23:00:39 +02:00
wm4 61dfe12179 sub: add name field to all sub decoders
Might help with debugging.
2013-06-03 22:40:32 +02:00
wm4 3289be9a28 sd_ass: add default style if there aren't any styles
The default style is added by mp_ass_default_track(), but not by
ass_new_track(). Considering this, the previous condition at this point
didn't make much sense anymore: the actual (converted) subtitle format
doesn't matter much for what styling should be applied. What matters is
if the subtitle was originally ASS, or if it was converted to it.

Change the code such that the default style is added if there aren't
any, even after reading sub extradata. (The extradata contains the ASS
header, including the style section.) This might change behavior with
scripts that don't define any styles. The change is either with this
commit or with an earlier commit in this branch, depending on the
situation - there are multiple places where default styles are added
in libass API functions, and it's all a big mess.

Other than with very old or broken files (where different behavior
doesn't matter much), the current code should be pretty safe, though.
2013-06-03 22:40:31 +02:00
wm4 8c63b318dc ass_mp: provide function to add default styles 2013-06-03 22:40:07 +02:00
wm4 9f4261de65 core: add common function to initialize AVPacket
Audio and video had their own (very similar) functions to initialize an
AVPacket (ffmpeg's packet struct) from a demux_packet (mplayer's packet
struct). Add a common function for these.

Also use this function for sd_lavc_conv. This is actually a functional
change, as some libavfilter subtitle demuxers add weird out-of-band
stuff as side-data.
2013-06-03 22:40:07 +02:00
wm4 13a1ce16f9 sub: pass subtitle packets directly
Before this, subtitle packets were returned as data ptr/len pairs, and
mplayer.c got the rest (pts and duration) directly from the demuxer
data structures. Then mplayer.c reassembled the packet data structure
again.

Pass packets directly instead. The mplayer.c side stays a bit awkward,
because the (now by default unused) DVD path keeps getting in the way.
In demux.c there's lots of weird stuff (3 functions that read packets,
really?), but we want to keep the code equivalent for now to avoid
hitting weird issues and corner cases.
2013-06-03 22:40:07 +02:00
wm4 5d517184f5 sub: never set VSFilter aspect if the ASS subtitle is converted
When e.g. converting SRT to ASS, we certainly don't want them stretched
by video aspect ratio, even if that's necessary for native ASS
subtitles.

Annoying weird details...
2013-06-03 22:40:07 +02:00
wm4 3913e3e383 sub: don't check for duplicates on sub conversion
This mirrors commit "sub: remove check_duplicate_plaintext_event()".
That code was basically duplicated. In general, this code is still
needed when doing conversion during demuxing (mostly because you can
seek during demuxing, which will cause duplicate events by replaying).
2013-06-03 22:40:07 +02:00