summaryrefslogtreecommitdiffstats
path: root/stream/network.c
Commit message (Collapse)AuthorAgeFilesLines
* network: set default user-agent to MPlayer'swm42013-02-261-1/+1
| | | | | | | 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).
* stream: set default HTTP user agent to "Mozilla/5.0"wm42013-01-311-1/+1
| | | | | | | | | | | 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.
* Fix lots of bugs in mp_http URL handlingRudolf Polzer2013-01-101-4/+7
| | | | | Many instances of "http" were not changed to "mp_http", which made many aspects of the mp_http protocol handler broken.
* cache: refactor how cache enabling is doneUoti Urpala2012-12-031-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | 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).
* stream, demux: replace off_t with int64_twm42012-11-201-3/+3
| | | | | | On reasonable systems, these types were the same anyway. Even on unreasonable systems (seriously, which?), this may reduce potential breakage.
* Fix potential bugs and issues, general cleanupsreimar2012-11-201-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* network: fix crash with -playlist http://...wm42012-11-141-0/+2
| | | | | | | | | | | | The function fixup_network_stream_cache() accesses stream->opts, which is NULL in some cases when loading playlists. stream->opts is a pointer to the global MPOpts struct. For simplicity, this parameter is left NULL in some cases. Usually, this doesn't matter, because barely anything in stream/ uses MPOpts anyway. Hack-fix this for now by not accessing MPOpts and disabling the stream cache in this case. Calling open_stream() with options==NULL now basically means: do not use cache settings.
* Rename directories, move files (step 2 of 2)wm42012-11-121-5/+4
| | | | | | | | | | | | 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.)
* url: simplifycboesch2012-10-301-4/+1
| | | | | | | | | | | | | | | | | | | | Use mp_asprintf in make_noauth_url and make_http_proxy_url. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32971 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: cboesch Conflicts: stream/url.c Note: the mp_asprintf() function was introduced in r32970, and put into its own files. We just put that directly into url.c, as we use talloc_asprintf() in general, and mp_asprintf() is for url.c code only. (Making url.c use talloc would probably result in a big mess.) Make proxy and url parameter const in get_noauth_url and get_http_proxy_url. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32972 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: cboesch
* core, timeline: cache external ordered chapter files tooStefano Pigozzi2012-09-181-6/+6
| | | | | | | | | | | | | | | | | | | | | | | Previously, Matroska source files other than the initially opened one were always accessed without caching. Enable cache for extra files too. A separate cache process/thread is started for each file, which is less than optimal but probably better than no caching if the user explicitly enabled cache. This commit only implements caching for Matroska ordered chapters (not for EDL timeline). To build the timeline we need to demux the files in the current directory to look for segments with matching uuid. This first demux is done with no cache since we don't need to read a lot of the stream. If the file is recognized as one of the needed sources it's reopened with cache enabled. Also move the stream_cache_size global variable to the options struct. Conflicts: cfg-mplayer.h mplayer.c stream/stream.h timeline/tl_matroska.c
* libmpdemux: remove demux_real, demux_viv, demux_audiowm42012-08-201-1/+1
| | | | | | libavformat replaces demux_audio completely. I don't know/care what vivo (demux_viv) is. libavformat has a Real demuxer; it seems it works slightly better, with a different set of bugs.
* Remove some demuxers and decoderswm42012-07-301-21/+0
| | | | | | | | | | | | | | | | | | Most of these demuxers and decoders are provided in better form by libav, while the mplayer builtin ones are essentially unmaintained. The only legimitate use case for not using the libav ones was working around libav bugs or bugs related to the way mplayer uses libav. Instead of trying to keep dead code alive, development effort should go into improving libav or the mplayer libav glue code. Note that the libav demuxer have been preferred over the mplayer builtin ones for a while in mplayer2. There were some exceptions: playing DVDs with dvdnav or playing network sources. (That's because some stream modules and network.c requested explicit file formats, such as DEMUXER_TYPE_MPEG_PS, which mapped to builtin demuxers.) With this commit, they are switched to use libav. One caveat is that the requested format is not passed to libavformat, instead we rely on the auto probing to select the correct libav demuxer (see code in demux_open_stream()).
* configure, build: remove --disable-libav supportUoti Urpala2011-12-111-2/+0
| | | | | Remove support for building the player without libavcodec and libavformat. These libraries are now always required.
* stream/network: don't clobber buffer byte counts on errorreimar2011-07-061-0/+1
| | | | | | | Ensure we do not add strange values to amount of buffered bytes read on error. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33807 b3059339-0415-0410-9bf9-f77b7e298cf2
* stream/network: distinguish EOF/error in streaming control APIreimar2011-07-061-1/+2
| | | | | | Signal EOF vs. error also via streaming control API (not yet evaluated). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33806 b3059339-0415-0410-9bf9-f77b7e298cf2
* stream: http: Allow setting custom http headercehoyos2011-04-131-0/+7
| | | | | | Patch by Nikolay Nikolaev, nicknickolaev yahoo com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33082 b3059339-0415-0410-9bf9-f77b7e298cf2
* stream/http: Add support for login/password in http_proxy env variablecboesch2010-12-161-3/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32673 b3059339-0415-0410-9bf9-f77b7e298cf2
* stream/network.c, stream/http.c: cleanupcboesch2010-12-161-9/+1
| | | | | | | | | | | | | | | | | | Simplify mime_type_table loop git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32644 b3059339-0415-0410-9bf9-f77b7e298cf2 Remove dead define git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32645 b3059339-0415-0410-9bf9-f77b7e298cf2 Remove GCC warning hack not needed anymore git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32646 b3059339-0415-0410-9bf9-f77b7e298cf2 Use calloc instead of malloc+memset. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32647 b3059339-0415-0410-9bf9-f77b7e298cf2
* stream/http: Do not keep authentication in URL when proxiedcboesch2010-12-161-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32640 b3059339-0415-0410-9bf9-f77b7e298cf2
* stream/http: Add Proxy-Authorization header to authenticate on proxiescboesch2010-12-161-0/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32634 b3059339-0415-0410-9bf9-f77b7e298cf2
* stream/http: don't use proxy values for "Authorization" headercboesch2010-12-161-1/+1
| | | | | | | "Authorization" header is for the destination server URL, even through a proxy. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32633 b3059339-0415-0410-9bf9-f77b7e298cf2
* stream/network.c: Replace hardcoded str size with sizeofcboesch2010-11-141-5/+5
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32603 b3059339-0415-0410-9bf9-f77b7e298cf2
* cleanup: don't check for NULL before free()diego2010-11-081-11/+7
| | | | | | patch by Clément Bœsch, ubitux gmail com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32598 b3059339-0415-0410-9bf9-f77b7e298cf2
* stream_network: Fix possible crash for invalid http_proxy URLsreimar2010-11-021-0/+4
| | | | | | Check for URLs like just "http_proxy://". git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32508 b3059339-0415-0410-9bf9-f77b7e298cf2
* build: enable/disable all FFmpeg libraries togetherUoti Urpala2010-11-021-1/+1
| | | | | | | | | Enable all of libavcodec, libavformat, libswscale, and libpostproc together (libavutil is always required). based on svn commit by diego: git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32226 b3059339-0415-0410-9bf9-f77b7e298cf2
* Factorize MPlayer/MEncoder version string handling.diego2010-11-021-7/+3
| | | | | | | The string now resides in a central object file instead of being duplicated in every file that requires a version string. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31577 b3059339-0415-0410-9bf9-f77b7e298cf2
* stream: Use MSG_NOSIGNAL flag if available for send().reimar2010-11-021-1/+1
| | | | | | | | This avoids MPlayer quitting due to SIGPIPE at least for these cases. Ignoring SIGPIPE in general would break window-closing with some window-managers. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31566 b3059339-0415-0410-9bf9-f77b7e298cf2
* Merge svn changes up to r31291Uoti Urpala2010-06-021-0/+18
|\
| * Add a referrer option to set the HTTP Referer field.reimar2010-05-301-0/+18
| | | | | | | | | | | | | | Patch by chocolateboy [chocolate cpan org] git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31288 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30967Uoti Urpala2010-04-261-1/+4
|\|
| * Make http_read_response fail if parsing the response failed.reimar2010-03-231-1/+4
| | | | | | | | | | | | | | | | Avoids possible crashes since other code assumes http_hdr->protocol is a valid string if it succeeds. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30951 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Delete things related to old translation systemUoti Urpala2010-03-101-1/+0
| | | | | | | | | | Remove the help/ subdirectory, configure code to create toplevel help_mp.h, and all the '#include "help_mp.h"' lines from .c files.
* | Merge svn changes up to r30798Uoti Urpala2010-03-101-7/+0
|\|
| * Remove unused static function streaming_stop().cehoyos2010-02-271-6/+0
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30765 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30672Uoti Urpala2010-03-101-1/+4
|\|
| * Print response headers as debugging output also for HTTP seeks.reimar2010-02-201-0/+3
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30670 b3059339-0415-0410-9bf9-f77b7e298cf2
| * 10l, fix a close() that should be a closesocket()reimar2010-02-201-1/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30669 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30663Uoti Urpala2010-03-101-1/+5
|\| | | | | | | | | | | | | Conflicts: gui/cfg.c libmpcodecs/vd_dmo.c mplayer.c
| * Fix mov reference files: for video/quicktime mime do not force a demuxerreimar2010-02-201-1/+5
| | | | | | | | | | | | | | | | but do autodetection. This tries lavf first but will also try native demuxer for reference files where open fails for the lavf demuxer. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30663 b3059339-0415-0410-9bf9-f77b7e298cf2
| * stream: Mark functions not used outside of their files as static.diego2010-02-161-1/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30599 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30529Uoti Urpala2010-03-091-4/+5
|\|
| * Prefer libavformat over our own mov demuxer also for video/quicktimereimar2010-02-051-4/+5
| | | | | | | | | | | | | | mime-type. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30517 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30475Uoti Urpala2010-03-091-2/+18
|\|
| * Add license header to all files missing it in the stream subdirectory.diego2010-01-301-2/+18
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30468 b3059339-0415-0410-9bf9-f77b7e298cf2
| * whitespace cosmetics: Remove all trailing whitespace.diego2009-05-131-10/+10
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Remove trailing whitespace from most filesUoti Urpala2009-07-071-10/+10
| |
* | Translation system changes part 2: replace macros by stringsAmar Takhar2009-07-071-17/+23
| | | | | | | | | | Replace all MSGTR_ macros in the source by the corresponding English string.
* | Translation system changes part 1: wrap translated stringsAmar Takhar2009-07-071-17/+17
|/ | | | | Replace mp_msg() calls which have a translated string as the format argument with mp_tmsg and add _() around all other translated strings.
* Convert HAVE_WINSOCK2_H into a 0/1 definition.diego2009-02-011-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28437 b3059339-0415-0410-9bf9-f77b7e298cf2
* Forgotten reindentreimar2008-11-021-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27882 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add a noicyx:// protocol to allow easier testing for misconfigured servers.reimar2008-11-021-0/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27881 b3059339-0415-0410-9bf9-f77b7e298cf2
* Move '#define closesocket close' preprocessor directive to a common placediego2008-09-011-3/+1
| | | | | | | and put it under the proper '#ifndef HAVE_CLOSESOCKET' condition. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27505 b3059339-0415-0410-9bf9-f77b7e298cf2
* Revert moving closesocket definition and network headers to network.h.diego2008-08-311-0/+8
| | | | | | | This caused lots of trouble on MinGW, we need a different solution. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27504 b3059339-0415-0410-9bf9-f77b7e298cf2
* Move duplicated '#define closesocket close' into network.h along withdiego2008-08-291-8/+0