summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-04-29 20:03:24 +0200
committerJan Ekström <jeebjp@gmail.com>2018-05-03 01:08:44 +0300
commite02c9b9902f5bd356088cfbff3b9c333e50f1e47 (patch)
tree511c7b99c4288cab58d313f29caba78e4f8fdce1
parent0ab3184526e7b9b95c06a3ec7a6674283a5922d0 (diff)
downloadmpv-e02c9b9902f5bd356088cfbff3b9c333e50f1e47.tar.bz2
mpv-e02c9b9902f5bd356088cfbff3b9c333e50f1e47.tar.xz
build: make encoding mode non-optional
Makes it easier to not break the build by confusing the ifdeffery.
-rw-r--r--audio/out/ao.c2
-rw-r--r--options/options.c2
-rw-r--r--player/audio.c2
-rw-r--r--player/loadfile.c13
-rw-r--r--player/main.c6
-rw-r--r--player/osd.c5
-rw-r--r--player/playloop.c4
-rw-r--r--video/out/vo.c2
-rw-r--r--wscript4
-rw-r--r--wscript_build.py9
10 files changed, 9 insertions, 40 deletions
diff --git a/audio/out/ao.c b/audio/out/ao.c
index 8fd24c2439..b8337d5c16 100644
--- a/audio/out/ao.c
+++ b/audio/out/ao.c
@@ -93,9 +93,7 @@ static const struct ao_driver * const audio_out_drivers[] = {
&audio_out_coreaudio_exclusive,
#endif
&audio_out_pcm,
-#if HAVE_ENCODING
&audio_out_lavc,
-#endif
#if HAVE_RSOUND
&audio_out_rsound,
#endif
diff --git a/options/options.c b/options/options.c
index b09a4a2224..49aac52ba2 100644
--- a/options/options.c
+++ b/options/options.c
@@ -758,9 +758,7 @@ const m_option_t mp_opts[] = {
OPT_SUBSTRUCT("vaapi", vaapi_opts, vaapi_conf, 0),
#endif
-#if HAVE_ENCODING
OPT_SUBSTRUCT("", encode_opts, encode_config, 0),
-#endif
OPT_REMOVED("a52drc", "use --ad-lavc-ac3drc=level"),
OPT_REMOVED("afm", "use --ad=..."),
diff --git a/player/audio.c b/player/audio.c
index 9b1340ec96..28e7867ca1 100644
--- a/player/audio.c
+++ b/player/audio.c
@@ -555,9 +555,7 @@ static int write_to_ao(struct MPContext *mpctx, uint8_t **planes, int samples,
int format;
struct mp_chmap channels;
ao_get_format(ao, &samplerate, &format, &channels);
-#if HAVE_ENCODING
encode_lavc_set_audio_pts(mpctx->encode_lavc_ctx, playing_audio_pts(mpctx));
-#endif
if (samples == 0)
return 0;
double real_samplerate = samplerate / mpctx->audio_speed;
diff --git a/player/loadfile.c b/player/loadfile.c
index cf3c1eb013..65d693e264 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -1300,16 +1300,14 @@ reopen_file:
update_demuxer_properties(mpctx);
-#if HAVE_ENCODING
- if (mpctx->encode_lavc_ctx && mpctx->current_track[0][STREAM_VIDEO])
- encode_lavc_expect_stream(mpctx->encode_lavc_ctx, STREAM_VIDEO);
- if (mpctx->encode_lavc_ctx && mpctx->current_track[0][STREAM_AUDIO])
- encode_lavc_expect_stream(mpctx->encode_lavc_ctx, STREAM_AUDIO);
if (mpctx->encode_lavc_ctx) {
+ if (mpctx->current_track[0][STREAM_VIDEO])
+ encode_lavc_expect_stream(mpctx->encode_lavc_ctx, STREAM_VIDEO);
+ if (mpctx->current_track[0][STREAM_AUDIO])
+ encode_lavc_expect_stream(mpctx->encode_lavc_ctx, STREAM_AUDIO);
encode_lavc_set_metadata(mpctx->encode_lavc_ctx,
mpctx->demuxer->metadata);
}
-#endif
update_playback_speed(mpctx);
@@ -1557,7 +1555,6 @@ void mp_play_files(struct MPContext *mpctx)
cancel_open(mpctx);
-#if HAVE_ENCODING
if (mpctx->encode_lavc_ctx) {
// Make sure all streams get finished.
uninit_audio_out(mpctx);
@@ -1568,8 +1565,6 @@ void mp_play_files(struct MPContext *mpctx)
mpctx->encode_lavc_ctx = NULL;
}
-#endif
-
}
// Abort current playback and set the given entry to play next.
diff --git a/player/main.c b/player/main.c
index ef54a0ac4d..f56191a297 100644
--- a/player/main.c
+++ b/player/main.c
@@ -164,11 +164,9 @@ void mp_destroy(struct MPContext *mpctx)
uninit_audio_out(mpctx);
uninit_video_out(mpctx);
-#if HAVE_ENCODING
// If it's still set here, it's an error.
encode_lavc_free(mpctx->encode_lavc_ctx);
mpctx->encode_lavc_ctx = NULL;
-#endif
command_uninit(mpctx);
@@ -229,10 +227,8 @@ static bool handle_help_options(struct MPContext *mpctx)
property_print_help(mpctx);
return true;
}
-#if HAVE_ENCODING
if (encode_lavc_showhelp(log, opts->encode_opts))
return true;
-#endif
return false;
}
@@ -414,7 +410,6 @@ int mp_initialize(struct MPContext *mpctx, char **options)
cocoa_set_mpv_handle(ctx);
#endif
-#if HAVE_ENCODING
if (opts->encode_opts->file && opts->encode_opts->file[0]) {
mpctx->encode_lavc_ctx = encode_lavc_init(mpctx->global);
if(!mpctx->encode_lavc_ctx) {
@@ -424,7 +419,6 @@ int mp_initialize(struct MPContext *mpctx, char **options)
m_config_set_profile(mpctx->mconfig, "encoding", 0);
mp_input_enable_section(mpctx->input, "encode", MP_INPUT_EXCLUSIVE);
}
-#endif
#if !HAVE_LIBASS
MP_WARN(mpctx, "Compiled without libass.\n");
diff --git a/player/osd.c b/player/osd.c
index fd6b421849..52c9b83286 100644
--- a/player/osd.c
+++ b/player/osd.c
@@ -198,7 +198,6 @@ static char *get_term_status_msg(struct MPContext *mpctx)
saddf(&line, " ct:%7.3f", mpctx->total_avsync_change);
}
-#if HAVE_ENCODING
double position = get_current_pos_ratio(mpctx, true);
char lavcbuf[80];
if (encode_lavc_getstatus(mpctx->encode_lavc_ctx, lavcbuf, sizeof(lavcbuf),
@@ -206,9 +205,7 @@ static char *get_term_status_msg(struct MPContext *mpctx)
{
// encoding stats
saddf(&line, " %s", lavcbuf);
- } else
-#endif
- {
+ } else {
// VO stats
if (mpctx->vo_chain) {
if (mpctx->display_sync_active) {
diff --git a/player/playloop.c b/player/playloop.c
index a0945db845..a7771b8be3 100644
--- a/player/playloop.c
+++ b/player/playloop.c
@@ -227,9 +227,7 @@ void reset_playback_state(struct MPContext *mpctx)
mpctx->cache_buffer = 100;
mpctx->seek_slave = NULL;
-#if HAVE_ENCODING
encode_lavc_discontinuity(mpctx->encode_lavc_ctx);
-#endif
update_internal_pause_state(mpctx);
update_core_idle_state(mpctx);
@@ -1067,12 +1065,10 @@ static void handle_eof(struct MPContext *mpctx)
void run_playloop(struct MPContext *mpctx)
{
-#if HAVE_ENCODING
if (encode_lavc_didfail(mpctx->encode_lavc_ctx)) {
mpctx->stop_play = PT_QUIT;
return;
}
-#endif
update_demuxer_properties(mpctx);
diff --git a/video/out/vo.c b/video/out/vo.c
index acae4f2acb..9ecfd76a1f 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -101,9 +101,7 @@ const struct vo_driver *const video_out_drivers[] =
#if HAVE_DRM
&video_out_drm,
#endif
-#if HAVE_ENCODING
&video_out_lavc,
-#endif
NULL
};
diff --git a/wscript b/wscript
index 09cbabc3f3..8ad8d5ab20 100644
--- a/wscript
+++ b/wscript
@@ -342,10 +342,6 @@ iconv support use --disable-iconv.",
check_statement('zlib.h', 'inflate(0, Z_NO_FLUSH)')),
'req': True,
'fmsg': 'Unable to find development files for zlib.'
- } , {
- 'name' : '--encoding',
- 'desc' : 'Encoding',
- 'func': check_true,
}, {
'name': '--libbluray',
'desc': 'Bluray support',
diff --git a/wscript_build.py b/wscript_build.py
index c55758f213..dd90eafb84 100644
--- a/wscript_build.py
+++ b/wscript_build.py
@@ -241,7 +241,7 @@ def build(ctx):
( "audio/out/ao_coreaudio_utils.c", "audiounit" ),
( "audio/out/ao_coreaudio_utils.c", "coreaudio" ),
( "audio/out/ao_jack.c", "jack" ),
- ( "audio/out/ao_lavc.c", "encoding" ),
+ ( "audio/out/ao_lavc.c" ),
( "audio/out/ao_null.c" ),
( "audio/out/ao_openal.c", "openal" ),
( "audio/out/ao_opensles.c", "opensles" ),
@@ -262,7 +262,7 @@ def build(ctx):
( "common/av_log.c" ),
( "common/codecs.c" ),
( "common/common.c" ),
- ( "common/encode_lavc.c", "encoding" ),
+ ( "common/encode_lavc.c" ),
( "common/msg.c" ),
( "common/playlist.c" ),
( "common/recorder.c" ),
@@ -484,7 +484,7 @@ def build(ctx):
( "video/out/vo_drm.c", "drm" ),
( "video/out/vo_gpu.c" ),
( "video/out/vo_image.c" ),
- ( "video/out/vo_lavc.c", "encoding" ),
+ ( "video/out/vo_lavc.c" ),
( "video/out/vo_libmpv.c" ),
( "video/out/vo_mediacodec_embed.c", "android" ),
( "video/out/vo_null.c" ),
@@ -730,8 +730,7 @@ def build(ctx):
ctx.env.DATADIR + '/applications',
['etc/mpv.desktop'] )
- if ctx.dependency_satisfied('encoding'):
- ctx.install_files(ctx.env.CONFDIR, ['etc/encoding-profiles.conf'] )
+ ctx.install_files(ctx.env.CONFDIR, ['etc/encoding-profiles.conf'] )
for size in '16x16 32x32 64x64'.split():
ctx.install_as(