Commit Graph

1310 Commits

Author SHA1 Message Date
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
wm4 35568f84f3 stream: remove unused new_ds_stream() 2013-05-03 21:08:35 +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 c6037982fd options: untangle track range parsing for stream_cdda
Remove the "object settings" based track range parsing (needed by
stream_cdda only), and make stream_cdda use CONF_TYPE_INT_PAIR.

This makes the -vf parsing code completely independent from other
options. A bit of that code was used by the mechanism removed with
this commit.
2013-04-21 03:48:30 +02:00
Stephen Hutchinson 33639d0156 stream_cddb: fix compilation on MinGW-w64
Like the VCD case, stream_cddb.c relies on ntddcdrm.h, which is no
longer under the ddk directory.
2013-04-06 00:00:21 +02:00
Stephen Hutchinson b224f37174 vcd_read_win32.h: fix compilation on MinGW-w64
ntddcdrm.h is no longer under the 'ddk' directory in MinGW-w64,
and since MPV focuses on it instead of the old MinGW32, there's no
reason to keep that dir prefix, as it stops VCD support from being
built at all for Windows.
2013-04-06 00:00:16 +02:00
reimar a98f658d53 http: handle broken QuickTime Streaming Server headers
Handle the severely broken headers QuickTime Streaming Server sends.

Instead of ending the header with \r\n\r\n it ends with
\r\n<4 byte MP3 header>\r\n.
And programs like wget just silently accept this without even
printing a warning!!

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

Note: see previous commit.
2013-04-04 14:08:07 +02:00
reimar dac7744888 http: fix for broken SHOUTcast streams
Support broken icy-metaint response from QuickTime Streaming Server.

The full version string is "QuickTime Streaming Server 6.1.0/532".
It sends a HTTP response header that contains an MP3 header!
Fixes bug #2133.

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

Note that in mpv, "http://" is mapped to ffmpeg currently, and this
code is unused by default.
2013-04-04 14:04:27 +02:00
reimar 3dedcdde60 vcd_read: cleanup ifdefs
Clean up ifdefs so they make sense even if none or multiple are defined.

Also choose Linux as fallback case instead of failing, this
allows the code to compile e.g. on Android.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35971 b3059339-0415-0410-9bf9-f77b7e298cf2
2013-04-04 14:03:22 +02:00
wm4 b242aa366b stream: silence clang empty statement warnings
clang printed warnings like:

stream/stream.c:692:65: warning: if statement has empty body [-Wempty-body]
            GET_UTF16(c, src < end - 1 ? get_le16_inc(&src) : 0,;

This macro expands to "if(cond) ;". Replace it with an empty statement
that doesn't lead to a clang warning.
2013-03-19 01:27:48 +01:00
wm4 f47ead1509 network: set default user-agent to MPlayer's
SHOUTcast bans "Mozilla" in the user-agent, Vimeo bans "Lavf" (part of
the libavformat normal user-agent). "MPlayer 1.1-..." seems to work
everywhere, and is close to the intented use (mpv is based on MPlayer,
after all).
2013-02-26 01:55:52 +01:00
wm4 4d016a92c8 core: redo how codecs are mapped, remove codecs.conf
Use codec names instead of FourCCs to identify codecs. Rewrite how
codecs are selected and initialized. Now each decoder exports a list
of decoders (and the codec it supports) via add_decoders(). The order
matters, and the first decoder for a given decoder is preferred over
the other decoders. E.g. all ad_mpg123 decoders are preferred over
ad_lavc, because it comes first in the mpcodecs_ad_drivers array.
Likewise, decoders within ad_lavc that are enumerated first by
libavcodec (using av_codec_next()) are preferred. (This is actually
critical to select h264 software decoding by default instead of vdpau.
libavcodec and ffmpeg/avconv use the same method to select decoders by
default, so we hope this is sane.)

The codec names follow libavcodec's codec names as defined by
AVCodecDescriptor.name (see libavcodec/codec_desc.c). Some decoders
have names different from the canonical codec name. The AVCodecDescriptor
API is relatively new, so we need a compatibility layer for older
libavcodec versions for codec names that are referenced internally,
and which are different from the decoder name. (Add a configure check
for that, because checking versions is getting way too messy.)

demux/codec_tags.c is generated from the former codecs.conf (minus
"special" decoders like vdpau, and excluding the mappings that are the
same as the mappings libavformat's exported RIFF tables). It contains
all the mappings from FourCCs to codec name. This is needed for
demux_mkv, demux_mpg, demux_avi and demux_asf. demux_lavf will set the
codec as determined by libavformat, while the other demuxers have to do
this on their own, using the mp_set_audio/video_codec_from_tag()
functions. Note that the sh_audio/video->format members don't uniquely
identify the codec anymore, and sh->codec takes over this role.

Replace the --ac/--vc/--afm/--vfm with new --vd/--ad options, which
provide cover the functionality of the removed switched.

Note: there's no CODECS_FLAG_FLIP flag anymore. This means some obscure
container/video combinations (e.g. the sample Film_200_zygo_pro.mov)
are played flipped. ffplay/avplay doesn't handle this properly either,
so we don't care and blame ffmeg/libav instead.
2013-02-10 17:25:56 +01:00
wm4 c1ddfb5907 Check return values of some mp_find_..._config_file function calls for NULL 2013-02-09 00:21:18 +01:00
wm4 37c5c114af Remove BSD legacy TV/radio support (BT848 stuff)
FreeBSD actually supports V4L2, and V4L2 supports this chip. Also,
this chip is from 1997. Farewell.
2013-02-06 23:03:39 +01:00
wm4 4a2e4b684a build: make it work on somewhat older ffmpeg versions
Tested with n0.10.4. All these version checks are rather tricky,
because Libav and FFmpeg change the same thing at slightly different
versions.
2013-01-31 17:42:21 +01:00
wm4 d4246353df stream: set default HTTP user agent to "Mozilla/5.0"
Playing vimeo links using quvi support didn't work, even though clive
could. clive is using quvi and curl to download videos from streaming
sites, so if clive works mpv should always work as well. It didn't, and
it turned out that it was due to the user agent. Change the default
from whatever Lavf sends to what clive and cclive use. This will
probably always work, as c(c)live are by the same author as libquvi,
and there's a high chance it has been tested with all the supported
sites.
2013-01-31 02:01:25 +01:00
wm4 8a7b8c3dd6 stream: fix reconnecting on broken network connections
This didn't work properly for HTTP with libavformat. The builtin HTTP
implementation reconnects automatically on its own, while libavformat
doesn't. Fix this by adding explicit reconnection support to
stream_lavf.c, which simply destroys and recreates the AVIO context.

It mostly works, though sometimes it mysteriously fails, spamming crap
all over the terminal and feeding broken data to the decoders. This is
probably due to itneractions with the cache. Also, reconnecting to
unseekable HTTP streams will make it read the entire stream until the
previous playback position is reached again.

It's not known whether this change makes behavior with "strange"
protocols like RTP better or worse.
2013-01-24 18:56:02 +01:00
wm4 47cec75291 stream: uncrustify stream.c/.h
The formatting almost made me break out in tears.
2013-01-24 17:45:13 +01:00
wm4 dd96c11d5e stream: implement some HTTP specific options for stream_lavf
The "http:" protocol has been switched to use ffmpeg's HTTP
implementation some time ago. One problem with this was that many HTTP
specific options stopped working, because they were obviously
implemented for the internal HTTP implementation only.

Add the missing things. Note that many options will work for ffmpeg
only, as Libav's HTTP implementation is missing these. They will
silently be ignored on Libav.

Some options we can't fix:
--ipv4-only-proxy, --prefer-ipv4, --prefer-ipv6
    As far as I can see, not even libavformat internals distinguish
    between ipv4 and ipv6.
--user, --passwd
    ffmpeg probably supports specifying these in the URL directly.
2013-01-24 17:45:13 +01:00
wm4 570271c776 cookies: fix crash
This was broken in 3f85094 (probably merge mistake). I guess nobody ever
uses this feature.
2013-01-24 14:32:35 +01:00
Uoti Urpala 458c41c5c7 stream_cdda: support latest libcdio version 2013-01-24 12:01:06 +01:00
wm4 07d14bd323 Silence two compiler warnings
Both should be harmless.
2013-01-16 02:03:21 +01:00
wm4 8751a0e261 video: decouple internal pixel formats from FourCCs
mplayer's video chain traditionally used FourCCs for pixel formats. For
example, it used IMGFMT_YV12 for 4:2:0 YUV, which was defined to the
string 'YV12' interpreted as unsigned int. Additionally, it used to
encode information into the numeric values of some formats. The RGB
formats had their bit depth and endian encoded into the least
significant byte. Extended planar formats (420P10 etc.) had chroma
shift, endian, and component bit depth encoded. (This has been removed
in recent commits.)

Replace the FourCC mess with a simple enum. Remove all the redundant
formats like YV12/I420/IYUV. Replace some image format names by
something more intuitive, most importantly IMGFMT_YV12 -> IMGFMT_420P.

Add img_fourcc.h, which contains the old IDs for code that actually uses
FourCCs. Change the way demuxers, that output raw video, identify the
video format: they set either MP_FOURCC_RAWVIDEO or MP_FOURCC_IMGFMT to
request the rawvideo decoder, and sh_video->imgfmt specifies the pixel
format. Like the previous hack, this is supposed to avoid the need for
a complete codecs.cfg entry per format, or other lookup tables. (Note
that the RGB raw video FourCCs mostly rely on ffmpeg's mappings for NUT
raw video, but this is still considered better than adding a raw video
decoder - even if trivial, it would be full of annoying lookup tables.)

The TV code has not been tested.

Some corrective changes regarding endian and other image format flags
creep in.
2013-01-13 20:04:11 +01:00
wm4 97032f1b58 Remove netstream support
This allowed to move the input stream layer across the network, allowing
the user to play anything that mplayer could play remotely. For example,
playing a DVD related on a remote server (say, with the host name
"remotehost1") could be done by starting the netstream server on that
remote server, and then running:

    mplayer mpst://remotehost1/dvd://

This would open the DVD on the remote host, and transfer the raw DVD
sector reads over network. It works the same for other protocols, and
all accesses to the stream layer are marshaled over network. It's
comparable to the way the cache layer (--cache) works.

It has questionable use and most likely was barely used at all. There's
lots of potential for breakage, because it doesn't translate the stream
CTRLs to network packets. Just get rid of it.

The server used to be in TOOLS/netstream.c, and was accidentally removed
earlier.
2013-01-13 17:32:39 +01:00
Rudolf Polzer 944be9d24b Fix lots of bugs in mp_http URL handling
Many instances of "http" were not changed to "mp_http", which made many
aspects of the mp_http protocol handler broken.
2013-01-10 14:11:26 +01:00
wm4 0db55cd86a stream_lavf: warn if protocol not found
If ffmpeg returns AVERROR_PROTOCOL_NOT_FOUND, print a warning that
ffmpeg should be compiled with network support. Note that stream_lavf.c
itself includes a whitelist of directly supported ffmpeg protocols, so
it can't happen that a completely unknown/madeup protocol triggers
this message. (Unless the ffmpeg:// or lavf:// prefixes are used.)
2012-12-28 14:23:29 +01: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
Stefano Pigozzi fab9febdc3 path: add mp_find_config_file and reorganize some of the code
Add `mp_find_config_file` to search different known paths and use that in
ass_mp to look for the fontconfig configuration file.

Some incidental changes spawned by this feature where:

 * Buffer allocation for the strings containing the paths is now performed
   with talloc. All of the allocations are done on a NULL context, but it still
   improves readability of the code.
 * Move the OSX function for lookup inside of a bundle: this code path was
   currently not used by the bundle generated with `make osxbundle`. The plan
   is to use it again in a future commit to get a fontconfig config file.
2012-12-15 17:38:00 +01:00
wm4 0fba387f72 Fix compilation with Libav
Doesn't define AVPROBE_SCORE_RETRY for some reason. They use
AVPROBE_SCORE_MAX/4 directly internally. AV_DISPOSITION_ATTACHED_PIC
is not defined with the most recent Libav release.

AVIOContext.av_class exists in Libav, but is apparently disabled in
old releases. Disable it for now until people stop torturing me with
old crap releases.
2012-12-11 15:26:02 +01:00
wm4 74ab902dea audio: remove support for native alaw/mulaw/adpcm output
This is considered a worthless feature. Note that alaw/mulaw/adpcm input
is unaffected: such data is handed to libavcodec and "decoded" to linear
PCM.
2012-12-11 00:37:54 +01:00
wm4 180944fe28 stream_lavf/demux_lavf: export/use HTTP MIME type
This is a fix for web radio streams that send raw AAC [1]. libavformat's
AAC demuxer probe is picky enough to request hundreds of KBs data, which
makes for a slow startup. To speed up stream startup, try use the HTTP
MIME type to identify the format. The webstream in question sends an AAC
specific MIME type, for which demux_lavf will force the AAC demuxer,
without probing anything.

ffmpeg/ffplay do the same thing. Note that as of ffmpeg commit 76d851b,
av_probe_input_buffer() does the mapping from MIME type to demuxer. The
actual mapping is not publicly accessible, and can only be used by
calling that function. This will hopefully be rectified, and ideally
ffmpeg would provide a function like find_demuxer_from_mime_type().

[1] http://lr2mp0.latvijasradio.lv:8000
2012-12-11 00:37:54 +01:00
wm4 eb787267c8 stream: handle mms streaming with ffmpeg
Use ffmpeg (stream_lavf) instead of internal mms support (asf_streaming.c)
for mms://, mmsh://, mmst:// URLs.

The old implementation is available under mp_mms:// etc.

There are some caveats with this:
- mms:// now always maps to mmsh://. It won't try mmst://. (I'm not sure
  if mms:// URLs really can use the mmst protocol, though.)
- MMS streams under the http:// prefix are not handled. (ffmpeg ticket
  #2001.) (Was already broken in mpv since c02f25.)
- It downloads all video streams now. MMS streams often have redundant
  video streams, which encode the main stream at different quality. The
  client is supposed to select one according to its bandwidth
  requirements. (Explicit MMS stream selection has been broken in mpv
  for a while, because MPOpts.vid maps to the stream number, not the
  demuxer's stream ID - but the old logic doesn't work anyway when
  using demuxer_lavf as opposed to demux_asf.)
2012-12-11 00:37:54 +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
al 1e9f37072b stream_ftp: cleanups
stream ftp: Pass full buffer size to snprintf

Previously the buffer size was always passed as one less than
the underlying buffer's size. This is not using the underlying
buffer to its full potential according to the C99 standard. The
last byte of the buffers were never used.

No vulnerabilities should have been caused by this mistake because
the strings stored in the buffers were zero terminated at all
times. Neither were out-of-array writes nor reads possible.

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

stream ftp: open_f: Mark parameter file_format unused

We have nothing to say about it, so we do not set *file_format.
No need for compilers to emit a warning about it.

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

stream ftp: Set type to STREAMTYPE_STREAM

Previously this was not set at all from within the stream_ftp module.
This caused the run-time warning message "Streams need a type!".

The actual behaviour should not be affected by this change.

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

stream ftp: Use C99 designated initializers

Simplify the initialization of the stream private struct's defaults.

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

stream ftp: Remove unneeded cast

At worst these kind of casts can hide real errors. As it is, it is
just not needed at all, thus remove it.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35492 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-12-03 21:08:52 +01:00
wm4 3486f59fe2 core: automatically pause on low cache
When the cache fill status goes below a certain threshold, automatically
pause the player. When the cache is filled again, unpause again.

This is intended to help with streaming from http. It's better to pause
a while, rather than exposing extremely crappy behavior when packet
reads during decoding block the entire player.

In theory, we should try to increase the cache if underruns happen too
often. Unfortunately, changing the cache implementation would be very
hard, because it's insane code (forks, uses shared memory and "volatile"
etc.). So for now, this just reduces the frequency of the stuttering if
the network is absolutely too slow to play the stream in realtime.
2012-12-03 21:08:52 +01:00
wm4 c02f252938 stream_lavf: use ffmpeg for http/https streaming
The internal mplayer http implementation is terrible and old. Try to use
ffmpeg instead. Enable ffmpeg https as well (we don't have native
support for it and never will).

Enable the cache for ffmpeg streams. In theory, we want to enable the
cache for network streams only (or at least, not enable it for files),
but there doesn't seem to be any way to query this. ffmpeg has its own
read-cache, but apparently it doesn't get filled asynchronously (only
to the degree internal socket/kernel buffers do).

Should it turn out that the mplayer implementation is better than
ffmpeg's in some way (unlikely), this commit might be reverted until
ffmpeg is ready. So far, the ffmpeg implementation seems to work very
well though.

The original mplayer stream implementation is made available under
"mp_http://" and "mp_http_proxy://". This is for testing, until the
http implementation is completely removed. Note that this is unlikely
to happen soon: ffmpeg doesn't support Microsoft streaming, while
mplayer has some support. This code has dependencies on http.

Note: "http_proxy://" doesn't work anymore. Use "httpproxy://" to get
the ffmpeg implementation of it.

Using https requires enabling OpenSSL in ffmpeg by adding
the --enable-openssl switch to ffmpeg's configure.
2012-12-03 21:08:52 +01:00
wm4 6294c78549 cache: simplify further
This commit is separate from the previous one to separate our own
changes from changes merged from mplayer2 (as far as that was possible).

Make it easier for stream implementations to request being cached. Set
a default cache size in stream.c, and remove them from various stream
implementations. Only MS streaming support sets a meaningful cache size.

Make querying cache size saner. This reduces the amount of #ifdefs
needed.
2012-12-03 21:08:51 +01:00
Uoti Urpala 2d58234c86 cache: refactor how cache enabling is done
Code enabling the cache by default for network streams did that by
modifying the value of the "cache" option. This wasn't sane, as
multiple streams may be created and all share the same options. Change
the code to not modify options but store data in the stream instance
instead.

Conflicts:
	core/mplayer.c
	demux/demux.c
	stream/cache2.c
	stream/network.c
	stream/network.h
	stream/pnm.c
	stream/stream.c
	stream/stream_rtp.c

Merged from mplayer2 commit e26070. Note that this doesn't solve any
actual bug, as the playlist crashing bug has been fixed before.

Since the global cache size option value is not overwritten anymore, the
option doesn't need to be restored on end of playback (M_OPT_LOCAL).
2012-12-03 21:08:51 +01:00
wm4 dd3260185a demux_lavf: add support for libavdevice
libavdevice supports various "special" video and audio inputs, such
as screen-capture or libavfilter filter graphs.

libavdevice inputs are implemented as demuxers. They don't use the
custom stream callbacks (in AVFormatContext.pb). Instead, input
parameters are passed as filename. This means the mpv stream layer has
to be disabled. Do this by adding the pseudo stream handler avdevice://,
whose only purpose is passing the filename to demux_lavf, without
actually doing anything.

Change the logic how the filename is passed to libavformat. Remove
handling of the filename from demux_open_lavf() and move it to
lavf_check_file(). (This also fixes a possible bug when skipping the
"lavf://" prefix.)

libavdevice now can be invoked by specifying demuxer and args as in:

    mpv avdevice://demuxer:args

The args are passed as filename to libavformat. When using libavdevice
demuxers, their actual meaning is highly implementation specific. They
don't refer to actual filenames.

Note:

libavdevice is disabled by default. There is one problem: libavdevice
pulls in libavfilter, which in turn causes symbol clashes with mpv
internals. The problem is that libavfilter includes a mplayer filter
bridge, which is used to interface with a set of nearly unmodified
mplayer filters copied into libavfilter. This filter bridge uses the
same symbol names as mplayer/mpv's filter chain, which results in symbol
clashes at link-time.

This can be prevented by building ffmpeg with --disable-filter=mp, but
unfortunately this is not the default.

This means linking to libavdevice (which in turn forces linking with
libavfilter by default) must be disabled. We try doing this by compiling
a test file that defines one of the clashing symbols (vf_mpi_clear).

To enable libavdevice input, ffmpeg should be built with the options:

    --disable-filter=mp

and mpv with:

    --enable-libavdevice

Originally, I tried to auto-detect it. But the resulting complications
in configure did't seem worth the trouble.
2012-12-03 21:08:51 +01:00
Stefano Pigozzi 6c1e21e223 stream_ftp: fix compilation with libav
Fixup commit for a04b35013a. That commit was
cherry-picked from mplayer(1) and thus assumes ffmpeg.
2012-11-22 00:05:53 +01:00
al a04b35013a stream_ftp: support longer filenames
This change was split into 8 patches. Squash them together, as they
affect stream_ftp.c only.

stream ftp: readline: Fix off-by-one error

Even if max bytes are available read at most max - 1 bytes.

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

Conflicts:
	stream/stream_ftp.c

stream ftp: readline: Always initialize output parameter buf

Only exception if passed parameter max is less than or equal
to zero. That cannot happen with the current code.

Additionally change readresp function to always copy the first
response line if the parameter rsp is non-NULL. This fixes some
error reporting that used uninitialized stack arrays.

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

stream ftp: readline: Always try to read complete lines

If there is not enough space in the provided line buffer just
skip the remaining bytes until reaching EOL.

Usually we are only interested in the first 5 characters and
for everything else the (on-stack) response buffer should still
be big enough.

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

stream ftp: Revise file descriptor usage

* Set unbound descriptor variables to -1
* Always test >= 0 to see if a variable refers to a valid descriptor

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

stream ftp: Only send QUIT command if connected

Do not attempt to send commands without control connections.

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

stream ftp: Create buffers before opening control connection

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

stream ftp: Allocate command buffer on-heap

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

stream ftp: Increase command buffer size

Allow for more longish file names (be it because of length or more
lengthy characters).

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35434 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-11-21 20:03:58 +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 efaa73cc73 stream, demux_lavf: minor cleanup for stream size code 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
reimar 51dac4e070 stream: change STREAM_CTRL_GET_SIZE argument type to uint64_t
Update endpos each time libavformat asks for it.

Fixes playback of still downloading files to not stop before we
really reached the end.

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

Conflicts:
	libmpdemux/demux_lavf.c

Change STREAM_CTRL_GET_SIZE argument type from off_t to
uint64_t.
Also fix the incorrect type of the uint64_res variable.

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

Conflicts:
	libmpdemux/demux_lavf.c
	libmpdemux/muxer_lavf.c

Note: also merges the "forgotten" cache support from r35107.
2012-11-20 18:00:14 +01:00
upsuper 7759e565b7 asf_streaming: remove broken MMSU support code
Comment out unused code

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

Removing mmsu-related code

MMSU was never supported by MPlayer, and the protocol has been
deprecated. Since the code is not in use at all, Removing it
should not break anything.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35420 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-11-20 18:00:14 +01:00
reimar 3f85094d4e Fix potential bugs and issues, general cleanups
Most of these are reimar fixing issues found by Coverity static
analyzer, and possibly some more cleanup commits independent from
this.

Since these commits are rather noisy, squash them all together.

Try to make code a bit clearer.

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

Conflicts:
	audio/out/ao_alsa.c

Check the correct variable for NULL.

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

Remove pointless unreachable code (the loop condition already checks
the 0xff case).

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

Fix typo that might have caused reading beyond the string end.

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

Do not needlessly use "long" types.

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

Use AV_RB32 to avoid sign extension issues and validate offset before using it.

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

Remove nonsense casts.

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

Fix crash in case sh_audio allocation failed.

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

Fix potential NULL dereference.

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

Conflicts:
	libmpcodecs/ad_ffmpeg.c

Note: Slightly modified.

Fix malloc failure check to check the correct variable.

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

Avoid code duplication and pointless casts.

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

Conflicts:
	stream/tv.c

Error out if an invalid channel list name was specified
instead of continuing and reading outside array bounds
all over the place.

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

Conflicts:
	stream/tv.c

Make array "static const".

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

Properly free resources even when encountering many
parse errors.

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

Conflicts:
	parser-cfg.c

Avoid leaks in error handling.

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

Do not do sign comparisons on "char" type which can be both signed or unsigned.

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

Free cookies file data after parsing it.

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

http_set_field only makes a copy of the string, so we still need to
free it.

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

check4proxies does not modify input URL, so mark it const.

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

Remove proxy "support" from stream_rtp and stream_upd, trying
to use a http proxy for UDP connections makes no sense.

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

Conflicts:
	stream/stream_rtp.c
	stream/stream_udp.c

Add url_new_with_proxy function to reduce code duplication and memleaks.

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

Conflicts:
	stream/pnm.c
	stream/stream_live555.c
	stream/stream_nemesi.c
	stream/stream_rtsp.c

Fix off-by-one errors in file descriptor validity checks.

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

Remove pointless cast.

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

Abort when opening the file failed instead of calling
"write" with an invalid descriptor.

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

Remove pointless local variable.

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

Conflicts:
	stream/http.c
2012-11-20 18:00:14 +01:00
wm4 b4b86e9286 cookies: don't read cookie files from ancient browsers
Remove the code that attempted to read cookie files from well-known
browser locations. This code was written for ancient browsers, and only
knew about Mozilla and Netscape. While it's possible that these browsers
are still alive and still use the same config locations and cookie file
formats, the only Mozilla-based browser that still matters is Firefox.
Firefox uses a sqlite database for cookies, located in a slightly
different config path.

Just remove this code.
2012-11-16 21:21:15 +01:00