commit e3c1aaf6e4931b9b88cee54ca91b06499e425dac
Author: Nicolas Chauvet <kwizart(a)gmail.com>
Date: Thu Feb 22 12:32:30 2018 +0100
Rebased to mpv 0.23 from f25
.gitignore | 3 +-
mpv-config.patch | 29 +-
mpv-do-not-fail-with-minor-ffmpeg-updates.patch | 22 +
mpv-old-ffmpeg.patch | 837 ++++++++++++++++++++++++
mpv.spec | 310 +++++++--
sources | 2 +-
6 files changed, 1109 insertions(+), 94 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index d4f0c8a..1a2614f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
-v0.3.6.tar.gz
+/mpv-*.tar.gz
+/mpv-*.src.rpm
diff --git a/mpv-config.patch b/mpv-config.patch
index fe80751..a411259 100644
--- a/mpv-config.patch
+++ b/mpv-config.patch
@@ -1,29 +1,12 @@
-diff --git a/etc/example.conf b/etc/example.conf
-index 7084ab4..abcb4b8 100644
---- a/etc/example.conf
-+++ b/etc/example.conf
-@@ -1,7 +1,7 @@
+--- a/etc/mpv.conf
++++ b/etc/mpv.conf
+@@ -8,7 +8,7 @@
+ # no builtin or example mpv.conf with all the defaults.
#
- # mpv configuration file
#
-# Configuration files are read system-wide from /usr/local/etc/mpv.conf
+# Configuration files are read system-wide from /etc/mpv/mpv.conf
- # and per-user from ~/.mpv/config, where per-user settings override
+ # and per-user from ~/.config/mpv/mpv.conf, where per-user settings override
# system-wide settings, all of which are overridden by the command line.
#
-@@ -28,6 +28,7 @@
-
- # Specify default video driver (see --vo=help for a list).
- #vo=vdpau
-+vo=opengl
-
- # Start in fullscreen mode by default.
- #fs=yes
-@@ -51,6 +52,7 @@
-
- # Specify default audio driver (see --ao=help for a list).
- #ao=alsa
-+ao=pulse,alsa,
-
- # Disable softvol usage, and always use the system mixer if available.
- #softvol=no
+
diff --git a/mpv-do-not-fail-with-minor-ffmpeg-updates.patch
b/mpv-do-not-fail-with-minor-ffmpeg-updates.patch
new file mode 100644
index 0000000..e585828
--- /dev/null
+++ b/mpv-do-not-fail-with-minor-ffmpeg-updates.patch
@@ -0,0 +1,22 @@
+diff -Naur mpv-0.22.0.old/player/main.c mpv-0.22.0/player/main.c
+--- mpv-0.22.0.old/player/main.c 2016-11-29 15:03:06.751829770 +0100
++++ mpv-0.22.0/player/main.c 2016-11-29 15:04:40.258166553 +0100
+@@ -429,18 +429,6 @@
+
+ handle_deprecated_options(mpctx);
+
+- if (!print_libav_versions(mp_null_log, 0)) {
+- // Using mismatched libraries can be legitimate, but even then it's
+- // a bad idea. We don't acknowledge its usefulness and stability.
+- print_libav_versions(mpctx->log, MSGL_FATAL);
+- MP_FATAL(mpctx, "\nmpv was compiled against a different version of "
+- "FFmpeg/Libav than the shared\nlibrary it is linked against.
"
+- "This is most likely a broken build and could\nresult in "
+- "misbehavior and crashes.\n\nmpv does not support this "
+- "configuration and will not run - rebuild mpv instead.\n");
+- return -1;
+- }
+-
+ if (!mpctx->playlist->first && !opts->player_idle_mode)
+ return -3;
+
diff --git a/mpv-old-ffmpeg.patch b/mpv-old-ffmpeg.patch
new file mode 100644
index 0000000..e99d4cd
--- /dev/null
+++ b/mpv-old-ffmpeg.patch
@@ -0,0 +1,837 @@
+diff --git a/README.md b/README.md
+index d2b678c5c..41f0213ce 100644
+--- a/README.md
++++ b/README.md
+@@ -95,7 +95,7 @@ Essential dependencies (incomplete list):
+ - Audio output development headers (libasound/ALSA, pulseaudio)
+ - FFmpeg libraries (libavutil libavcodec libavformat libswscale libavfilter
+ and either libswresample or libavresample)
+- At least FFmpeg 3.2.2 or Libav 12 is required.
++ At least FFmpeg 2.4.0 or Libav 11 is required.
+ - zlib
+ - iconv (normally provided by the system libc)
+ - libass (OSD, OSC, text subtitles)
+diff --git a/TOOLS/travis-deps b/TOOLS/travis-deps
+index 1d97f446b..20825568b 100755
+--- a/TOOLS/travis-deps
++++ b/TOOLS/travis-deps
+@@ -89,7 +89,7 @@ class Libav < TravisDepsBuilder
+ {
+ "libav-stable" => {
+ :action => :stable,
+- :url => 'http://libav.org/releases/libav-12.tar.gz'
++ :url => 'http://libav.org/releases/libav-11.tar.gz'
+ },
+ "libav-git" => {
+ :action => :git,
+@@ -97,7 +97,7 @@ class Libav < TravisDepsBuilder
+ },
+ "ffmpeg-stable" => {
+ :action => :stable,
+- :url => 'http://www.ffmpeg.org/releases/ffmpeg-3.2.2.tar.gz'
++ :url => 'http://www.ffmpeg.org/releases/ffmpeg-2.4.tar.gz'
+ },
+ "ffmpeg-git" => {
+ :action => :git,
+diff --git a/audio/decode/ad_lavc.c b/audio/decode/ad_lavc.c
+index c4d3a2ae7..59cbc8aba 100644
+--- a/audio/decode/ad_lavc.c
++++ b/audio/decode/ad_lavc.c
+@@ -206,6 +206,7 @@ static int decode_packet(struct dec_audio *da, struct demux_packet
*mpkt,
+ if (priv->needs_reset)
+ control(da, ADCTRL_RESET, NULL);
+
++#if HAVE_AVCODEC_NEW_CODEC_API
+ int ret = avcodec_send_packet(avctx, &pkt);
+ if (ret >= 0 || ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) {
+ if (ret >= 0 && mpkt)
+@@ -218,6 +219,24 @@ static int decode_packet(struct dec_audio *da, struct demux_packet
*mpkt,
+ if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
+ ret = 0;
+ }
++#else
++ int ret = avcodec_decode_audio4(avctx, priv->avframe, &got_frame, &pkt);
++ if (mpkt) {
++ // At least "shorten" decodes sub-frames, instead of the whole
packet.
++ // At least "mpc8" can return 0 and wants the packet again next time.
++ if (ret >= 0) {
++ ret = FFMIN(ret, mpkt->len); // sanity check against decoder overreads
++ mpkt->buffer += ret;
++ mpkt->len -= ret;
++ mpkt->pts = MP_NOPTS_VALUE; // don't reset PTS next time
++ }
++ // LATM may need many packets to find mux info
++ if (ret == AVERROR(EAGAIN)) {
++ mpkt->len = 0;
++ return 0;
++ }
++ }
++#endif
+ if (ret < 0) {
+ MP_ERR(da, "Error decoding audio.\n");
+ return -1;
+@@ -225,7 +244,8 @@ static int decode_packet(struct dec_audio *da, struct demux_packet
*mpkt,
+ if (!got_frame)
+ return 0;
+
+- double out_pts = mp_pts_from_av(priv->avframe->pts,
&priv->codec_timebase);
++ double out_pts = mp_pts_from_av(MP_AVFRAME_DEC_PTS(priv->avframe),
++ &priv->codec_timebase);
+
+ struct mp_audio *mpframe = mp_audio_from_avframe(priv->avframe);
+ if (!mpframe)
+diff --git a/audio/decode/ad_spdif.c b/audio/decode/ad_spdif.c
+index 30c7883bf..7af61ed84 100644
+--- a/audio/decode/ad_spdif.c
++++ b/audio/decode/ad_spdif.c
+@@ -115,10 +115,16 @@ static int determine_codec_profile(struct dec_audio *da, AVPacket
*pkt)
+ goto done;
+ }
+
++#if HAVE_AVCODEC_NEW_CODEC_API
+ if (avcodec_send_packet(ctx, pkt) < 0)
+ goto done;
+ if (avcodec_receive_frame(ctx, frame) < 0)
+ goto done;
++#else
++ int got_frame = 0;
++ if (avcodec_decode_audio4(ctx, frame, &got_frame, pkt) < 1 || !got_frame)
++ goto done;
++#endif
+
+ profile = ctx->profile;
+
+@@ -171,7 +177,11 @@ static int init_filter(struct dec_audio *da, AVPacket *pkt)
+ if (!stream)
+ goto fail;
+
++#if HAVE_AVCODEC_HAS_CODECPAR
+ stream->codecpar->codec_id = spdif_ctx->codec_id;
++#else
++ stream->codec->codec_id = spdif_ctx->codec_id;
++#endif
+
+ AVDictionary *format_opts = NULL;
+
+diff --git a/audio/filter/af_lavcac3enc.c b/audio/filter/af_lavcac3enc.c
+index 9df5adb96..0a7c5d444 100644
+--- a/audio/filter/af_lavcac3enc.c
++++ b/audio/filter/af_lavcac3enc.c
+@@ -280,6 +280,7 @@ static int filter_out(struct af_instance *af)
+ AVPacket pkt = {0};
+ av_init_packet(&pkt);
+
++#if HAVE_AVCODEC_NEW_CODEC_API
+ // Send input as long as it wants.
+ while (1) {
+ err = read_input_frame(af, frame);
+@@ -309,6 +310,21 @@ static int filter_out(struct af_instance *af)
+ MP_FATAL(af, "Encode failed.\n");
+ goto done;
+ }
++#else
++ err = read_input_frame(af, frame);
++ if (err < 0)
++ goto done;
++ if (err == 0)
++ goto done;
++ err = -1;
++ int ok;
++ int lavc_ret = avcodec_encode_audio2(s->lavc_actx, &pkt, frame, &ok);
++ s->input->samples = 0;
++ if (lavc_ret < 0 || !ok) {
++ MP_FATAL(af, "Encode failed.\n");
++ goto done;
++ }
++#endif
+
+ MP_DBG(af, "avcodec_encode_audio got %d, pending %d.\n",
+ pkt.size, s->pending->samples + s->input->samples);
+diff --git a/audio/filter/af_lavrresample.c b/audio/filter/af_lavrresample.c
+index 828be6624..dc5d1a0d2 100644
+--- a/audio/filter/af_lavrresample.c
++++ b/audio/filter/af_lavrresample.c
+@@ -111,7 +111,12 @@ static double get_delay(struct af_resample *s)
+ }
+ static int get_out_samples(struct af_resample *s, int in_samples)
+ {
++#if LIBSWRESAMPLE_VERSION_MAJOR > 1 || LIBSWRESAMPLE_VERSION_MINOR >= 2
+ return swr_get_out_samples(s->avrctx, in_samples);
++#else
++ return av_rescale_rnd(in_samples, s->out_rate, s->in_rate, AV_ROUND_UP)
++ + swr_get_delay(s->avrctx, s->out_rate);
++#endif
+ }
+ #endif
+
+diff --git a/audio/out/ao_lavc.c b/audio/out/ao_lavc.c
+index 4dbc55a36..8ae131740 100644
+--- a/audio/out/ao_lavc.c
++++ b/audio/out/ao_lavc.c
+@@ -258,6 +258,7 @@ static void encode_audio_and_write(struct ao *ao, AVFrame *frame)
+ struct priv *ac = ao->priv;
+ AVPacket packet = {0};
+
++#if HAVE_AVCODEC_NEW_CODEC_API
+ int status = avcodec_send_frame(ac->codec, frame);
+ if (status < 0) {
+ MP_ERR(ao, "error encoding at %d %d/%d\n",
+@@ -296,6 +297,28 @@ static void encode_audio_and_write(struct ao *ao, AVFrame *frame)
+ write_packet(ao, &packet);
+ av_packet_unref(&packet);
+ }
++#else
++ av_init_packet(&packet);
++ int got_packet = 0;
++ int status = avcodec_encode_audio2(ac->codec, &packet, frame,
&got_packet);
++ if (status < 0) {
++ MP_ERR(ao, "error encoding at %d %d/%d\n",
++ frame ? (int) frame->pts : -1,
++ ac->codec->time_base.num,
++ ac->codec->time_base.den);
++ return;
++ }
++ if (!got_packet) {
++ return;
++ }
++ if (frame) {
++ if (ac->savepts == AV_NOPTS_VALUE)
++ ac->savepts = frame->pts;
++ }
++ encode_lavc_write_stats(ao->encode_lavc_ctx, ac->codec);
++ write_packet(ao, &packet);
++ av_packet_unref(&packet);
++#endif
+ }
+
+ // must get exactly ac->aframesize amount of data
+diff --git a/common/av_common.c b/common/av_common.c
+index f2f43498e..27a331927 100644
+--- a/common/av_common.c
++++ b/common/av_common.c
+@@ -77,8 +77,13 @@ void mp_copy_lav_codec_headers(AVCodecContext *avctx, AVCodecContext
*st)
+ // other demuxers must be handled manually.
+ void mp_set_lav_codec_headers(AVCodecContext *avctx, struct mp_codec_params *c)
+ {
++#if HAVE_AVCODEC_HAS_CODECPAR
+ if (c->lav_codecpar)
+ avcodec_parameters_to_context(avctx, c->lav_codecpar);
++#else
++ if (c->lav_headers)
++ mp_copy_lav_codec_headers(avctx, c->lav_headers);
++#endif
+ }
+
+ // Pick a "good" timebase, which will be used to convert double timestamps
+diff --git a/common/av_common.h b/common/av_common.h
+index 4b13dcdd0..b5ca034de 100644
+--- a/common/av_common.h
++++ b/common/av_common.h
+@@ -46,4 +46,13 @@ void mp_set_avdict(struct AVDictionary **dict, char **kv);
+ void mp_avdict_print_unset(struct mp_log *log, int msgl, struct AVDictionary *d);
+ int mp_set_avopts(struct mp_log *log, void *avobj, char **kv);
+
++#if (LIBAVCODEC_VERSION_MICRO >= 100 && \
++ LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 61, 100)) || \
++ (LIBAVCODEC_VERSION_MICRO < 100 && \
++ LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 24, 0))
++#define MP_AVFRAME_DEC_PTS(frame) ((frame)->pts)
++#else
++#define MP_AVFRAME_DEC_PTS(frame) ((frame)->pkt_pts)
++#endif
++
+ #endif
+diff --git a/common/av_log.c b/common/av_log.c
+index e2a4c3316..64ce26d85 100644
+--- a/common/av_log.c
++++ b/common/av_log.c
+@@ -218,7 +218,9 @@ bool print_libav_versions(struct mp_log *log, int v)
+ mp_msg(log, v, "\n");
+ }
+
++#if HAVE_AV_VERSION_INFO
+ mp_msg(log, v, "%s version: %s\n", LIB_PREFIX, av_version_info());
++#endif
+
+ return !mismatch;
+ }
+diff --git a/common/encode_lavc.c b/common/encode_lavc.c
+index 7e116e3b0..d0523857e 100644
+--- a/common/encode_lavc.c
++++ b/common/encode_lavc.c
+@@ -595,7 +595,12 @@ int encode_lavc_alloc_stream(struct encode_lavc_context *ctx,
+ }
+ return -1;
+ }
++#if HAVE_AVCODEC_HAS_CODECPAR
+ ctx->vcc = avcodec_alloc_context3(ctx->vc);
++#else
++ avcodec_get_context_defaults3(ctx->vst->codec, ctx->vc);
++ ctx->vcc = ctx->vst->codec;
++#endif
+
+ // Using codec->time_base is deprecated, but needed for older lavf.
+ ctx->vst->time_base = ctx->timebase;
+@@ -630,7 +635,12 @@ int encode_lavc_alloc_stream(struct encode_lavc_context *ctx,
+ }
+ return -1;
+ }
++#if HAVE_AVCODEC_HAS_CODECPAR
+ ctx->acc = avcodec_alloc_context3(ctx->ac);
++#else
++ avcodec_get_context_defaults3(ctx->ast->codec, ctx->ac);
++ ctx->acc = ctx->ast->codec;
++#endif
+
+ // Using codec->time_base is deprecated, but needed for older lavf.
+ ctx->ast->time_base = ctx->timebase;
+@@ -698,8 +708,10 @@ int encode_lavc_open_codec(struct encode_lavc_context *ctx,
+ }
+
+ ret = avcodec_open2(codec, ctx->vc, &ctx->voptions);
++#if HAVE_AVCODEC_HAS_CODECPAR
+ if (ret >= 0)
+ ret = avcodec_parameters_from_context(ctx->vst->codecpar, codec);
++#endif
+
+ // complain about all remaining options, then free the dict
+ for (de = NULL; (de = av_dict_get(ctx->voptions, "", de,
+@@ -735,8 +747,10 @@ int encode_lavc_open_codec(struct encode_lavc_context *ctx,
+ }
+
+ ret = avcodec_open2(codec, ctx->ac, &ctx->aoptions);
++#if HAVE_AVCODEC_HAS_CODECPAR
+ if (ret >= 0)
+ ret = avcodec_parameters_from_context(ctx->ast->codecpar, codec);
++#endif
+
+ // complain about all remaining options, then free the dict
+ for (de = NULL; (de = av_dict_get(ctx->aoptions, "", de,
+@@ -812,7 +826,11 @@ int encode_lavc_write_frame(struct encode_lavc_context *ctx,
AVStream *stream,
+ (int)packet->size);
+
+
++#if HAVE_AVCODEC_HAS_CODECPAR
+ switch (stream->codecpar->codec_type) {
++#else
++ switch (stream->codec->codec_type) {
++#endif
+ case AVMEDIA_TYPE_VIDEO:
+ ctx->vbytes += packet->size;
+ ++ctx->frames;
+diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c
+index 124956378..94bcd3fff 100644
+--- a/demux/demux_lavf.c
++++ b/demux/demux_lavf.c
+@@ -577,8 +577,13 @@ static void handle_new_stream(demuxer_t *demuxer, int i)
+ AVFormatContext *avfc = priv->avfc;
+ AVStream *st = avfc->streams[i];
+ struct sh_stream *sh = NULL;
++#if HAVE_AVCODEC_HAS_CODECPAR
+ AVCodecParameters *codec = st->codecpar;
+ int lavc_delay = codec->initial_padding;
++#else
++ AVCodecContext *codec = st->codec;
++ int lavc_delay = codec->delay;
++#endif
+
+ switch (codec->codec_type) {
+ case AVMEDIA_TYPE_AUDIO: {
+@@ -674,9 +679,17 @@ static void handle_new_stream(demuxer_t *demuxer, int i)
+ sh->ff_index = st->index;
+ sh->codec->codec = mp_codec_from_av_codec_id(codec->codec_id);
+ sh->codec->codec_tag = codec->codec_tag;
++#if HAVE_AVCODEC_HAS_CODECPAR
+ sh->codec->lav_codecpar = avcodec_parameters_alloc();
+ if (sh->codec->lav_codecpar)
+ avcodec_parameters_copy(sh->codec->lav_codecpar, codec);
++#else
++ sh->codec->codec = mp_codec_from_av_codec_id(codec->codec_id);
++ sh->codec->codec_tag = codec->codec_tag;
++ sh->codec->lav_headers = avcodec_alloc_context3(NULL);
++ if (sh->codec->lav_headers)
++ mp_copy_lav_codec_headers(sh->codec->lav_headers, codec);
++#endif
+ sh->codec->native_tb_num = st->time_base.num;
+ sh->codec->native_tb_den = st->time_base.den;
+
+@@ -851,9 +864,11 @@ static int demux_open_lavf(demuxer_t *demuxer, enum demux_check
check)
+ .opaque = demuxer,
+ };
+
++#if HAVE_AVFORMAT_IOOPEN
+ avfc->opaque = demuxer;
+ if (!demuxer->access_references)
+ avfc->io_open = block_io_open;
++#endif
+
+ mp_set_avdict(&dopts, lavfdopts->avopts);
+
+@@ -938,9 +953,14 @@ static int demux_lavf_fill_buffer(demuxer_t *demux)
+ if (pkt->dts != AV_NOPTS_VALUE)
+ dp->dts = pkt->dts * av_q2d(st->time_base);
+ dp->duration = pkt->duration * av_q2d(st->time_base);
++#if !HAVE_AV_AVPACKET_INT64_DURATION
++ if (pkt->convergence_duration > 0)
++ dp->duration = pkt->convergence_duration * av_q2d(st->time_base);
++#endif
+ dp->pos = pkt->pos;
+ dp->keyframe = pkt->flags & AV_PKT_FLAG_KEY;
+-#if LIBAVFORMAT_VERSION_MICRO >= 100
++#if LIBAVFORMAT_VERSION_MICRO >= 100 && \
++ LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(57, 50, 100)
+ if (pkt->flags & AV_PKT_FLAG_DISCARD)
+ MP_ERR(demux, "Edit lists are not correctly supported (FFmpeg
issue).\n");
+ #endif
+@@ -1121,8 +1141,12 @@ static void demux_close_lavf(demuxer_t *demuxer)
+ av_freep(&priv->pb->buffer);
+ av_freep(&priv->pb);
+ for (int n = 0; n < priv->num_streams; n++) {
+- if (priv->streams[n])
++ if (priv->streams[n]) {
++
avcodec_free_context(&priv->streams[n]->codec->lav_headers);
++#if HAVE_AVCODEC_HAS_CODECPAR
+
avcodec_parameters_free(&priv->streams[n]->codec->lav_codecpar);
++#endif
++ }
+ }
+ if (priv->own_stream)
+ free_stream(priv->stream);
+diff --git a/demux/stheader.h b/demux/stheader.h
+index 26c1246d6..240be72a4 100644
+--- a/demux/stheader.h
++++ b/demux/stheader.h
+@@ -71,6 +71,8 @@ struct mp_codec_params {
+ int extradata_size;
+
+ // Codec specific header data (set by demux_lavf.c only)
++ // Which one is in use depends on HAVE_AVCODEC_HAS_CODECPAR.
++ struct AVCodecContext *lav_headers;
+ struct AVCodecParameters *lav_codecpar;
+
+ // Timestamp granularity for converting double<->rational timestamps.
+diff --git a/player/command.c b/player/command.c
+index 74c7e2696..36850a2c5 100644
+--- a/player/command.c
++++ b/player/command.c
+@@ -3569,7 +3569,11 @@ static int mp_property_configuration(void *ctx, struct m_property
*prop,
+ static int mp_property_ffmpeg(void *ctx, struct m_property *prop,
+ int action, void *arg)
+ {
++#if HAVE_AV_VERSION_INFO
+ return m_property_strdup_ro(action, arg, av_version_info());
++#else
++ return M_PROPERTY_UNAVAILABLE;
++#endif
+ }
+
+ static int mp_property_alias(void *ctx, struct m_property *prop,
+diff --git a/sub/lavc_conv.c b/sub/lavc_conv.c
+index 3ff350c59..3e0165a84 100644
+--- a/sub/lavc_conv.c
++++ b/sub/lavc_conv.c
+@@ -210,6 +210,9 @@ static int parse_webvtt(AVPacket *in, AVPacket *pkt)
+
+ pkt->pts = in->pts;
+ pkt->duration = in->duration;
++#if !HAVE_AV_AVPACKET_INT64_DURATION
++ pkt->convergence_duration = in->convergence_duration;
++#endif
+ return 0;
+ }
+
+diff --git a/sub/sd_lavc.c b/sub/sd_lavc.c
+index 4ce8c5588..2c1b327b3 100644
+--- a/sub/sd_lavc.c
++++ b/sub/sd_lavc.c
+@@ -263,8 +263,13 @@ static void read_sub_bitmaps(struct sd *sd, struct sub *sub)
+ struct sub_bitmap *b = &sub->inbitmaps[i];
+ struct pos pos = priv->packer->result[i];
+ struct AVSubtitleRect *r = b->bitmap;
++#if HAVE_AV_SUBTITLE_NOPICT
+ uint8_t **data = r->data;
+ int *linesize = r->linesize;
++#else
++ uint8_t **data = r->pict.data;
++ int *linesize = r->pict.linesize;
++#endif
+ b->w = r->w;
+ b->h = r->h;
+ b->x = r->x;
+diff --git a/video/csputils.c b/video/csputils.c
+index 6835aeed2..8f6a9e351 100644
+--- a/video/csputils.c
++++ b/video/csputils.c
+@@ -190,8 +190,10 @@ enum mp_csp_trc avcol_trc_to_mp_csp_trc(int avtrc)
+ case AVCOL_TRC_LINEAR: return MP_CSP_TRC_LINEAR;
+ case AVCOL_TRC_GAMMA22: return MP_CSP_TRC_GAMMA22;
+ case AVCOL_TRC_GAMMA28: return MP_CSP_TRC_GAMMA28;
++#if HAVE_AVUTIL_HDR
+ case AVCOL_TRC_SMPTEST2084: return MP_CSP_TRC_SMPTE_ST2084;
+ case AVCOL_TRC_ARIB_STD_B67: return MP_CSP_TRC_ARIB_STD_B67;
++#endif
+ default: return MP_CSP_TRC_AUTO;
+ }
+ }
+@@ -240,8 +242,10 @@ int mp_csp_trc_to_avcol_trc(enum mp_csp_trc trc)
+ case MP_CSP_TRC_LINEAR: return AVCOL_TRC_LINEAR;
+ case MP_CSP_TRC_GAMMA22: return AVCOL_TRC_GAMMA22;
+ case MP_CSP_TRC_GAMMA28: return AVCOL_TRC_GAMMA28;
++#if HAVE_AVUTIL_HDR
+ case MP_CSP_TRC_SMPTE_ST2084: return AVCOL_TRC_SMPTEST2084;
+ case MP_CSP_TRC_ARIB_STD_B67: return AVCOL_TRC_ARIB_STD_B67;
++#endif
+ default: return AVCOL_TRC_UNSPECIFIED;
+ }
+ }
+diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
+index cc3bbc86c..ef5b30c57 100644
+--- a/video/decode/vd_lavc.c
++++ b/video/decode/vd_lavc.c
+@@ -662,9 +662,11 @@ static enum AVPixelFormat get_format_hwdec(struct AVCodecContext
*avctx,
+ MP_VERBOSE(vd, " %s", av_get_pix_fmt_name(fmt[i]));
+ MP_VERBOSE(vd, "\n");
+
++#if HAVE_AVCODEC_PROFILE_NAME
+ const char *profile = avcodec_profile_name(avctx->codec_id, avctx->profile);
+ MP_VERBOSE(vd, "Codec profile: %s (0x%x)\n", profile ? profile :
"unknown",
+ avctx->profile);
++#endif
+
+ assert(ctx->hwdec);
+
+@@ -791,6 +793,7 @@ static void decode(struct dec_video *vd, struct demux_packet
*packet,
+ reset_avctx(vd);
+
+ hwdec_lock(ctx);
++#if HAVE_AVCODEC_NEW_CODEC_API
+ ret = avcodec_send_packet(avctx, packet ? &pkt : NULL);
+ if (ret >= 0 || ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) {
+ if (ret >= 0)
+@@ -803,6 +806,10 @@ static void decode(struct dec_video *vd, struct demux_packet
*packet,
+ } else {
+ consumed = true;
+ }
++#else
++ ret = avcodec_decode_video2(avctx, ctx->pic, &got_picture, &pkt);
++ consumed = true;
++#endif
+ hwdec_unlock(ctx);
+
+ // Reset decoder if it was fully flushed. Caller might send more flush
+@@ -856,7 +863,7 @@ static void decode(struct dec_video *vd, struct demux_packet
*packet,
+ return;
+ }
+ assert(mpi->planes[0] || mpi->planes[3]);
+- mpi->pts = mp_pts_from_av(ctx->pic->pts, &ctx->codec_timebase);
++ mpi->pts = mp_pts_from_av(MP_AVFRAME_DEC_PTS(ctx->pic),
&ctx->codec_timebase);
+ mpi->dts = mp_pts_from_av(ctx->pic->pkt_dts, &ctx->codec_timebase);
+
+ #if LIBAVCODEC_VERSION_MICRO >= 100
+diff --git a/video/fmt-conversion.c b/video/fmt-conversion.c
+index 7a9e2088f..8b991c5d1 100644
+--- a/video/fmt-conversion.c
++++ b/video/fmt-conversion.c
+@@ -73,8 +73,10 @@ static const struct {
+
+ {IMGFMT_XYZ12, AV_PIX_FMT_XYZ12},
+
++#ifdef AV_PIX_FMT_RGBA64
+ {IMGFMT_RGBA64, AV_PIX_FMT_RGBA64},
+ {IMGFMT_BGRA64, AV_PIX_FMT_BGRA64},
++#endif
+
+ #if LIBAVUTIL_VERSION_MICRO >= 100
+ {IMGFMT_BGR0, AV_PIX_FMT_BGR0},
+@@ -88,7 +90,9 @@ static const struct {
+ {IMGFMT_0BGR, AV_PIX_FMT_ABGR},
+ #endif
+
++#ifdef AV_PIX_FMT_YA16
+ {IMGFMT_YA16, AV_PIX_FMT_YA16},
++#endif
+
+ {IMGFMT_VDPAU, AV_PIX_FMT_VDPAU},
+ #if HAVE_VIDEOTOOLBOX_HWACCEL
+@@ -99,11 +103,15 @@ static const struct {
+ #if HAVE_D3D_HWACCEL
+ {IMGFMT_D3D11VA, AV_PIX_FMT_D3D11VA_VLD},
+ #endif
++#if HAVE_AV_PIX_FMT_MMAL
+ {IMGFMT_MMAL, AV_PIX_FMT_MMAL},
++#endif
+ #if HAVE_CUDA_HWACCEL
+ {IMGFMT_CUDA, AV_PIX_FMT_CUDA},
+ #endif
++#ifdef AV_PIX_FMT_P010
+ {IMGFMT_P010, AV_PIX_FMT_P010},
++#endif
+ #ifdef AV_PIX_FMT_P016
+ {IMGFMT_P016, AV_PIX_FMT_P016},
+ #endif
+diff --git a/video/image_writer.c b/video/image_writer.c
+index 59d986f3f..8a5980c98 100644
+--- a/video/image_writer.c
++++ b/video/image_writer.c
+@@ -133,6 +133,7 @@ static bool write_lavc(struct image_writer_ctx *ctx, mp_image_t
*image, FILE *fp
+ pic->color_trc = mp_csp_trc_to_avcol_trc(image->params.color.gamma);
+ }
+
++#if HAVE_AVCODEC_NEW_CODEC_API
+ int ret = avcodec_send_frame(avctx, pic);
+ if (ret < 0)
+ goto error_exit;
+@@ -141,6 +142,11 @@ static bool write_lavc(struct image_writer_ctx *ctx, mp_image_t
*image, FILE *fp
+ if (ret < 0)
+ goto error_exit;
+ got_output = 1;
++#else
++ int ret = avcodec_encode_video2(avctx, &pkt, pic, &got_output);
++ if (ret < 0)
++ goto error_exit;
++#endif
+
+ fwrite(pkt.data, pkt.size, 1, fp);
+
+diff --git a/video/img_format.c b/video/img_format.c
+index 0232f5389..24545a850 100644
+--- a/video/img_format.c
++++ b/video/img_format.c
+@@ -161,14 +161,21 @@ struct mp_imgfmt_desc mp_imgfmt_get_desc(int mpfmt)
+ int shift = -1; // shift for all components, or -1 if not uniform
+ for (int c = 0; c < pd->nb_components; c++) {
+ AVComponentDescriptor d = pd->comp[c];
++#if HAVE_AV_NEW_PIXDESC
++ int depth = d.depth;
++ int step = d.step;
++#else
++ int depth = d.depth_minus1 + 1;
++ int step = d.step_minus1 + 1;
++#endif
+ // multiple components per plane -> Y is definitive, ignore chroma
+ if (!desc.bpp[d.plane])
+- desc.bpp[d.plane] = d.step * el_size;
+- planedepth[d.plane] += d.depth;
+- need_endian |= (d.depth + d.shift) > 8;
++ desc.bpp[d.plane] = step * el_size;
++ planedepth[d.plane] += depth;
++ need_endian |= (depth + d.shift) > 8;
+ if (c == 0)
+- desc.component_bits = d.depth;
+- if (d.depth != desc.component_bits)
++ desc.component_bits = depth;
++ if (depth != desc.component_bits)
+ desc.component_bits = 0;
+ if (c == 0)
+ shift = d.shift;
+diff --git a/video/mp_image.c b/video/mp_image.c
+index 2c4627c33..573390753 100644
+--- a/video/mp_image.c
++++ b/video/mp_image.c
+@@ -745,7 +745,9 @@ struct mp_image *mp_image_from_av_frame(struct AVFrame *av_frame)
+ mp_image_copy_fields_from_av_frame(&t, av_frame);
+ for (int p = 0; p < MP_MAX_PLANES; p++)
+ t.bufs[p] = av_frame->buf[p];
++#if HAVE_AVUTIL_HAS_HWCONTEXT
+ t.hwctx = av_frame->hw_frames_ctx;
++#endif
+ return mp_image_new_ref(&t);
+ }
+
+@@ -762,7 +764,9 @@ struct AVFrame *mp_image_to_av_frame(struct mp_image *img)
+ mp_image_copy_fields_to_av_frame(frame, new_ref);
+ for (int p = 0; p < MP_MAX_PLANES; p++)
+ frame->buf[p] = new_ref->bufs[p];
++#if HAVE_AVUTIL_HAS_HWCONTEXT
+ frame->hw_frames_ctx = new_ref->hwctx;
++#endif
+ *new_ref = (struct mp_image){0};
+ talloc_free(new_ref);
+ return frame;
+diff --git a/video/out/vo_lavc.c b/video/out/vo_lavc.c
+index 5c7406d4b..1721136f8 100644
+--- a/video/out/vo_lavc.c
++++ b/video/out/vo_lavc.c
+@@ -241,6 +241,7 @@ static void encode_video_and_write(struct vo *vo, AVFrame *frame)
+ struct priv *vc = vo->priv;
+ AVPacket packet = {0};
+
++#if HAVE_AVCODEC_NEW_CODEC_API
+ int status = avcodec_send_frame(vc->codec, frame);
+ if (status < 0) {
+ MP_ERR(vo, "error encoding at %d %d/%d\n",
+@@ -275,6 +276,24 @@ static void encode_video_and_write(struct vo *vo, AVFrame *frame)
+ write_packet(vo, &packet);
+ av_packet_unref(&packet);
+ }
++#else
++ av_init_packet(&packet);
++ int got_packet = 0;
++ int status = avcodec_encode_video2(vc->codec, &packet, frame,
&got_packet);
++ if (status < 0) {
++ MP_ERR(vo, "error encoding at %d %d/%d\n",
++ frame ? (int) frame->pts : -1,
++ vc->codec->time_base.num,
++ vc->codec->time_base.den);
++ return;
++ }
++ if (!got_packet) {
++ return;
++ }
++ encode_lavc_write_stats(vo->encode_lavc_ctx, vc->codec);
++ write_packet(vo, &packet);
++ av_packet_unref(&packet);
++#endif
+ }
+
+ static void draw_image_unlocked(struct vo *vo, mp_image_t *mpi)
+diff --git a/wscript b/wscript
+index 94db7e296..2175088d4 100644
+--- a/wscript
++++ b/wscript
+@@ -388,28 +388,13 @@ iconv support use --disable-iconv.",
+ }
+ ]
+
+-# Libav 12:
+-# libavutil 55.20.0
+-# libavcodec 57.25.0
+-# libavformat 57.7.2
+-# libswscale 4.0.0
+-# libavfilter 6.7.0
+-# libavresample 3.0.0
+-# FFmpeg 3.2.2:
+-# libavutil 55.34.100
+-# libavcodec 57.64.101
+-# libavformat 57.56.100
+-# libswscale 4.2.100
+-# libavfilter 6.65.100
+-# libswresample 2.3.100
+-
+ libav_pkg_config_checks = [
+- 'libavutil', '>= 55.20.0',
+- 'libavcodec', '>= 57.25.0',
+- 'libavformat', '>= 57.07.0',
+- 'libswscale', '>= 4.0.0'
++ 'libavutil', '>= 54.02.0',
++ 'libavcodec', '>= 56.1.0',
++ 'libavformat', '>= 56.01.0',
++ 'libswscale', '>= 2.1.3'
+ ]
+-libav_versions_string = "FFmpeg 3.2.2 or Libav 12"
++libav_versions_string = "FFmpeg 2.4 or Libav 11"
+
+ libav_dependencies = [
+ {
+@@ -422,11 +407,11 @@ FFmpeg/Libav libraries. You need at least {0}.
Aborting.".format(libav_versions_
+ }, {
+ 'name': '--libswresample',
+ 'desc': 'libswresample',
+- 'func': check_pkg_config('libswresample', '>=
2.3.100'),
++ 'func': check_pkg_config('libswresample', '>=
1.1.100'),
+ }, {
+ 'name': '--libavresample',
+ 'desc': 'libavresample',
+- 'func': check_pkg_config('libavresample', '>=
3.0.0'),
++ 'func': check_pkg_config('libavresample', '>=
2.1.0'),
+ 'deps_neg': ['libswresample'],
+ }, {
+ 'name': 'resampler',
+@@ -438,13 +423,13 @@ FFmpeg/Libav libraries. You need at least {0}.
Aborting.".format(libav_versions_
+ }, {
+ 'name': 'libavfilter',
+ 'desc': 'libavfilter',
+- 'func': check_pkg_config('libavfilter', '>= 6.7.0'),
++ 'func': check_pkg_config('libavfilter', '>= 5.0.0'),
+ 'req': True,
+ 'fmsg': 'libavfilter is a required dependency.',
+ }, {
+ 'name': '--libavdevice',
+ 'desc': 'libavdevice',
+- 'func': check_pkg_config('libavdevice', '>=
57.0.0'),
++ 'func': check_pkg_config('libavdevice', '>=
55.0.0'),
+ }, {
+ 'name': 'avcodec-chroma-pos-api',
+ 'desc': 'libavcodec avcodec_enum_to_chroma_pos API',
+@@ -463,13 +448,80 @@ FFmpeg/Libav libraries. You need at least {0}.
Aborting.".format(libav_versions_
+ 'func': check_statement('libavutil/frame.h',
+ 'enum AVFrameSideDataType type =
AV_FRAME_DATA_SKIP_SAMPLES',
+ use='libav')
++ }, {
++ 'name': 'av-pix-fmt-mmal',
++ 'desc': 'libavutil AV_PIX_FMT_MMAL',
++ 'func': check_statement('libavutil/pixfmt.h',
++ 'int x = AV_PIX_FMT_MMAL',
++ use='libav'),
++ }, {
++ 'name': 'av-version-info',
++ 'desc': 'libavtuil av_version_info()',
++ 'func': check_statement('libavutil/avutil.h',
++ 'const char *x = av_version_info()',
++ use='libav'),
++ }, {
++ 'name': 'av-new-pixdesc',
++ 'desc': 'libavutil new pixdesc fields',
++ 'func': check_statement('libavutil/pixdesc.h',
++ 'AVComponentDescriptor d; int x = d.depth',
++ use='libav'),
++ }, {
++ 'name': 'av-avpacket-int64-duration',
++ 'desc': 'libavcodec 64 bit AVPacket.duration',
++ 'func': check_statement('libavcodec/avcodec.h',
++ 'int x[(int)sizeof(((AVPacket){0}).duration) -
7]',
++ use='libav'),
++ }, {
++ 'name': 'av-subtitle-nopict',
++ 'desc': 'libavcodec AVSubtitleRect AVPicture removal',
++ 'func': check_statement('libavcodec/avcodec.h',
++ 'AVSubtitleRect r = {.linesize={0}}',
++ use='libav'),
++ }, {
++ 'name': 'avcodec-profile-name',
++ 'desc': 'libavcodec avcodec_profile_name()',
++ 'func': check_statement('libavcodec/avcodec.h',
++ 'avcodec_profile_name(0,0)',
++ use='libav'),
++ }, {
++ 'name': 'avcodec-new-codec-api',
++ 'desc': 'libavcodec decode/encode API',
++ 'func': check_statement('libavcodec/avcodec.h',
++ 'avcodec_send_packet(0,0)',
++ use='libav'),
++ }, {
++ 'name': 'avcodec-has-codecpar',
++ 'desc': 'libavcodec AVCodecParameters API',
++ 'func': check_statement('libavformat/avformat.h',
++ '(void)offsetof(AVStream, codecpar)',
++ use='libav'),
++ }, {
++ 'name': 'avutil-has-hwcontext',
++ 'desc': 'libavutil AVHWFramesContext API',
++ 'func': check_statement('libavutil/frame.h',
++ '(void)offsetof(AVFrame, hw_frames_ctx)',
++ use='libav'),
++ }, {
++ 'name': 'avutil-hdr',
++ 'desc': 'libavutil HDR TRCs',
++ 'func': check_statement('libavutil/pixfmt.h',
++ 'AVCOL_TRC_SMPTEST2084,'
++ 'AVCOL_TRC_ARIB_STD_B67',
++ use='libav'),
+ }, {
+ 'name': 'avutil-mastering-metadata',
+ 'desc': 'libavutil mastering display metadata struct',
+ 'func': check_statement('libavutil/frame.h',
+ 'AV_FRAME_DATA_MASTERING_DISPLAY_METADATA',
+ use='libav'),
+- },
++ }, {
++ 'name': 'avformat-ioopen',
++ 'desc': 'libavformat io_open callback',
++ 'func': check_statement('libavformat/avformat.h',
++ 'offsetof(AVFormatContext, io_open)',
++ use='libav'),
++ }
+ ]
+
+ audio_output_features = [
diff --git a/mpv.spec b/mpv.spec
index 264a02a..224b0b7 100644
--- a/mpv.spec
+++ b/mpv.spec
@@ -1,46 +1,73 @@
Name: mpv
-Version: 0.3.11
-Release: 1%{?dist}
+Version: 0.23.0
+Release: 2%{?dist}
Summary: Movie player playing most video formats and DVDs
License: GPLv2+
URL: http://%{name}.io/
-Source0:
https://github.com/%{name}-player/%{name}/archive/v%{version}.tar.gz
+Source0:
https://github.com/%{name}-player/%{name}/archive/v%{version}.tar.gz#/%{n...
# set defaults for Fedora
Patch0: %{name}-config.patch
-BuildRequires: aalib-devel
-BuildRequires: alsa-lib-devel
-BuildRequires: bzip2-devel
+#
https://github.com/negativo17/mpv/blob/master/mpv-do-not-fail-with-minor-...
+Patch1: mpv-do-not-fail-with-minor-ffmpeg-updates.patch
+
+%if 0%{?fedora} < 26
+# Reverse of
https://github.com/mpv-player/mpv/commit/3eceac2eab0b42ee082a0b615ebf40a2...
+# and
https://github.com/mpv-player/mpv/commit/a660e15c9b96bd46209e78b3c3d4cf13...
+Patch2: %{name}-old-ffmpeg.patch
+%endif
+
+BuildRequires: pkgconfig(alsa)
BuildRequires: desktop-file-utils
+BuildRequires: pkgconfig(dvdnav)
+BuildRequires: pkgconfig(dvdread)
+BuildRequires: pkgconfig(egl)
+BuildRequires: pkgconfig(enca)
BuildRequires: ffmpeg-devel
-BuildRequires: ffmpeg-libs
-BuildRequires: libcdio-devel
-BuildRequires: libcdio-paranoia-devel
-BuildRequires: libGL-devel
-BuildRequires: libXScrnSaver-devel
-BuildRequires: libXinerama-devel
-BuildRequires: libXv-devel
-BuildRequires: libass-devel
-BuildRequires: libbluray-devel
-BuildRequires: libdvdnav-devel
-BuildRequires: libguess-devel
-BuildRequires: libquvi-devel
-BuildRequires: libsmbclient-devel
-BuildRequires: libva-devel
-BuildRequires: libvdpau-devel
-BuildRequires: libwayland-client-devel
-BuildRequires: libwayland-cursor-devel
-BuildRequires: libwayland-server-devel
-BuildRequires: libxkbcommon-devel
-BuildRequires: lirc-devel
-BuildRequires: lua-devel
-BuildRequires: pulseaudio-libs-devel
-BuildRequires: python-docutils
+BuildRequires: pkgconfig(gbm)
+BuildRequires: pkgconfig(gl)
+BuildRequires: pkgconfig(jack)
+BuildRequires: pkgconfig(lcms2)
+BuildRequires: pkgconfig(libarchive)
+BuildRequires: pkgconfig(libass)
+BuildRequires: pkgconfig(libbluray)
+BuildRequires: pkgconfig(libcdio)
+BuildRequires: pkgconfig(libcdio_paranoia)
+BuildRequires: pkgconfig(libdrm)
+BuildRequires: pkgconfig(libguess)
+BuildRequires: libjpeg-turbo-devel
+BuildRequires: pkgconfig(libpulse)
+BuildRequires: pkgconfig(libv4l2)
+BuildRequires: pkgconfig(libquvi-0.9)
+BuildRequires: pkgconfig(libva)
+BuildRequires: pkgconfig(lua-5.1)
+BuildRequires: pkgconfig(sdl2)
+BuildRequires: pkgconfig(rubberband)
+BuildRequires: pkgconfig(smbclient)
+BuildRequires: pkgconfig(uchardet) >= 0.0.5
+BuildRequires: pkgconfig(vdpau)
BuildRequires: waf
-BuildRequires: wayland-devel
+BuildRequires: pkgconfig(wayland-client)
+BuildRequires: pkgconfig(wayland-cursor)
+BuildRequires: pkgconfig(wayland-egl)
+BuildRequires: pkgconfig(wayland-scanner)
+BuildRequires: pkgconfig(x11)
+BuildRequires: pkgconfig(xext)
+BuildRequires: pkgconfig(xinerama)
+BuildRequires: pkgconfig(xkbcommon)
+BuildRequires: pkgconfig(xrandr)
+BuildRequires: pkgconfig(xscrnsaver)
+BuildRequires: pkgconfig(xv)
+BuildRequires: pkgconfig(zlib)
+BuildRequires: python-docutils
+
+BuildRequires: perl(Math::BigInt)
+BuildRequires: perl(Math::BigRat)
+BuildRequires: perl(Encode)
Requires: hicolor-icon-theme
+Provides: mplayer-backend
%description
Mpv is a movie player based on MPlayer and mplayer2. It supports a wide variety
@@ -49,70 +76,216 @@ input URL types are available to read input from a variety of sources
other
than disk files. Depending on platform, a variety of different video and audio
output methods are supported.
+%package libs
+Summary: Dynamic library for Mpv frontends
+Provides: libmpv = %{version}-%{release}
+Obsoletes: libmpv < %{version}-%{release}
+
+%description libs
+This package contains the dynamic library libmpv, which provides access to Mpv.
+
+%package libs-devel
+Summary: Development package for libmpv
+Requires: mpv-libs%{_isa} = %{version}-%{release}
+Provides: libmpv-devel = %{version}-%{release}
+Obsoletes: libmpv-devel < %{version}-%{release}
+
+%description libs-devel
+Libmpv development header files and libraries.
+
%prep
-%setup -q
-%patch0 -p1
+%autosetup -p1
+
%build
-CCFLAGS="%{optflags}" \
+CFLAGS="${RPM_OPT_FLAGS}" \
+LDFLAGS="${RPM_LD_FLAGS}" \
waf configure \
- --prefix="%{_prefix}" \
- --bindir="%{_bindir}" \
- --mandir="%{_mandir}" \
- --docdir="%{_docdir}/%{name}" \
- --confdir="%{_sysconfdir}/%{name}" \
- --enable-joystick \
- --enable-lirc \
- --enable-radio \
- --enable-radio-capture \
- --disable-sdl --disable-sdl2 \
+ --prefix=%{_prefix} \
+ --bindir=%{_bindir} \
+ --libdir=%{_libdir} \
+ --mandir=%{_mandir} \
+ --docdir=%{_docdir}/%{name} \
+ --confdir=%{_sysconfdir}/%{name} \
--disable-build-date \
- --disable-debug
+ --enable-libmpv-shared \
+ --enable-sdl2 \
+ --enable-encoding
-waf build --verbose %{?_smp_mflags}
+waf -v build %{?_smp_mflags}
%install
-waf --destdir=%{buildroot} install %{?_smp_mflags}
-
-# Default config files
-install -Dpm 644 etc/example.conf %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf
-install -Dpm 644 etc/input.conf %{buildroot}%{_sysconfdir}/%{name}/input.conf
-
-desktop-file-install etc/mpv.desktop
-
-for RES in 16 32 64; do
- install -Dpm 644 etc/mpv-icon-8bit-${RES}x${RES}.png
%{buildroot}%{_datadir}/icons/hicolor/${RES}x${RES}/apps/%{name}.png
-done
+waf install --destdir=%{buildroot}
+desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop
+install -Dpm 644 README.md etc/input.conf etc/mpv.conf -t %{buildroot}%{_docdir}/%{name}
%post
-update-desktop-database &>/dev/null || :
-touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
+/usr/bin/update-desktop-database &> /dev/null || :
+/bin/touch --no-create %{_datadir}/icons/hicolor &> /dev/null || :
%postun
-update-desktop-database &> /dev/null || :
+/usr/bin/update-desktop-database &> /dev/null || :
if [ $1 -eq 0 ] ; then
- touch --no-create %{_datadir}/icons/hicolor &>/dev/null
- gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor &>/dev/null || :
- glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
+ /bin/touch --no-create %{_datadir}/icons/hicolor &> /dev/null || :
+ /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &> /dev/null || :
fi
%posttrans
-gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor &>/dev/null || :
-glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
+/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &> /dev/null || :
+
+%post libs -p /sbin/ldconfig
+
+%postun libs -p /sbin/ldconfig
%files
-%doc LICENSE README.md Copyright
+%docdir %{_docdir}/%{name}
+%{_docdir}/%{name}
+%license LICENSE Copyright
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
-%{_datadir}/icons/hicolor/*/apps/%{name}.*
+%{_datadir}/icons/hicolor/*/apps/%{name}*.*
%{_mandir}/man1/%{name}.*
%dir %{_sysconfdir}/%{name}
-%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
%config(noreplace) %{_sysconfdir}/%{name}/encoding-profiles.conf
-%config(noreplace) %{_sysconfdir}/%{name}/input.conf
+
+%files libs
+%license LICENSE Copyright
+%{_libdir}/libmpv.so.*
+
+%files libs-devel
+%{_includedir}/%{name}
+%{_libdir}/libmpv.so
+%{_libdir}/pkgconfig/mpv.pc
%changelog
+* Tue Jan 10 2017 Miro Hrončok <mhroncok(a)redhat.com> - 0.23.0-2
+- Fix AVAudioResampleContext: Unable to set resampling compensation (rfbz#4408)
+
+* Sat Dec 31 2016 Miro Hrončok <mhroncok(a)redhat.com> - 0.23.0-1
+- Update to 0.23.0
+
+* Sat Dec 03 2016 leigh scott <leigh123linux(a)googlemail.com> - 0.22.0-2
+- Add patch to relax ffmpeg version check
+
+* Sat Nov 26 2016 leigh scott <leigh123linux(a)googlemail.com> - 0.22.0-1
+- update to 0.22.0
+
+* Thu Nov 17 2016 Adrian Reber <adrian(a)lisas.de> - 0.21.0-3
+- Rebuilt for libcdio-0.94
+
+* Sat Nov 05 2016 Leigh Scott <leigh123linux(a)googlemail.com> - 0.21.0-2
+- Rebuilt for new ffmpeg
+- Add provides mplayer-backend (rfbz#4284)
+
+* Thu Oct 20 2016 Evgeny Lensky <surfernsk(a)gmail.com> - 0.21.0-1
+- update to 0.21.0
+
+* Tue Aug 16 2016 Leigh Scott <leigh123linux(a)googlemail.com> - 0.19.0-3
+- Update to 0.19.0
+- Add LDFLAGS so build is hardened
+- Fix CFLAGS
+- Make build verbose
+- Remove Requires pkgconfig from devel sub-package
+- Fix source tag
+
+* Sat Jul 30 2016 Julian Sikorski <belegdol(a)fedoraproject.org> - 0.18.1-2
+- Rebuilt for ffmpeg-3.1.1
+
+* Tue Jul 26 2016 Miro Hrončok <mhroncok(a)redhat.com> - 0.18.1-1
+- Update to 0.18.1
+- Remove patch for Fedora < 22
+
+* Sun Jul 03 2016 Sérgio Basto <sergio(a)serjux.com> - 0.18.0-3
+- BRs in alphabetical order, rename of sub-packages libs and other improvements
+
+* Thu Jun 30 2016 Sérgio Basto <sergio(a)serjux.com> - 0.18.0-2
+- Add BR perl(Encode) to build on F24 (merge from Adrian Reber PR)
+
+* Tue Jun 28 2016 Sérgio Basto <sergio(a)serjux.com> - 0.18.0-1
+- Update to 0.18.0
+
+* Mon Apr 11 2016 Evgeny Lensky <surfernsk(a)gmail.com> - 0.17.0-1
+- update to 0.17.0
+
+* Mon Feb 29 2016 Evgeny Lensky <surfernsk(a)gmail.com> - 0.16.0-1
+- update to 0.16.0
+- edit mpv-config.patch
+
+* Sun Feb 14 2016 Sérgio Basto <sergio(a)serjux.com> - 0.15.0-2
+- Drop BR lirc, because support for LIRC has been removed in mpv 0.9.0.
+- Add license tag.
+- libmpv-devel does not need have same doc and license files.
+
+* Thu Jan 21 2016 Evgeny Lensky <surfernsk(a)gmail.com> - 0.15.0-1
+- update to 0.15.0
+
+* Sat Dec 12 2015 Evgeny Lensky <surfernsk(a)gmail.com> - 0.14.0-1
+- update to 0.14.0
+
+* Thu Nov 26 2015 Miro Hrončok <mhroncok(a)redhat.com> - 0.13.0-2
+- Add mesa-libEGL-devel to BRs
+
+* Thu Nov 26 2015 Miro Hrončok <mhroncok(a)redhat.com> - 0.13.0-1
+- Updated to 0.13.0
+
+* Thu Jun 11 2015 Miro Hrončok <mhroncok(a)redhat.com> - 0.9.2-2
+- Removed --disable-debug flag
+
+* Wed Jun 10 2015 Miro Hrončok <mhroncok(a)redhat.com> - 0.9.2-1
+- Updated to 0.9.2
+- Also build the library
+
+* Sat May 16 2015 Miro Hrončok <mhroncok(a)redhat.com> - 0.9.1-1
+- Update to 0.9.1
+- BR compat-lua-devel because mpv does not work with lua 5.3
+- Add BR lcms2-devel (#3643)
+- Removed --enable-joystick and --enable-lirc (no longer used)
+
+* Tue Apr 28 2015 Miro Hrončok <mhroncok(a)redhat.com> - 0.8.3-3
+- Conditionalize old waf patch
+
+* Tue Apr 28 2015 Miro Hrončok <mhroncok(a)redhat.com> - 0.8.3-2
+- Rebuilt
+
+* Mon Apr 13 2015 Miro Hrončok <mhroncok(a)redhat.com> - 0.8.3-1
+- Updated
+
+* Wed Jan 28 2015 Miro Hrončok <mhroncok(a)redhat.com> - 0.7.3-1
+- Updated
+
+* Mon Dec 22 2014 Miro Hrončok <mhroncok(a)redhat.com> - 0.7.1-3
+- Slightly change the waf patch
+
+* Mon Dec 22 2014 Miro Hrončok <mhroncok(a)redhat.com> - 0.7.1-2
+- Add patch to allow waf 1.7
+
+* Sat Dec 13 2014 Miro Hrončok <mhroncok(a)redhat.com> - 0.7.1-1
+- New version 0.7.1
+- Rebuilt new lirc (#3450)
+
+* Tue Nov 04 2014 Nicolas Chauvet <kwizart(a)gmail.com> - 0.6.0-3
+- Rebuilt for vaapi 0.36
+
+* Mon Oct 20 2014 Sérgio Basto <sergio(a)serjux.com> - 0.6.0-2
+- Rebuilt for FFmpeg 2.4.3
+
+* Sun Oct 12 2014 Miro Hrončok <mhroncok(a)redhat.com> - 0.6.0-1
+- New version 0.6.0
+
+* Fri Sep 26 2014 Nicolas Chauvet <kwizart(a)gmail.com> - 0.5.1-2
+- Rebuilt for FFmpeg 2.4.x
+
+* Wed Sep 03 2014 Miro Hrončok <mhroncok(a)redhat.com> - 0.5.1-1
+- New version 0.5.1
+- Add BR ncurses-devel (#3233)
+
+* Thu Aug 07 2014 Sérgio Basto <sergio(a)serjux.com> - 0.4.0-2
+- Rebuilt for ffmpeg-2.3
+
+* Tue Jul 08 2014 Miro Hrončok <mhroncok(a)redhat.com> - 0.4.0-1
+- New version 0.4.0
+
* Tue Jun 24 2014 Miro Hrončok <mhroncok(a)redhat.com> - 0.3.11-1
- New version 0.3.11
@@ -203,4 +376,3 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null
|| :
* Mon Aug 19 2013 Miro Hrončok <mhroncok(a)redhat.com> - 0.1.2-1
- Initial spec
- Inspired a lot in mplayer.spec
-
diff --git a/sources b/sources
index 3e1bfb2..6fb5c17 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-c2ab93033ce55e3e0ee596576db88e74 v0.3.11.tar.gz
+9bce377e101612d611daf2a5c99aa95f mpv-0.23.0.tar.gz