summaryrefslogtreecommitdiffstats
path: root/stream/http.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix potential bugs and issues, general cleanupsreimar2012-11-201-29/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Rename directories, move files (step 2 of 2)wm42012-11-121-2/+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.)
* http: fix potential NULL pointer issuewm42012-11-011-10/+9
| | | | | | Found by clang analyzer. This called strlen(NULL), if the uri field in the http_hdr wasn't set. It seems all callers of this function set the field properly, so remove the bogus fallback to "/".
* http: fix potential NULL pointer issuewm42012-11-011-1/+4
| | | | Found by clang analyzer. Untested.
* stream: fix redirection for proxy URLsreimar2012-10-301-6/+4
| | | | | | | | | | | Fix redirection for proxy URLs. Should fix bug #2091. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35207 b3059339-0415-0410-9bf9-f77b7e298cf2 Conflicts: stream/url.c
* core, timeline: cache external ordered chapter files tooStefano Pigozzi2012-09-181-1/+0
| | | | | | | | | | | | | | | | | | | | | | | 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.
* stream/http: add a test file for ultravox in commentmplayer-svn2012-08-031-0/+3
| | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34431 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: reimar
* configure, build: require at least Libav 0.7Uoti Urpala2011-12-221-3/+0
| | | | | | | | | | | | | | | | Require versions of the Libav libraries corresponding to Libav release 0.7. These are: libavutil 51.7.0 libavcodec 53.5.0 libavformat 53.2.0 libswscale 2.0.0 libpostproc 52.0.0 Also disable the fallback to simple header check if these libraries could not be found with pkg-config; now compiling without pkg-config support for these always requires explicitly setting --enable-libav and any needed compiler/linker flags. The simple check would have let compilation proceed even if a version mismatch was detected.
* fix compilation with old FFmpeg versionsUoti Urpala2011-02-081-0/+5
| | | | | | | | | | | | af_lavcac3enc: use old SampleFormat names without AV_ prefix, the latter were only added in 2010-11 vd_ffmpeg: add ifdef around CODEC_ID_LAGARITH use demux_real: use ffmpeg_files/intreadwrite.h stream/http.c, stream/realrtsp/real.c: define AV_BASE64_SIZE macro for old libavutil versions lacking it
* stream/http: assume MakeMKV webservers always support rangesreimar2011-01-311-2/+6
| | | | | | | | | | | Add MakeMKV to list of webservers always supporting ranges even when they claim otherwise. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32785 b3059339-0415-0410-9bf9-f77b7e298cf2 Fix hack to check for MakeMKV server being inverted. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32807 b3059339-0415-0410-9bf9-f77b7e298cf2
* cleanup: Replace two malloc+memset with calloc.cboesch2011-01-291-2/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32723 b3059339-0415-0410-9bf9-f77b7e298cf2
* stream/http: support 307 (Temporary Redirect) responsescboesch2011-01-291-0/+2
| | | | | | Patch by chocolateboy (chocolateboy from cpan org) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32717 b3059339-0415-0410-9bf9-f77b7e298cf2
* stream/: delete base64_encode(), use libavutil av_base64_encode()cboesch2010-12-161-64/+7
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32672 b3059339-0415-0410-9bf9-f77b7e298cf2
* stream/network.c, stream/http.c: cleanupcboesch2010-12-161-4/+3
| | | | | | | | | | | | | | | | | | 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: Add Proxy-Authorization header to authenticate on proxiescboesch2010-12-161-4/+16
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32634 b3059339-0415-0410-9bf9-f77b7e298cf2
* cleanup: don't check for NULL before free()diego2010-11-081-10/+9
| | | | | | 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/http.c: Move mime_type_table extern declaration to network.hdiego2010-11-021-1/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32108 b3059339-0415-0410-9bf9-f77b7e298cf2
* printf format fixes ("%d" -> "%zd")diego2010-11-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Add 'z' length modifier to %d printf format specifier for size_t argument. stream/http.c:675: warning: format '%d' expects type 'int', but argument 4 has type 'size_t' git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31933 b3059339-0415-0410-9bf9-f77b7e298cf2 Add 'z' length modifier to %d printf format specifiers for size_t arguments. libmpdemux/demux_avi.c:553: warning: format '%u' expects type 'unsigned int', but argument 5 has type 'size_t' libmpdemux/demux_avi.c:553: warning: format '%u' expects type 'unsigned int', but argument 7 has type 'size_t' git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31935 b3059339-0415-0410-9bf9-f77b7e298cf2 Add 'z' length modifier to %d printf format specifiers for size_t arguments. libmpdemux/demux_lmlm4.c:75: warning: format '%d' expects type 'int', but argument 5 has type 'ssize_t' libmpdemux/demux_lmlm4.c:163: warning: format '%d' expects type 'int', but argument 6 has type 'ssize_t' libmpdemux/demux_lmlm4.c:163: warning: format '%d' expects type 'int', but argument 7 has type 'ssize_t' git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31937 b3059339-0415-0410-9bf9-f77b7e298cf2 Add 'z' length modifier to %d printf format specifier for size_t argument. stream/asf_streaming.c:676: warning: format '%d' expects type 'int', but argument 5 has type 'size_t' git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31938 b3059339-0415-0410-9bf9-f77b7e298cf2
* Merge svn changes up to r31004Uoti Urpala2010-04-261-1/+6
|\
| * Change type to uint8_t to avoid checks depending on char signedness.reimar2010-04-021-1/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30983 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Sanitize ICY metadata a bit before printing it.reimar2010-03-311-0/+5
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30980 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.
* Do not cast the results of malloc/calloc/realloc.diego2010-02-261-3/+3
| | | | | | | | These functions return void*, which is compatible with any pointer, so there is no need for casts. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30744 b3059339-0415-0410-9bf9-f77b7e298cf2
* Declare functions from network.c in network.h.diego2010-02-221-2/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30698 b3059339-0415-0410-9bf9-f77b7e298cf2
* 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
* Handle Content-Length also when Content-Type is not set.reimar2010-01-231-5/+6
| | | | | | | Based on patch by Yuriy Kaminskiy [yumkam mail ru] git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30399 b3059339-0415-0410-9bf9-f77b7e298cf2
* Use atoll to parse Content-Length to support http for files > 2GB.reimar2010-01-231-1/+1
| | | | | | | Patch by Yuriy Kaminskiy [yumkam mail ru]. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30398 b3059339-0415-0410-9bf9-f77b7e298cf2
* Make code slightly more readable.reimar2009-12-311-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30148 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix crash if http reply contains neither "Accept-Ranges" nor "Server" fields.reimar2009-12-311-1/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30147 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add a hack for broken youtube servers not returning Accept-Ranges.reimar2009-12-301-0/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30145 b3059339-0415-0410-9bf9-f77b7e298cf2
* Finally rename the STREAM_SEEK define to MP_STREAM_SEEK, there are just too manyreimar2009-11-221-1/+1
| | | | | | | 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
* whitespace cosmetics: Remove all trailing whitespace.diego2009-05-131-21/+21
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
* 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
* Get rid of pointless 'extern' keywords.diego2008-12-031-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28085 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add a noicyx:// protocol to allow easier testing for misconfigured servers.reimar2008-11-021-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27881 b3059339-0415-0410-9bf9-f77b7e298cf2
* Avoid a memleak if allocation of field_name fails, fixes bug #1319.reimar2008-10-311-0/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27868 b3059339-0415-0410-9bf9-f77b7e298cf2
* Move '#define closesocket close' preprocessor directive to a common placediego2008-09-011-1/+0
| | | | | | | 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
| | | | | | | network-related #include #ifdeffery. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27496 b3059339-0415-0410-9bf9-f77b7e298cf2
* Rename HAVE_WINSOCK preprocessor condition to HAVE_WINSOCK_H.diego2008-08-291-1/+1
| | | | | | | | | This is what it is called in FFmpeg and more consistent with other names for similar conditionals. This fixes a potential compilation failure on MinGW, as described in Bugzilla #1262. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27493 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fill stream->end_pos if possible, fixing lavf demuxers that need to seek.albeu2008-02-191-1/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26031 b3059339-0415-0410-9bf9-f77b7e298cf2
* Support icyx://.reimar2008-02-151-1/+1
| | | | | | | Patch by Sander Plas [sander oele net]. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26004 b3059339-0415-0410-9bf9-f77b7e298cf2
* Always display Icy-Metadata if available, whether we recognize an ICY-Serverreimar2008-02-151-1/+2
| | | | | | | or not. I can not think of a reason why this should hurt. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26003 b3059339-0415-0410-9bf9-f77b7e298cf2
* Move printing of Icy-Metadata into an extra functionreimar2008-02-151-14/+18
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26002 b3059339-0415-0410-9bf9-f77b7e298cf2
* Remove useless codereimar2008-02-151-6/+6
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26001 b3059339-0415-0410-9bf9-f77b7e298cf2
* Detect IceCast also by Icy-MetaInt header part in http_streaming_start(),reimar2008-02-151-1/+2
| | | | | | | as in fixup_open() git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26000 b3059339-0415-0410-9bf9-f77b7e298cf2
* mime_type_table is const as wellreimar2007-12-021-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25274 b3059339-0415-0410-9bf9-f77b7e298cf2
* Preserve unsv:// protocol specifier over http redirects.reimar2007-12-021-0/+5
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25266 b3059339-0415-0410-9bf9-f77b7e298cf2
* Mark all stream_info_t as constreimar2007-12-021-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25239 b3059339-0415-0410-9bf9-f77b7e298cf2
* Support stream redirection from http to mms, fix bug #927.ulion2007-11-261-2/+12
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25163 b3059339-0415-0410-9bf9-f77b7e298cf2
* cosmetics: typo fix UNSUPORTED --> UNSUPPORTEDdiego2007-08-281-4/+4
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24277 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix base64_encode() max output length checking.uau2007-01-281-4/+3
| | | | | | | Made HTTP auth fail if sum of username+password lengths was below 3. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22049 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix double free of *http_hdr at server error.iive2006-12-301-2/+2
| | | | | | | | | | | In http.c::http_streaming_start() *http_hdr is allocated then assigned to stream->streaming_ctrl->data if server returns error *http_hdr is freed before function returns. However the copy in ->data remains and is later freed (again) by network.c::streaming_ctrl_free(). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21792 b3059339-0415-0410-9bf9-f77b7e298cf2
* Make sure closesocket is called.reimar2006-12-101-0/+10
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21583 b3059339-0415-0410-9bf9-f77b7e298cf2
* STREAM_UNSUPPORTED is -1, so use the former for return value in all places.reimar2006-12-101-4/+2
| | | | | | | Thanks to Nicolas Baradakis (nbk sitadelle com) for noticing. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21582 b3059339-0415-0410-9bf9-f77b7e298cf2
* Make sure stream->fd is set correct (esp. to -1 on error when fd is closed)reimar2006-12-101-1/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21581 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fix misplaced http_freereimar2006-12-091-1/+1