Commit Graph

55 Commits

Author SHA1 Message Date
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 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 95cfe58e3d Use O_CLOEXEC when creating FDs
This is needed so that new processes (created with fork+exec) don't
inherit open files, which can be important for a number of reasons.

Since O_CLOEXEC is relatively new (POSIX.1-2008, before that Linux
specific), we #define it to 0 in io.h to prevent compilation errors on
older/crappy systems. At least this is the plan.

input.c creates a pipe. For that, add a mp_set_cloexec() function (which
is based on Weston's code in vo_wayland.c, but more correct). We could
use pipe2() instead, but that is Linux specific. Technically, we have a
race condition, but it won't matter.
2013-11-30 22:40:51 +01:00
wm4 cc7f8ee620 mplayer: attempt to make playback resume work with DVD/BD
The problem with DVD/BD and playback resume is that most often, the
filename is just "dvd://", while the actual path to the DVD disk image
is given with --dvd-device. But playback resume works on the filename
only.

Add a pretty bad hack that includes the path to the disk image if the
filename starts with dvd://, and the same for BD respectively. (It's a
bad hack, but I want to go to bed, so here we go. I might revert or
improve it later, depending on user feedback.)

We have to cleanup the global variable mess around the dvd_device.
Ideally, this should go into MPOpts, but it isn't yet. Make the code
paths in mplayer.c take MPOpts anyway.
2013-09-22 03:31:25 +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
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 1848be363e stream: remove inactive URL option fields
The URL option parser only accesses certain fields. Remove the fields
that are not accessed, and thus are completely unused and inaccessible.

Historically, these fields were supposed to be settable using an extra
list of options passed to open_stream(). Commit f518cf7 removed these
extra options. Apparently nothing ever actually used this facility.
2013-07-30 16:15:36 +02:00
Diogo Franco (Kovensky) db9102765a stream_vcd.c: fix compilation on win32
The mp_vcd_priv_t struct doesn't have a file descriptor but a file
handle on win32.
2013-07-22 02:52:04 +02:00
wm4 e18ffd6b99 Merge branch 'remove_old_demuxers'
The merged branch doesn't actually just remove old demuxers, but also
includes a branch of cleanups and some refactoring.

Conflicts:
	stream/stream.c
2013-07-14 17:59:26 +02:00
Jonathan Yong dc4dcf34e5 stream_vcd: use intptr_t cast for _open_osfhandle in accordance to MSDN 2013-07-13 04:08:04 +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 f63193f58f stream: remove fd member
Stream implementations could set this to a unix file descriptor. The
generic stream code could use it as fallback for a few things. This
was confusing and insane. In most cases, the stream implementations
defined all callbacks, so setting the fd member didn't have any
advantages, other than avoiding defining a private struct to store it.

It appears that even if the stream implementation used close() on the
fd (or something equivalent), stream.c would close() it a second time
(and on windows, even would call closesocket()), which should be proof
for the insanity of this code.

For stream_file.c, additionally make sure we don't close stdin or
stdout if "-" is used as filename.

For stream_vcd.c, remove the control() code. This code most likely
didn't make the slightest sense, because it used a different type
for stream->priv. It also leaked memory. Maybe it worked, but it's
incorrect and insignificant anyway, so kill it. This code was added
with commit 9521c19 (svn commit 31019).

Untested for all protocols other than stream_file.c.
2013-07-12 22:16:26 +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 af0c41e162 Remove old demuxers
Delete demux_avi, demux_asf, demux_mpg, demux_ts. libavformat does
better than them (except in rare corner cases), and the demuxers have
a bad influence on the rest of the code. Often they don't output
proper packets, and require additional audio and video parsing. Most
work only in --no-correct-pts mode.

Remove them to facilitate further cleanups.
2013-07-07 23:54:11 +02:00
wm4 f7c912dff2 stream: move VCD specific stuff to stream_vcd
I don't even know what VCDs are. A prehistoric version of the DVD or so.
2013-06-09 22:06:03 +02:00
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 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
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
Uoti Urpala e2fc1f640f build: remove OS/2 support 2012-04-06 17:45:56 +03:00
Uoti Urpala 6c57eeb7ad stream_vcd: fix option value allocated with strdup
A string freed with m_struct_free() was allocated with strdup(). This
would cause a crash when using vcd:// streams. Fix to use
talloc_strdup().
2012-01-16 22:40:14 +02:00
Uoti Urpala 7795726e0f Merge svn changes up to r31033 2010-04-26 18:25:34 +03:00
Uoti Urpala 837c48ddee Merge svn changes up to r31020 2010-04-26 18:06:00 +03:00
reimar d62bef6ee5 Try to fix VCD compilation on non-Linux systems.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31023 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-04-05 19:31:55 +00:00
reimar 9521c190c3 Export VCD tracks as chapters, just like for cue:// URLs.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31019 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-04-05 16:40:04 +00: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 240550bbb9 Merge svn changes up to r30848 2010-03-10 03:00:14 +02:00
Uoti Urpala bc1d0ca37d Merge svn changes up to r30798 2010-03-10 02:35:02 +02:00
Uoti Urpala 12d3caebc7 Merge svn changes up to r30475 2010-03-09 19:18:43 +02:00
Uoti Urpala b34a88e4f4 translations: tweak cases that relied on concatenating adjacent strings
Tweak some code parts that used to rely on string literals from
translation macros being concatenated with other adjacent string
literals. Break up the resulting string into independently translated
parts, so that the existing translations for those parts can still be
used.
2010-03-07 21:35:23 +02:00
komh 9beeeb1a9e Add a VCD support for OS/2
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30819 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-03-03 14:32:29 +00:00
reimar 2c8d69f185 Remove useless cast.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30794 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-02-28 11:30:35 +00: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 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
diego 4d644f513c Replace preprocessor check for WIN32 with checks for __MINGW32__ and __CYGWIN__.
This avoids a pointless indirection that only obscures what is really done.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27761 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-10-13 16:23:55 +00:00
reimar 6f616c316d stream_opts should be const
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25719 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-01-13 12:34:42 +00:00
diego a6cf8a908c Replace SYS_DARWIN by __APPLE__ and __DARWIN__ where appropriate.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25370 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-12-11 23:52:55 +00:00
reimar dd2fcb4370 stream_opts arrays should be const
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25270 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-12-02 21:37:08 +00:00
reimar cd3d3369e1 Mark all stream_info_t as const
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25239 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-12-02 13:22:53 +00:00
diego 01d92a32ad cosmetics: typo fix UNSUPORTED --> UNSUPPORTED
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24277 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-08-28 22:38:45 +00:00
reimar bd77635966 Somewhat unified *BSD vcd reading
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23877 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-07-27 17:37:53 +00:00