Commit Graph

33 Commits

Author SHA1 Message Date
wm4 5196b03fb2 player: avoid stalling when starting a network stream
Starting a network stream could stall by executing uncacheable stream
control requests (STREAM_CTRL_GET_LANG and STREAM_CTRL_GET_DVD_INFO).
Being uncacheable means the player has to wait until the cache is done
reading the current block of data. These requests can't be cached
because they're too complicated, so the only way to avoid them is
special casing the DVD and Bluray streams (which are the only things
which need these requests), and not doing them in other cases.

(This is kind of inelegant, but so is the rest of the DVD/BD code.)
2014-01-14 22:24:07 +01:00
wm4 0335011f11 stream: mp_msg conversions
We also drop some slave mode stuff from stream_vcd.
2013-12-21 21:43:16 +01:00
wm4 2c08bf1bd7 Reduce recursive config.h inclusions in headers
In my opinion, config.h inclusions should be kept to a minimum. MPlayer
code really liked including config.h everywhere, though, even in often
used header files. Try to reduce this.
2013-12-18 17:12:21 +01:00
wm4 0112143fda Split mpvcore/ into common/, misc/, bstr/ 2013-12-17 02:39:45 +01:00
wm4 eb15151705 Move options/config related files from mpvcore/ to options/
Since m_option.h and options.h are extremely often included, a lot of
files have to be changed.

Moving path.c/h to options/ is a bit questionable, but since this is
mainly about access to config files (which are also handled in
options/), it's probably ok.
2013-12-17 02:07:57 +01:00
wm4 7dc7b900c6 Replace mp_tmsg, mp_dbg -> mp_msg, remove mp_gtext(), remove set_osd_tmsg
The tmsg stuff was for the internal gettext() based translation system,
which nobody ever attempted to use and thus was removed. mp_gtext() and
set_osd_tmsg() were also for this.

mp_dbg was once enabled in debug mode only, but since we have log level
for enabling debug messages, it seems utterly useless.
2013-12-16 20:41:08 +01:00
wm4 f99aff1b31 Reduce stheader.h includes, move stream types to mp_common.h 2013-11-23 22:08:42 +01:00
wm4 c9a740fccd stream_bluray: return number of titles
So that the "titles" property returns the number of titles.
2013-09-10 15:39:48 +02:00
wm4 971e8456fc stream: fix url_options field, make protocols field not fixed length
The way the url_options field was handled was not entirely sane: it's
actually a flexible array member, so it points to garbage for streams
which do not initialize this member (it just points to the data right
after the struct, which is garbage in theory and practice). This was
not actually a problem, since the field is only used if priv_size is
set (due to how this stuff is used). But it doesn't allow setting
priv_size only, which might be useful in some cases.

Also, make the protocols array not a fixed size array. Most stream
implementations have only 1 protocol prefix, but stream_lavf.c has
over 10 (whitelists ffmpeg protocols). The high size of the fixed
size protocol array wastes space, and it is _still_ annoying to
add new prefixes to stream_lavf (have to bump the maximum length),
so make it arbitrary length.

The two changes (plus some more cosmetic changes) arte conflated into
one, because it was annoying going over all the stream implementations.
2013-08-26 10:09:45 +02:00
wm4 f806e268c6 stream: don't require streams to set s->pos in seek callback
Instead, set s->pos depending on the success of the seek callback.
2013-08-22 19:14:26 +02:00
Noble Huang 1ef239a499 stream_bluray: fix bd:// url segfault introduced by commit bc1d61 2013-08-12 19:00:39 +02:00
Stefano Pigozzi 406241005e core: move contents to mpvcore (2/2)
Followup commit. Fixes all the files references.
2013-08-06 22:52:31 +02:00
wm4 bc1d61cf42 stream: redo URL parsing, replace m_struct usage with m_config
Move the URL parsing code from m_option.c to stream.c, and simplify it
dramatically. This code originates from times when http code used this,
but now it's just relict from other stream implementations reusing this
code. Remove the unused bits and simplify the rest.

stream_vcd is insane, and the priv struct is different on every
platform, so drop the URL parsing. This means you can't specify a track
anymore, only the device. (Does anyone use stream_vcd? Not like this
couldn't be fixed, but it doesn't seem worth the effort, especially
because it'd require potentially touching platform specific code.)
2013-08-02 17:02:34 +02:00
wm4 f406482d84 stream: remove useless author/comment fields
These were printed only with -v. Most streams had them set to useless
or redundant values, so it's just badly maintained bloat.

Since we remove the "author" field too, and since this may have
copyright implications, we add the contents of the author fields to
the file headers, except if the name is already part of the file header.
2013-07-12 22:16:27 +02:00
wm4 5c1b8d4aa1 stream: don't require streams to set a type
Set the type only for streams that have special treatment in other parts
of the code.
2013-07-12 22:16:26 +02:00
wm4 cb45b1c65b Cleanup some include statements 2013-07-12 22:16:26 +02:00
wm4 52c3eb6976 core: change open_stream and demux_open signature
This removes the dependency on DEMUXER_TYPE_* and the file_format
parameter from the stream open functions.

Remove some of the playlist handling code. It looks like this was
needed only for loading linked mov files with demux_mov (which was
removed long ago).

Delete a minor bit of dead network-related code from stream.c as well.
2013-07-12 21:56:40 +02:00
wm4 c4f83ac6e9 stream: remove weird STREAMTYPE_STREAM special handling
This was an old leftover from an earlier cleanup (which happened in
2003), and which used "special" stuff for streams that could be only
forward-seeked.

Also, don't add mode flags to s->flags; they're supposed to be in
s->mode instead.
2013-07-07 21:10:44 +02:00
wm4 62786c0c91 stream_bluray: report chapter times
This was forgotten in commit 7294303.
2013-05-09 18:49:16 +02:00
wm4 729430387c stream_bluray: general timeline support
Uses the same mechanisms as stream_dvd to report the virtual playback
time as known by libdvdread/libbluray, instead of the raw demuxer
output.

This should solve many problems with BD playback, like correct display
of playback time and duration.

On the other hand, this causes some new problems. For example, the
reported stream time has a rather low resolution (1-2 seconds), so
doing precise seeking on it is near impossible.
2013-05-09 01:16:04 +02:00
wm4 2dde1af88d stream_bluray: make code a bit more obvious 2013-05-09 01:16:04 +02:00
reimar daee1a04e7 stream_bluray: remove the broken -bluray-chapter option
Remove the broken -bluray-chapter option.

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

Conflicts:
	DOCS/man/en/mplayer.1
	cfg-common.h
2013-04-27 15:28:57 +02:00
reimar 2f004875d3 stream_bluray: fix querying current chapter
br://: Fix querying current chapter.

This also fixes specifying an end chapter via -chapter.
Based on patch by Olivier Rolland [billl users.sourceforge.net]

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@36173 b3059339-0415-0410-9bf9-f77b7e298cf2
2013-04-27 15:28:34 +02:00
wm4 9085b85729 stream: fix dvd:// + cache crashing
The language string was dynamically allocated, which completely fails
if the cache is forked (which it usually is). Change it back to a fixed
length string, like the original code had it.
2012-11-20 18:00:15 +01:00
wm4 ddffcce678 stream, demux: replace off_t with int64_t
On reasonable systems, these types were the same anyway. Even on
unreasonable systems (seriously, which?), this may reduce potential
breakage.
2012-11-20 18:00:15 +01:00
wm4 4873b32c59 Rename directories, move files (step 2 of 2)
Finish renaming directories and moving files. Adjust all include
statements to make the previous commit compile.

The two commits are separate, because git is bad at tracking renames
and content changes at the same time.

Also take this as an opportunity to remove the separation between
"common" and "mplayer" sources in the Makefile. ("common" used to be
shared between mplayer and mencoder.)
2012-11-12 20:08:18 +01:00
ib 1215f0871c stream: add STREAM_CTRL_GET_CURRENT_TITLE
Add new stream control command STREAM_CTRL_GET_CURRENT_TITLE for DVDs.

This provides the current title (aka track) number of a DVD.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35263 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-10-30 19:50:20 +01:00
wm4 e47b779bfc bluray: add bd:// as stream prefix
The existing short prefix, br://, was not very intuitive.
2012-09-18 21:04:46 +02:00
wm4 d21b109bf7 core: fix DVD subtitle selection
Add all subtitle tracks as reported by libdvdread at playback start.
Display language for subtitle and audio tracks. This commit restores
these features to the state when demux_mpg was default for DVD playback,
and makes them work with demux_lavf and the recent changes to subtitle
selection in the frontend.

demux_mpg, which was the default demuxer for DVD playback, reordered
the subtitle streams according to the "logical" subtitle track number,
which conforms to the track layout reported by libdvdread, and is what
stream_dvd expects for the STREAM_CTRL_GET_LANG call. demux_lavf, on
the other hand, adds the streams in the order it encounters them in
the MPEG stream. It seems this order is essentially random, and can't
be mapped easily to what stream_dvd expects.

Solve this by making demux_lavf hand out the MPEG stream IDs (using the
demuxer_id field). The MPEG IDs are mapped by mplayer.c by special
casing DVD playback (map_id_from/to_demuxer() functions). This mapping
is essentially the same what demux_mpg did. Making demux_lavf reorder
the streams is out of the question, because its stream handling is
already messy enough.

(Note that demux_lavf doesn't export stream IDs for other formats,
because most time libavformat demuxers do not set AVStream.id, and we
don't know which demuxers do. But we know that MPEG is safe.)

Another major complication is that subtitle tracks are added lazily, as
soon as the demuxer encounters the first subtitle packet for a given
subtitle stream. Add the streams in advance. If a yet non-existent
stream is selected, demux_lavf must be made to auto-select that subtitle
stream as soon as it is added. Otherwise, the first subtitle packet
would be lost. This is done by DEMUXER_CTRL_PRESELECT_SUBTITLE.
demux_mpg didn't need this: the frontend code could just set ds->id to
the desired stream number. But demux_lavf's stream IDs don't map
directly to the stream number as used by libdvdread, which is why this
hack is needed.
2012-09-18 21:04:45 +02:00
mplayer-svn 804bf91570 commands, dvd, dvdnav, bluray: cleanup sub/audio track language display
Code cleanup: Use a stream_control instead of global functions to
get the language associate with a audio or subtitle stream from
the streaming layer.

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

Support showing the stream language with br:// playback.

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

Fix DVDs showing the subtitle language as "unknown"
for a long time.

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

Author: reimar

Note: heavily modified by wm4 for this fork of mplayer.
2012-08-03 01:59:15 +02:00
Rico Tzschichholz 10efda3b37 stream_bluray: switch to new libbluray API
Switch to new libbluray API with three parameters to
bd_get_title_info(). libbluray versions using the old API are no
longer supported.
2011-07-10 11:30:06 +03:00
ben 4662ea6409 stream_bluray: implement slave mode compatible controls
Added stream controls: get/set for chapters and angles.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31640 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:14:20 +02:00
ben 6704008a46 stream_bluray: add unencrypted Blu-ray playback
Support for unencrypted Blu-ray playback through libbluray.
Use it through: mplayer br:////path/to/disc

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31631 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:14:20 +02:00