Commit Graph

100 Commits

Author SHA1 Message Date
Stefano Pigozzi 70e7d63ba0 core, timeline: cache external ordered chapter files too
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
2012-09-18 21:07:30 +02:00
Uoti Urpala 009d9d8706 Adjust ffmpeg/libav #includes to work with recent upstream changes
The <libavutil/avutil.h> stopped including <libavutil/common.h>
recursively in recent ffmpeg/libav git revisions. As a result, some
files no longer got needed definitions, causing a build failure.
Modify #include lines in various files to fix build with the latest
versions of ffmpeg/libav headers.
2012-08-21 18:22:00 +02:00
wm4 3a5d5f01d4 Remove support for LIVE555 RTSP streaming
The main excuse for removing this is that LIVE555 deprecated the API
the mplayer implementation was using. The old API still seems to be
somewhat supported, but must be explicitly enabled at LIVE555
compilation, so mplayer won't always work on any user installation.

The implementation was also very messy, in C++, and FFmpeg support is
available as alternative.

Remove it completely.
2012-08-20 15:36:03 +02:00
mplayer-svn 804bf91570 commands, dvd, dvdnav, bluray: cleanup sub/audio track language display
Code cleanup: Use a stream_control instead of global functions to
get the language associate with a audio or subtitle stream from
the streaming layer.

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

Support showing the stream language with br:// playback.

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

Fix DVDs showing the subtitle language as "unknown"
for a long time.

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

Author: reimar

Note: heavily modified by wm4 for this fork of mplayer.
2012-08-03 01:59:15 +02:00
mplayer-svn bbc9fccd46 cache2: allow cache sizes up to 4 TB
Remove variable that is only assigned but never used.

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

Allow using a cache size of up to 4 TB.
Obviously anything close to 4 GB will always fail
on 32 bit systems.

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

Replace off_t by int64_t in cache code.

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

Remove casts that are no longer necessary.

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

Fix header file after r34793.

Patch by Stephen Sheldon, sfsheldo gmail com.

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

Put #include <inttypes.h> into the header file where it should be.

Reported by Stephen Sheldon, sfsheldo gmail com.

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

Correct r34798.

The header only needs stdint.h while the C file needs inttypes.h.

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

Author: reimar
2012-08-03 01:52:40 +02:00
mplayer-svn e97d658bde cache2: flush cache and sync stream position/eof after seeking STREAM_CTRLs
This avoid some strange differences in behaviour between -cache and -nocache.

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

cache2: fix seeking with e.g. flv files

This is a regression that was introduced in r34461.

Found and bisected by Anssi Hannula [anssi.hannula iki fi].

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

cache2: print an error when streams behave in a way that the cache cannot handle

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

Author: reimar
2012-08-03 01:42:48 +02:00
mplayer-svn 01a207bef0 cache2: make cache process exit when main process dies
Make cache process detect when the main process disappeared and
make it exit on its own in that case.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34371 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: reimar
2012-08-03 01:35:39 +02:00
mplayer-svn 92dc567ed9 cache2: make warnings easier to understand
Mark two warnings that usually only indicate a performance issue as such.

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

Another attempt to make message easier to understand.

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

Author: reimar
2012-08-03 01:13:34 +02:00
wm4 7059c15f4a mplayer: rip out --capture support
While this was an interesting idea, it wasn't actually useful.
Basically it dumped the raw data (as requested by the demuxer) into a
file. The result is only useful if the file format was raw or maybe
some MPEG packet stream, but not with most modern file formats.
2012-08-02 23:22:52 +02:00
Uoti Urpala e2fc1f640f build: remove OS/2 support 2012-04-06 17:45:56 +03:00
wm4 24be34f1e9 cleanup: Silence compilation warnings on MinGW-w64
Some of the code, especially the dshow and windows codec loader parts,
are extremely hacky and likely full of bugs. The goal is merely getting
rid of warnings that could obscure more important warnings and actual
bugs, instead of fixing actual problems. This reduces the number of
warnings from over 500 to almost the same as when compiling on Linux.

Note that many problems stem from using the ancient wine-derived
windows headers. There are some differences to the "proper" windows
header. Changing the code to compile with the proper headers would be
too much trouble, and it still has to work on Unix.

Some of the changes might actually break compilation on legacy MinGW,
but we don't support that anymore. Always use MinGW-w64, even when
compiling to 32 bit.

Fixes some warnings in the win32 loader code on Linux too.
2012-03-01 00:22:30 +02:00
reimar 61fe3dcd6c cache: don't modify argument when stream control fails
When handling STREAM_CTRL calls for the cached stream, do not modify
the return parameter if the underlying stream returns an error for the
operation.

Avoids issues with some places that don't check the return
value of stream_control.

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

Remove condition that is now always true.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33803 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-07-06 13:01:08 +03:00
reimar cfe1af72af cache: allow STREAM_CTRL_GET_CURRENT_TIME with cache
Change code to allow STREAM_CTRL_GET_CURRENT_TIME with cache enabled.
Due to that time being from what is currently read into the cache it
is unfortunately somewhat inaccurate and unsmooth, however for streams
that do have stream timestamps it is till a lot better than going by
the demuxer alone.
In particular it fixes bug #1081, when starting a DVD with -chapter
following seeks would be relative to the start of the DVD instead
of the current position.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33605 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-07-06 13:01:07 +03:00
reimar 9f6ba7a63d cosmetics: cache2.c: Fix comment
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33600 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-07-06 13:01:07 +03:00
reimar 9149ec5d89 cache2.c: Avoid warnings about discarding volatile
In practice this should not really make a difference, but
the code is not significantly worse and it is more correct.

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

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33447 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-06-29 09:21:50 +03:00
reimar a37b71dc32 cache: call stream read with at least sector size space
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
2011-05-01 16:29:57 +03:00
reimar ba3dab4639 terminal output: show cache fill changes in "PAUSED" message
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
2011-02-15 18:35:34 +02:00
reimar 35ceaf8918 cache: suggest increasing cache size in the "not filling!" message
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
2011-01-31 16:03:10 +02:00
reimar 0792847d4a cache: read up to 64 KiB at once from stream_file
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
2010-11-14 12:24:11 +02:00
reimar f94717cdc4 cache, stream: avoid extra memcpy when using cache
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
2010-11-07 21:46:22 +02:00
reimar c6fb4e2aa2 cosmetics: cache2.c: Remove some irrelevant commented-out code
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32555 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-07 21:45:41 +02:00
Uoti Urpala 3cb3bbbddc Add a simple capture feature (-capture)
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
2010-11-02 07:48:31 +02:00
diego 01d8326435 cache: Remove unused cache_stats function
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32121 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:16:45 +02:00
reimar 837b6d245d cache: add sanity-check for sector size
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
2010-11-02 04:15:34 +02:00
reimar 848610a002 cache: Don't mess up current position if time-based seek fails
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
2010-11-02 04:15:01 +02:00
reimar 5544c07aab cache: Use sigaction() instead of signal()
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
2010-11-02 04:14:44 +02:00
reimar 93891d0880 cache: Respect -cache-seek-min also for on-disk files
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
2010-11-02 04:07:42 +02:00
Uoti Urpala 0e0d88ede9 Merge svn changes up to r31256 2010-05-30 16:39:41 +03:00
Uoti Urpala 688c66a5d5 Merge svn changes up to r31244 2010-05-30 16:29:14 +03:00
Uoti Urpala 8ce2c41ca5 Merge svn changes up to r31226 2010-05-30 16:25:04 +03:00
Uoti Urpala 2f1a518d45 Merge svn changes up to r31211
The merged cache2.c changes are known to have problems. Will merge
further fixes to them before merging this to the master branch.
2010-05-30 16:14:55 +03:00
Uoti Urpala 1888e57af7 cosmetics: "struct vf_instance* vf" -> "struct vf_instance *vf"
Change 'struct vf_instance' pointer arguments to more standard style
as in the subject. Also some other minor formatting fixes.

Patch by Diego Biurrun.
2010-05-29 17:20:44 +03:00
reimar a564c5a6cc Fix typo in message.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31256 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-05-28 20:59:53 +00:00
reimar 27d41fa5b3 100l, stream_check_for_interrupt argument is not in usec,
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
2010-05-28 18:47:03 +00:00
reimar 6f7c1ea409 Improve handling of cache process/thread hanging/being killed.
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
2010-05-28 17:26:31 +00:00
reimar 4448190ef0 Fix cache process accidentally being killed by SIGUSR1.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31250 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-05-28 16:57:16 +00:00
diego ae85fe1d2f Fix a bunch of typos in the stream cache code.
patch by Giorgio Vazzana, mywing81 gmail com


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31242 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-05-27 22:18:10 +00:00
reimar c36de0867f Retry reading even if we hit eof before.
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
2010-05-26 18:23:43 +00:00
reimar 328306708f Re-enable wakeup-on-signal for cache process.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31224 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-05-26 17:56:11 +00:00
reimar d304c1d56c Disable waking the cache process up via a signal, it
currently causes read errors due to not handling EINTR.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31223 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-05-26 17:27:38 +00:00
reimar 8e84b9288c Slightly reduce number of #ifs
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31204 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-05-23 22:26:10 +00:00
reimar bc2adc2e48 Use an extra define to simplify ifdefs
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31203 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-05-23 22:09:40 +00:00
reimar 991b9b9e6d Try reducing the #ifdef mess for the different cache variants.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31202 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-05-23 22:04:01 +00:00
reimar 939df8d5a8 Extract the cache main loop into a separate function.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31201 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-05-23 21:58:50 +00:00
reimar 2ced41082c Optimize cache behaviour for the many-consecutive-seeks case.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31199 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-05-23 21:53:48 +00:00
reimar cc7a2d3287 Add code to wake up cache process when e.g. a seek is needed.
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
2010-05-23 19:49:28 +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 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 5234c72e28 Restore collapsed whitespace in output messages
For some reason commit e306174952, 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.
2010-03-07 21:34:54 +02:00