Commit Graph

36596 Commits

Author SHA1 Message Date
Stefano Pigozzi 8b6e05adff build: add install_files call after the mpv target was defined
This makes it work on cold compiles when there is no `build/` directory and
one does ./waf configure && ./waf install (i.e.: no ./waf build).
2013-11-24 22:23:45 +01:00
eng 9d603e9985 bootstrap.py: check version if waf already exists 2013-11-24 22:14:39 +01:00
Stefano Pigozzi 92779408d3 build: also install mpv CLI binary when building OS X bundle 2013-11-24 22:10:04 +01:00
Stefano Pigozzi cda0222064 gitignore: add generated files by old build system 2013-11-24 18:53:18 +01:00
wm4 dc87c5e452 bootstrap.py: skip download if waf already exists
It seems like a good idea not to generate any additional network traffic
and wait times if we don't have to.

Also print the URL it's downloading from.

Note that if we require a newer waf release, there will be a problem.
Running ./bootstrap.py won't get the newest waf version anymore in case
the old version is in the source dir. Not sure how to handle this.
2013-11-24 17:00:26 +01:00
Stefano Pigozzi efa7f8f376 build: make waf append pkgconfig flags as-is [2]
fixup commit... removes a redundant `return`
2013-11-24 16:01:38 +01:00
Stefano Pigozzi d8f1a57876 build: make waf append pkgconfig flags as-is
waf apparently only appends a pkgconfig flag if it doesn't already exist in
the lib storage. Since our configure often checks for multiple libraries in
one call we want to keep the flags as is. This is especially important to
always keep stuff like -lm in the right place.
2013-11-24 15:57:49 +01:00
Stefano Pigozzi 2231d5e398 travis: remove --disable-doc from libav/ffmpeg configure 2013-11-24 14:47:33 +01:00
wm4 ae709b5c03 player: close demuxer before stream
Demuxer might access stream even when closing. For now, this is not
a real problem (because it didn't actually happen), but it's cleaner.
2013-11-24 14:44:58 +01:00
wm4 4012c4a96e osd: remove mp_osd_res.video_par field
This is not needed anymore, because we decided that the PAR of the
decoded video matters, and not the PAR of the filtered video that
arrives at the VO.
2013-11-24 14:44:58 +01:00
wm4 e5311586ab Rename sub.c/.h to osd.c/.h
This was way too misleading. osd.c merely calls the subtitle renderers,
instead of actually dealing with subtitles.
2013-11-24 14:44:58 +01:00
wm4 df8d00cc1f vd_lavc: improve a comment 2013-11-24 14:44:58 +01:00
Stefano Pigozzi 38b7eede1e build: store dependencies as lists
In Python sets are unordered, so iterating them after converting to a list
always leads to different results. The code iterated on them to collect all
the flags to pass to the compiler, and since the order of the flags changed,
waf would rebuild all of the C files. Seems like in Python 2 this worked as
expected by pure chance.

This commit stores the sets as lists, and converts them to sets when the set
operations are needed.

Fixes #363
2013-11-24 14:31:14 +01:00
Stefano Pigozzi 806b410c6a build: cache compiler defines on the configure context directly 2013-11-24 14:10:35 +01:00
Stefano Pigozzi aaa1b6f683 travis: disable e-mail notifications 2013-11-23 22:31:44 +01:00
wm4 5a3e01fa80 vd_lavc: when falling back to software, revert filter error status
When mpv is started with some video filters set (--vf is used), and
hardware decoding is requested, and hardware decoding would be possible,
but is prevented due to video filters that accept software formats only,
the fallback didn't work properly sometimes.

This fallback works rather violently: it tries to initialize the filter
chain, and if it fails it throws away the frame decoded using the
hardware, and retries with software. The case that didn't work was when
decoding the current packet didn't immediately lead to a new frame. Then
the filter chain wouldn't be reinitialized, and the playloop would stop
playback as soon as it encounters the error flag.

Fix this by resetting the filter error flag (back to "uninitialized"),
which is a rather violent, but somewhat working solution.

The fallback in general should perhaps be cleaned up later.
2013-11-23 22:28:39 +01:00
wm4 f99aff1b31 Reduce stheader.h includes, move stream types to mp_common.h 2013-11-23 22:08:42 +01:00
wm4 36744a30fb Attempt to fix build on older libavcodec versions 2013-11-23 22:08:18 +01:00
wm4 e901bb7c99 audio: respect --end/--length with spdif passthrough
In theory, we can't really do this, because we don't know when a spdif
frame ends. Spdif transports compressed audio through audio setups that
were originally designed for PCM only (which includes the audio filter
chain, the AO API, most audio output APIs, etc.), and to reach this
goal, spdif pretends to be PCM. Compressed data frames are padded with
zeros, until a certain data rate is reached, which corresponds to a
pseudo-PCM format with 2 bytes per sample and 2 channels at 48000 Hz.
Of course an actual spdif frame is significantly larger than a frame
of the PCM format it pretends to be, so cutting audio data on frame
boundaries (as according to the pseudo-PCM format) merely yields an
incomplete and broken frame, not audio that plays for the desired
duration.

However, sending an incomplete frame might still be much better than the
current behavior, which simply ignores --end/--length (but still lets
the video end at the exact end time).

Should this result in trouble with real spdif receivers, this commit
probably has to be reverted.
2013-11-23 21:42:31 +01:00
wm4 f90e7ef7ea video: don't overwrite demuxer FPS value
If the --fps option was given (MPOpts->force_fps), the demuxer FPS value
was overwritten with the forced value. This was fine, since the demuxer
value wasn't needed anymore. But with the recent changes not to write to
the demuxer stream headers, we don't want to do this anymore. So
maintain the (forced/updated) FPS value in dec_video->fps.

The removed code in loadfile.c is probably redundant, and an artifact
from past refactorings.

Note that sub.c will now always use the demuxer FPS value, instead of
the user override value. I think this is fine, because it used the
demuxer's video size values too. (And it's rare that these values are
used at all.)
2013-11-23 21:41:40 +01:00
wm4 de68b8f23c video: move handling of container vs. stream AR out of vd_lavc.c
Now the actual decoder doesn't need to care about this anymore, and it's
handled in generic code instead. This simplifies vd_lavc.c, and in
particular we don't need to detect format changes in the old way
anymore.
2013-11-23 21:40:51 +01:00
wm4 215b3cedda ao_rsound: fix option types
These are option values, and the option code expects char*.

Not actually tested.
2013-11-23 21:40:33 +01:00
wm4 4c2fb8f3a2 dec_video: make vf_input and hwdec_info statically allocated
The only reason why these structs were dynamically allocated was to
avoid recursive includes in stheader.h, which is (or was) a very central
file included by almost all other files. (If a struct is referenced via
a pointer type only, it can be forward referenced, and the definition of
the struct is not needed.) Now that they're out of stheader.h, this
difference doesn't matter anymore, and the code can be simplified.

Also sneak in some sanity checks.
2013-11-23 21:39:07 +01:00
wm4 02f96efc50 dec_video: remove "initialized" field
It's redundant.
2013-11-23 21:38:39 +01:00
wm4 904c73d2d2 demux: remove gsh field from sh_audio/sh_video/sh_sub
This used to be needed to access the generic stream header from the
specific headers, which in turn was needed because the decoders had
access only to the specific headers. This is not the case anymore, so
this can finally be removed again.

Also move the "format" field from the specific headers to sh_stream.
2013-11-23 21:37:56 +01:00
wm4 639e672bd1 player: rearrange how subtitle context and stream headers are used
Use sh_stream over sh_sub. Use dec_sub (and mpctx->d_sub) instead of the
stream header. This aligns the subtitle code with the recent audio and
video refactoring.

sh_sub still has the decoder context, though. This is because we want to
avoid reinit when switching segments with ordered chapters. (Reinit is
fast, except for creating the ASS_Renderer, which in turn triggers
fontconfig.) Not sure how much this matters, though, because the initial
segment switch will lazily initialize the decoder anyway.
2013-11-23 21:37:15 +01:00
wm4 3486302514 video: move decoder context from sh_video into new struct
This is similar to the sh_audio commit.

This is mostly cosmetic in nature, except that it also adds automatical
freeing of the decoder driver's state struct (which was in
sh_video->context, now in dec_video->priv).

Also remove all the stheader.h fields that are not needed anymore.
2013-11-23 21:36:20 +01:00
wm4 057af4697c options: print lavfi filter list with --vf=lavfi=help 2013-11-23 21:35:52 +01:00
wm4 e99ae17a80 options: don't prefix sub-options with "--" in help output
Commit 0cb9227a added this to the option list help output, but it looks
strange with sub-options.
2013-11-23 21:35:03 +01:00
wm4 b5ed614839 options: implement --pphelp differently
Make it work via --vf=pp:help instead.
2013-11-23 21:34:24 +01:00
wm4 25855059af video: remove vf_pp auto-insertion
This drops the --pp option, which was probably broken for a while. The
option automatically inserted the "pp" filter. The value passed to it
was ignored (which is probably broken, it always selected maximal
quality).

Inserting this filter can be done simply with --vf=pp, so this is not
needed anymore.
2013-11-23 21:30:56 +01:00
wm4 8260590346 options: provide a way for --vf to print custom help
Useful in rather special situations. See following commits.
2013-11-23 21:29:05 +01:00
wm4 acfeb869a3 video: merge vd.c into dec_video.c
I don't feel like the separation ever made sense, and it was hard to
tell which file a function you were looking for was in.
2013-11-23 21:28:28 +01:00
wm4 4fa2babacc video: move struct mp_hwdec_info into its own header file
This means most code accessing this struct must now include hwdec.h
instead of dec_video.h. I just put it into dec_video.h at first because
I thought a separate file would be a waste, but it's more proper to do
it this way, as there are too many files which include dec_video.h only
to get the mp_hwdec_info definition.
2013-11-23 21:26:31 +01:00
wm4 9f4820f6ec audio: remove ad_driver.preinit
This never had any real use. Get rid of dec_audio.initialized too, as
it's redundant.
2013-11-23 21:26:04 +01:00
wm4 0e84dafdf0 player: remove printing of barely correct slave mode stream info
This was printed before something was decoded, and thus was not really
correct. Also, this code is hilariously broken:

        /* Assume FOURCC if all bytes >= 0x20 (' ') */
        if (sh_audio->format >= 0x20202020)
            mp_msg(MSGT_IDENTIFY, MSGL_INFO,
                   "ID_AUDIO_FORMAT=%.4s\n", (char *)&sh_audio->format);

Time to kill it.

This information can be accessed through properties instead.
2013-11-23 21:25:32 +01:00
wm4 e174d31fdd audio: don't write decoded audio format to sh_audio
sh_audio is supposed to contain file headers, not whatever was decoded.
Fix this, and write the decoded format to separate fields in the decoder
context, the dec_audio.decoded field. (Note that this field is really
only needed to communicate the audio format from decoder driver to the
generic code, so no other code accesses it.)
2013-11-23 21:25:05 +01:00
wm4 0f5ec05d8f audio: move decoder context from sh_audio into new struct
Move all state that basically changes during decoding or is needed in
order to manage decoding itself into a new struct (dec_audio).

sh_audio (defined in stheader.h) is supposed to be the audio stream
header. This should reflect the file headers for the stream. Putting the
decoder context there is strange design, to say the least.
2013-11-23 21:22:17 +01:00
Stefano Pigozzi 705a7310e6 build: remove unused mng fragment 2013-11-23 16:17:53 +01:00
Stefano Pigozzi 55ce26e454 build: also run the test binary during the lua checks 2013-11-23 16:17:53 +01:00
Stefano Pigozzi f315c93302 build: fix lua check to actually test for libquvi 2013-11-23 16:17:52 +01:00
Stefano Pigozzi 26f8887422 build: fix missing prototypes in lua check fragment 2013-11-23 16:17:52 +01:00
Stefano Pigozzi 22d8cdfe90 build: use static instead of prototype in libavfilter fragment 2013-11-23 16:17:52 +01:00
Stefano Pigozzi 3a0ce6acb9 build: fix libavfilter check to include function prototype
Apparently the check error'ed on some compilers for missing prototype and
simply adding one fixes it.
2013-11-23 14:55:55 +01:00
Stefano Pigozzi 60521783c3 build: fix install path for manual
Appending man1 to the MANDIR was forgotten, so the manual was installed in the
wrong path.
2013-11-23 11:35:16 +01:00
Stefano Pigozzi add439b06b README: mention build result being located at build/mpv 2013-11-23 11:14:22 +01:00
Stefano Pigozzi bc38a2736d build: make sure cwd is in Python's sys.path
Apparently some packaging systems (homebrew does this for example) change
`sys.path` before they run any Python script to ensure that only the correct
Python modules can be loadable.

We need to make sure cwd is in `sys.path` since we need to load
`wscript_build.py` from there.
2013-11-23 10:58:19 +01:00
Stefano Pigozzi 1748928e45 mp_ring: fix comment typo 2013-11-22 19:12:43 +01:00
Stefano Pigozzi a8976464ca build: remove abusive comment
The check seems to be working anyway, even without sys/video.h. So ./configure
was maybe wrong.
2013-11-22 19:12:43 +01:00
Stefano Pigozzi 7475f7d957 build: remove spam generated by link task
Simply override the cprogram Task's __str__ method with our own implementation.
This is way easier on the eyes when compiling mpv during development, since
warnings are not pushed outside of your average screenful of content.
2013-11-22 19:12:43 +01:00