Commit Graph

133 Commits

Author SHA1 Message Date
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 44d6ac06ae stream: parse URL escapes for file://
So for example "file:///file%20name.mkv" will open "file name.mkv".

I'm not sure whether we want/need this. The old code didn't do it.
Also, it's not really clear whether this is handled correctly. It
seems the corresponding freedesktop.org "standard" allows a (useless)
hostname part, which we should skip in theory. The number of slashes
is not really clear either. We can open relative filenames (by removing
one of the slashes from the example above), which is perhaps an
unneeded feature. How does this even work with Windows paths?

This issues can probably be corrected later.

The URL unescape code is based on code from m_option.c removed with
a recent commit.
2013-08-02 17:05:26 +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 06996810bf stream_dvd: fix .ifo redirection
This was blatantly broken after stream->url was changed to talloc.
2013-07-30 16:15:36 +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 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 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 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 e9af899237 demux: fix "-demuxer mpegps", don't force demuxer in stream_dvd
Internally, stream_dvd.c returned DEMUXER_TYPE_MPEG_PS, and the same
value was hardcoded to enforced usage of demux_lavf in demux.c. But
"-demuxer mpegps" basically did the same, so that switch was broken
for this format. Undo this and don't request a demuxer in stream_dvd.c.
demux_lavf.c is (probably) good enough to probe correctly with DVD.
Otherwise, we'd actually have to do something completely different to
force the libavformat demuxer.
2013-06-02 23:57:41 +02:00
wm4 b01e8d6210 stream: report chapter times, use time seeks for DVD chapters
Allow the stream layer to report chapter times. Extend stream_dvd to do
this. I'm not 100% sure whether the re-used code is bug-free (because it
was used for slave-mode and/or debugging only).

MAke the frontend do time-based seeks when switching DVD chapters. I'm
not sure if there's a real reason STREAM_CTRL_SEEK_TO_CHAPTER exists
(maybe/hopefully not), but we will see.

Note that querying chapter times in demuxer_chapter_time() with the new
STREAM_CTRL_GET_CHAPTER_TIME could be excessively slow, especially with
the cache enabled. The frontend likes to query chapter times very often.
Additionally, stream_dvd uses some sort of quadratic algorithm to list
times for all chapters. For this reason, we try to query all chapters on
start (after the demuxer is opened), and add the chapters to the demuxer
chapter list. demuxer_chapter_time() will get the time from that list,
instead of asking the stream layer over and over again.

This assumes stream_dvd knows the list of chapters at the start, and
also  that the list of chapters never changes during playback. This
seems to be true, and the only exception, switching DVD titles, is not
supported at runtime (and doesn't need to be supported).
2013-05-06 23:39:48 +02:00
wm4 4d14a42997 stream: add start time reporting
Will be needed to override the demuxer's start time reporting. We could
be lazy and special-case it since the result is always 0 for the streams
that care, but doing it properly is better.
2013-05-05 18:44:24 +02:00
wm4 acad31c2d3 core: don't report byte-based playback position with dvd
DVD playback uses a demuxer that signals to the frontend that timestamp
resets are possible. This made the frontend calculate the OSD playback
position based on the byte position and the total size of the stream.
This actually broke DVD playback position display. Since DVD reports a
a linear playback position, we don't have to rely on the demuxer
reported position, so disable this functionality in case of DVD
playback. This reverts the OSD behavior with DVD to the old behavior.
2013-05-05 18:44:23 +02:00
Rudolf Polzer f3374eecad stream_dvd: fix angle math
Stop changing the dvd_angle variable while opening a DVD. Fixes issues
with multiple dvd:// URLs on one command line.
2012-12-22 10:00:00 +01:00
Rudolf Polzer df28eac342 stream_dvd: add a stream_seek() call
This fixes use of -chapter together with -correct-pts and demux_lavf and
stream_dvd.
2012-12-07 16:44:53 +01: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 65fc530f0c Rename to "mpv"
This changes the name of this project to mpv. Most user-visible mentions
of "MPlayer" and "mplayer" are changed to "mpv". The binary name and the
default config file location are changed as well.

The new default config file location is: ~/.mpv/

Remove etc/mplayer.desktop. Apparently this was for the MPlayer GUI,
which has been removed from mplayer2 ages ago.

We don't have a logo, and the MS Windows resource files sort-of require
one, so leave etc/mplayer.ico/.xpm as-is.

Remove the debian and rpm packaging scripts. These contained outdated
dependencies and likely were more harmful than useful. (Patches which
add working and well-tested packaging are welcome.)
2012-10-12 10:14:32 +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
mplayer-svn 98f15b645f stream: add new stream control command STREAM_CTRL_GET_NUM_TITLES
This provides the total number of titles (aka tracks) of CDs / VCDs / DVDs.

Additionally, add a titles property to the get_property slave command.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34474 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: ib
2012-08-03 01:43:03 +02:00
reimar d84c42b09f stream_dvd: fix dvd_get_current_time()
Fix dvd_get_current_time so the cell argument actually has a purpose.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33603 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-07-06 13:01:07 +03:00
Clément Bœsch 59fff90d94 options: change -alang and -slang to use string list type
There is no reason to use manual language list splitting when an
automatic split function is already available.

Some types change from "unsigned char" to "char", but this shouldn't
cause issues since [as]lang settings are unlikely to have characters
above 127.
2011-04-20 04:22:42 +03:00
reimar 15259f1aad stream_dvd: fill_buffer(): use given buffer, not stream's default
Fix dvd:// fill_buffer function to actually write into the specified
buffer and check that the buffer is sufficiently large.

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

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32592 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-08 18:05:11 +02:00
reimar 040008b43f stream_dvd: minor cleanup
Remove a pointless and stupid condition.

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

Change code to something understandable (but equivalent).

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

100l, add missing return.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32590 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-08 18:05:11 +02:00
cigaes 00f82c63b0 stream_dvd: millisecond accuracy for chapters in -identify output
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32539 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-07 20:18:21 +02:00
reimar e2d5a13f76 stream_dvd[nav]: Add const qualifiers to string arguments
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31957 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:15:48 +02:00
diego 5c76f24b09 stream_dvd: Improve seeking by position
The current code takes the angle into account. This is a mistake since
the position is independent of the angle.

patch by Olivier Rolland, billl users.sourceforge net

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31895 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:15:01 +02:00
diego 0a321e01e3 stream_dvd: Improve seeking by chapters
The current code seeks to the start of the chapter. From this
position, it then tries to figure out the starting cell. This is
completely suboptimal and error prone since the starting cell can be
directly deduced from the chapter.

patch by Olivier Rolland, billl users.sourceforge net

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31894 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:15:01 +02:00
diego fdb6ce15df stream_dvd: fix incorrect assumption about chapter count
Fix the incorrect assumption that the number of chapters of a DVD
title is equal to the number of cells.

patch by Olivier Rolland, billl users.sourceforge net

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31893 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:15:01 +02:00
Uoti Urpala 1888e57af7 cosmetics: "struct vf_instance* vf" -> "struct vf_instance *vf"
Change 'struct vf_instance' pointer arguments to more standard style
as in the subject. Also some other minor formatting fixes.

Patch by Diego Biurrun.
2010-05-29 17:20:44 +03:00
Uoti Urpala a2133d7684 options: move -chapter values to option struct
-chapter can optionally take a range with a start and an end. Add a
new option type which supports such values and use that instead of a
custom per-option function.

This commit also fixes a build configuration bug: before the
availability of the -chapter option depended on DVD functionality
being enabled in the binary, even though the option works with other
sources too.
2010-04-25 22:48:10 +03:00
Uoti Urpala 00323c06e2 Delete things related to old translation system
Remove the help/ subdirectory, configure code to create toplevel
help_mp.h, and all the '#include "help_mp.h"' lines from .c files.
2010-03-10 03:47:14 +02:00
Uoti Urpala 12d3caebc7 Merge svn changes up to r30475 2010-03-09 19:18:43 +02:00
diego 59e26907b6 Add license header to all files missing it in the stream subdirectory.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30468 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-01-30 22:26:47 +00:00
Uoti Urpala 5995bc175a Merge svn changes up to r29962 2009-11-23 01:56:21 +02:00
reimar af2988cbce Finally rename the STREAM_SEEK define to MP_STREAM_SEEK, there are just too many
name clashes, in particular with Windows headers (which define STREAM_SEEK as an enum type).


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29962 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-11-22 15:18:21 +00:00
Uoti Urpala 287b62163e Merge svn changes up to r29912 2009-11-16 07:01:46 +02:00
reimar 7694e9074d Move headers related to setting dvd speed to dvd_common.
This makes -dvd-speed work again.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29894 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-11-11 09:28:21 +00:00
reimar 0d40667c8c Move dvd_speed and dvd_set_speed to dvd_common and implement -dvd-speed
support for dvdnav.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29890 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-11-10 23:20:05 +00:00
reimar 36ec821836 Move arrays used by both dvd and dvdnav to dvd_common.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29889 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-11-10 23:15:48 +00:00
reimar 8f164e07a0 Share dvd_device extern declaration between dvd and dvdnav.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29887 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-11-10 23:10:57 +00:00
Uoti Urpala d6c410b54c Replace libavutil internal header #includes with MPlayer copies
Change #include lines for libavutil/intreadwrite.h, libavutil/bswap.h
and libavutil/x86_cpu.h to use the MPlayer file under ffmpeg_files/
instead.
2009-07-26 06:16:43 +03:00
Uoti Urpala 0eb321bf2c Remove trailing whitespace from most files 2009-07-07 02:34:35 +03:00
Amar Takhar e306174952 Translation system changes part 2: replace macros by strings
Replace all MSGTR_ macros in the source by the corresponding English
string.
2009-07-07 01:38:20 +03:00
Amar Takhar b5972d6f14 Translation system changes part 1: wrap translated strings
Replace mp_msg() calls which have a translated string as the format
argument with mp_tmsg and add _() around all other translated strings.
2009-07-07 01:28:07 +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 d136cf6882 Merge svn changes up to r29134 2009-04-02 23:55:13 +03:00