summaryrefslogtreecommitdiffstats
path: root/stream/cache2.c
Commit message (Collapse)AuthorAgeFilesLines
* cache: call stream read with at least sector size spacereimar2011-05-011-2/+18
| | | | | | | | | | | | Ensure we always pass a buffer of at least sector size to the read function. This is never an issue with streams that have actual sectors, as the reads will always return a multiple of sector size and the cache is always used in blocks of sector size. However the rtp protocol misuses this so it can just assume it always has a sufficiently large buffer available and thus fails without this extra hack. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33120 b3059339-0415-0410-9bf9-f77b7e298cf2
* terminal output: show cache fill changes in "PAUSED" messagereimar2011-02-151-3/+8
| | | | | | | | | | | Convert cache_fill_status into a function so we always get the latest state, not whatever it was after the last read. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32818 b3059339-0415-0410-9bf9-f77b7e298cf2 Update PAUSED status line with cache fill status if it changed. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32819 b3059339-0415-0410-9bf9-f77b7e298cf2
* cache: suggest increasing cache size in the "not filling!" messagereimar2011-01-311-1/+1
| | | | | | | Change "cache not filling" warning to include a hint to increase the cache size. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32815 b3059339-0415-0410-9bf9-f77b7e298cf2
* cache: read up to 64 KiB at once from stream_filereimar2010-11-141-1/+5
| | | | | | | | | Make the file protocol read up to 64 KiB at once when the cache is used, assuming that files will generally be readable with high bandwidth. This should improve performance when playing e.g. from high-latency network shares. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32616 b3059339-0415-0410-9bf9-f77b7e298cf2
* cache, stream: avoid extra memcpy when using cachereimar2010-11-071-2/+2
| | | | | | | | | | Add a stream_read_internal() function that reads directly into a given buffer instead of the stream's internal one. Use this to read directly into cache memory, avoiding a memcpy(). This requires also adding a stream_seek_internal() as the normal seek function reads into the stream's buffer. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32559 b3059339-0415-0410-9bf9-f77b7e298cf2
* cosmetics: cache2.c: Remove some irrelevant commented-out codereimar2010-11-071-8/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32555 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add a simple capture feature (-capture)Uoti Urpala2010-11-021-0/+2
| | | | | | | | | | | | | | | | | If a specified key is pressed during playback, the current stream is captured to a file, similar to what -dumpstream achieves. original patch by Pásztor Szilárd, don tricon hu Taken from the following svn commits, but with several fixes and modifications (one obvious user-visible difference is that the default key binding is 'C', not 'c'): git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32524 b3059339-0415-0410-9bf9-f77b7e298cf2 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32529 b3059339-0415-0410-9bf9-f77b7e298cf2 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32530 b3059339-0415-0410-9bf9-f77b7e298cf2
* cache: Remove unused cache_stats functiondiego2010-11-021-10/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32121 b3059339-0415-0410-9bf9-f77b7e298cf2
* cache: add sanity-check for sector sizereimar2010-11-021-1/+7
| | | | | | | Add sanity-check for sector size to avoid strange crashes if it is too large. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31914 b3059339-0415-0410-9bf9-f77b7e298cf2
* cache: Don't mess up current position if time-based seek failsreimar2010-11-021-1/+2
| | | | | | | | Avoid STREAM_CTRL_SEEK_TO_TIME messing up the current position for stream types which do not support it. Fixes seeking in local flv files. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31907 b3059339-0415-0410-9bf9-f77b7e298cf2
* cache: Use sigaction() instead of signal()reimar2010-11-021-3/+6
| | | | | | | | | | | Signal() has an unavoidable race-condition on "broken by backwards-compatibility" systems like Solaris. (Upon receiving a signal, the handler is reset to SIG_DFL, thus a second signal will kill the process. The problem could also be reduced by re-installing the handler inside the handler, but there's still a race-condition and the risk of the handler being called inside the handler). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31738 b3059339-0415-0410-9bf9-f77b7e298cf2
* cache: Respect -cache-seek-min also for on-disk filesreimar2010-11-021-3/+5
| | | | | | | Should reduce issues with mp4/mov (playing those may involve a lot of seeking inside the file). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31371 b3059339-0415-0410-9bf9-f77b7e298cf2
* Merge svn changes up to r31256Uoti Urpala2010-05-301-4/+31
|\
| * Fix typo in message.reimar2010-05-281-1/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31256 b3059339-0415-0410-9bf9-f77b7e298cf2
| * 100l, stream_check_for_interrupt argument is not in usec,reimar2010-05-281-3/+3
| | | | | | | | | | | | | | so we would end up sleeping for 10s instead of 10ms. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31254 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Improve handling of cache process/thread hanging/being killed.reimar2010-05-281-3/+23
| | | | | | | | | | | | | | In particular allow a single STRG+C to quit MPlayer. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31251 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Fix cache process accidentally being killed by SIGUSR1.reimar2010-05-281-0/+7
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31250 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r31244Uoti Urpala2010-05-301-6/+6
|\|
| * Fix a bunch of typos in the stream cache code.diego2010-05-271-6/+6
| | | | | | | | | | | | | | patch by Giorgio Vazzana, mywing81 gmail com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31242 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r31226Uoti Urpala2010-05-301-3/+11
|\|
| * Retry reading even if we hit eof before.reimar2010-05-261-2/+2
| | | | | | | | | | | | | | This allows playing growing files even with a large cache. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31226 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Re-enable wakeup-on-signal for cache process.reimar2010-05-261-5/+10
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31224 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Disable waking the cache process up via a signal, itreimar2010-05-261-1/+4
| | | | | | | | | | | | | | currently causes read errors due to not handling EINTR. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31223 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r31211Uoti Urpala2010-05-301-45/+78
|\| | | | | | | | | The merged cache2.c changes are known to have problems. Will merge further fixes to them before merging this to the master branch.
| * Slightly reduce number of #ifsreimar2010-05-231-22/+20
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31204 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Use an extra define to simplify ifdefsreimar2010-05-231-14/+20
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31203 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Try reducing the #ifdef mess for the different cache variants.reimar2010-05-231-15/+13
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31202 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Extract the cache main loop into a separate function.reimar2010-05-231-14/+19
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31201 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Optimize cache behaviour for the many-consecutive-seeks case.reimar2010-05-231-1/+13
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31199 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Add code to wake up cache process when e.g. a seek is needed.reimar2010-05-231-0/+14
| | | | | | | | | | | | | | | | Dramatically reduces seeking times with lavf ogg demuxer. Needs a spearate implementation for the thread-based cache implementation. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31198 b3059339-0415-0410-9bf9-f77b7e298cf2
* | cosmetics: "struct vf_instance* vf" -> "struct vf_instance *vf"Uoti Urpala2010-05-291-3/+6
| | | | | | | | | | | | | | Change 'struct vf_instance' pointer arguments to more standard style as in the subject. Also some other minor formatting fixes. Patch by Diego Biurrun.
* | 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-11/+9
|\|
| * Threaded cache fixes: do not free the stream_t struct twice on windowsreimar2010-02-271-8/+6
| | | | | | | | | | | | | | | | and make sure the cache thread quits also for streams without a control function (e.g. http). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30773 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Restructure #ifs to be clearer, also ensures that we return from the threadreimar2010-02-271-3/+3
| | | | | | | | | | | | | | proc instead of calling exit() on __MINGW32__. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30754 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Remove declarations of functions now already declared in stream.hreimar2010-02-251-3/+0
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30733 b3059339-0415-0410-9bf9-f77b7e298cf2
| * stream: Mark functions not used outside of their files as static.diego2010-02-161-3/+6
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30599 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30475Uoti Urpala2010-03-091-0/+18
|\|
| * Add license header to all files missing it in the stream subdirectory.diego2010-01-301-0/+18
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30468 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Restore collapsed whitespace in output messagesUoti Urpala2010-03-071-1/+1
| | | | | | | | | | | | | | | | | | For some reason commit e306174952d42e1cd6cc5efc50ae6bb0410501bc, which replaced translation macro names with the corresponding English strings, also collapsed multiple consecutive space characters into one. Change most of these back. In a couple of cases the amount of whitespace is important for alignment, and for the rest it at least keeps the strings closer to the existing translations.
* | Merge svn changes up to r30419Uoti Urpala2010-01-251-7/+32
|\|
| * Always call cache_uninit to immediately free everything cache-related if wereimar2010-01-231-3/+10
| | | | | | | | | | | | | | fail to enable the cache. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30404 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Change code to allow playing a stream even if enabling the cache failedreimar2010-01-231-2/+5
| | | | | | | | | | | | | | while still handling it when the user aborts the cache fill. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30402 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Make cache_init static, it is not used outside this filereimar2010-01-231-1/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30401 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Add an exit() to silence a gcc warning and ensure forked code will neverreimar2010-01-231-0/+2
| | | | | | | | | | | | | | leave the cache-loop function. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30397 b3059339-0415-0410-9bf9-f77b7e298cf2
| * 100l, shouldn't write to memory after freeing it.reimar2010-01-231-1/+2
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30396 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Reindent.reimar2010-01-231-3/+3
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30395 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Zero freed pointers.reimar2010-01-231-0/+3
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30394 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Check for fork failing and make sure cache_uninit always frees the cache datareimar2010-01-231-1/+10
| | | | | | | | | | | | | | even if fork failed. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30393 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r29962Uoti Urpala2009-11-231-2/+1
|\|
| * Deobfuscate the special hack to disable cache for live555.reimar2009-11-171-2/+1
| | | | | | | | | | | | | | | | | | Cache can not be used for it, since it does not provide any data stream, the data is provided to the demuxer "behind MPlayer's back". git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29930 b3059339-0415-0410-9bf9-f77b7e298cf2
| * whitespace cosmetics: Remove all trailing whitespace.diego2009-05-131-23/+23
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Remove the internal GUIAnton Khirnov2009-07-071-4/+0
| | | | | | | | | | | | | | | | | | The GUI is badly designed and too closely coupled to the internal details of other code. The GUI code is in bad shape and unmaintained for years. There is no indication that anyone would maintain it in the future either. Even if someone did volunteer to implement a better integrated GUI having the current code in the tree probably wouldn't help much. So get rid of it.
* | Remove trailing whitespace from most filesUoti Urpala2009-07-071-23/+23
| |
* | Translation system changes part 2: replace macros by stringsAmar Takhar2009-07-071-1/+1
| | | | | | | | | | Replace all MSGTR_ macros in the source by the corresponding English string.
* | Translation system changes part 1: wrap translated stringsAmar Takhar2009-07-071-1/+1
| | | | | | | | | | Replace mp_msg() calls which have a translated string as the format argument with mp_tmsg and add _() around all other translated strings.
* | Merge svn changes up to r28065Uoti Urpala2008-12-021-4/+0
|\|
| * Move PTHREAD_CACHE define logic to configure.reimar2008-11-281-4/+0
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28048 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r27949Uoti Urpala2008-11-171-12/+32
|\| | | | | | | | | | | | | | | | | Conflicts: common.mak libvo/vo_xv.c libvo/x11_common.c libvo/x11_common.h stream/cache2.c
| * 100l, stream->cache_pid can not be used directly in pthread_create,reimar2008-11-151-1/+5
| | | | | | | | | | | | | | it has the wrong type. Luckily we currently do not need the value anyway. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27930 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Use pthreads for the cache on Cygwin, since _beginthread is not availablereimar2008-11-151-11/+27
| | | | | | | | | | | | | | | | and the previous CreateThread method would probably leak memory here, too. Also pthreads seems to be the official Cygwin threading API. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27928 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Include cache2.h in cache2.c, fixes an implicit declaration warning for ↵reimar2008-11-141-0/+1
| | | |