Commit Graph

12 Commits

Author SHA1 Message Date
Dmitrij D. Czarkoff ea442fa047 mpv_talloc.h: rename from talloc.h
This change helps avoiding conflict with talloc.h from libtalloc.
2016-01-11 21:05:55 +01:00
wm4 fbf76da913 stream: remove stream filter concept
Unused since the previous commit. (Apparently it was a stupid idea.)
2015-02-27 19:51:14 +01:00
wm4 5de29b860b stream: get rid of remaining uses of the end_pos field
Most things stopped using this field for better support of growing
files. Go through the trouble to repalce the remaining uses, so it can
be removed.

Also move the "streaming" field; saves 4 bytes (wow!).
2015-02-06 21:43:52 +01:00
wm4 e082c2c3df Remove some unneeded NULL checks
Found by Coverity; also see commit 85fb2af3.
2014-11-21 09:58:09 +01:00
wm4 2e91d44e20 stream: redo playback abort handling
This mechanism originates from MPlayer's way of dealing with blocking
network, but it's still useful. On opening and closing, mpv waits for
network synchronously, and also some obscure commands and use-cases can
lead to such blocking. In these situations, the stream is asynchronously
forced to stop by "interrupting" it.

The old design interrupting I/O was a bit broken: polling with a
callback, instead of actively interrupting it. Change the direction of
this. There is no callback anymore, and the player calls
mp_cancel_trigger() to force the stream to return.

libavformat (via stream_lavf.c) has the old broken design, and fixing it
would require fixing libavformat, which won't happen so quickly. So we
have to keep that part. But everything above the stream layer is
prepared for a better design, and more sophisticated methods than
mp_cancel_test() could be easily introduced.

There's still one problem: commands are still run in the central
playback loop, which we assume can block on I/O in the worst case.
That's not a problem yet, because we simply mark some commands as being
able to stop playback of the current file ("quit" etc.), so input.c
could abort playback as soon as such a command is queued. But there are
also commands abort playback only conditionally, and the logic for that
is in the playback core and thus "unreachable". For example,
"playlist_next" aborts playback only if there's a next file. We don't
want it to always abort playback.

As a quite ugly hack, abort playback only if at least 2 abort commands
are queued - this pretty much happens only if the core is frozen and
doesn't react to input.
2014-09-13 16:09:51 +02:00
wm4 d68d4dd984 Revert "build: avoid defining _GNU_SOURCE"
This reverts commit 2e6a8f260c.

Too many problems for now, such as with OSX and asprintf().
2014-07-10 09:25:37 +02:00
wm4 2e6a8f260c build: avoid defining _GNU_SOURCE
_GNU_SOURCE defines the kitchen sink, and also prefers glibc definitions
where glibc and POSIX conflict. Even though POSIX is worth less than
toilet paper, we still prefer the POSIX definitions.

rar.c needs asprintf(), which is _GNU_SOURCE-only. So we define
_GNU_SOURCE too specifically for this file.
2014-07-09 22:10:33 +02:00
wm4 0335011f11 stream: mp_msg conversions
We also drop some slave mode stuff from stream_vcd.
2013-12-21 21:43:16 +01:00
wm4 0112143fda Split mpvcore/ into common/, misc/, bstr/ 2013-12-17 02:39:45 +01:00
wm4 73a5417950 Merge mp_talloc.h into ta/ta_talloc.h 2013-12-17 02:18:16 +01:00
wm4 dd344b43e8 Enable -Wshadow
This one really did bite me hard (see previous commit), so enable it by
default.

Fix some cases of shadowing throughout the codebase. None of these
change behavior, and all of these were correct code, and just tripped up
the warning.
2013-11-01 13:00:15 +01:00
wm4 3fc3bf70f9 stream: add uncompressed rar support
Apparently, it is popular to store large files in uncompressed rar
archives. Extracting files is not practical, and some media players
suport playing directly from uncompressed rar (at least VLC and some
DirectShow components).

Storing or accessing files this way is completely idiotic, but it is
a common practice, and the ones subjected to this practice can't do
much to change this (at least that's what I assume/hope). Also, it's
a feature request, so we say yes.

This code is mostly taken from VLC (commit f6e7240 from their git tree).
We also copy the way this is done: opening a rar file by itself yields
a playlist, which contains URLs to the actual entries in the rar file.
Compressed entries are simply skipped.
2013-08-26 10:09:46 +02:00