diff options
35 files changed, 399 insertions, 431 deletions
@@ -60,13 +60,8 @@ SRCS_COMMON-$(DVDREAD_INTERNAL) += libdvdread4/bitreader.c \ SRCS_COMMON-$(FAAD) += libmpcodecs/ad_faad.c SRCS_COMMON-$(FASTMEMCPY) += libvo/aclib.c -# Requires a new enough libavutil that installs eval.h -SRCS_COMMON-$(FFMPEG_EVAL_API) += libmpcodecs/vf_geq.c \ - libmpcodecs/vf_qp.c \ - # These filters use private headers and do not work with shared libavcodec. -SRCS_COMMON-$(FFMPEG_INTERNALS) += libmpcodecs/vf_fspp.c \ - libmpcodecs/vf_mcdeint.c \ +SRCS_COMMON-$(FFMPEG_INTERNALS) += libmpcodecs/vf_mcdeint.c \ libmpcodecs/vf_spp.c \ SRCS_COMMON-$(FREETYPE) += sub/font_load_ft.c @@ -316,6 +311,8 @@ SRCS_COMMON = asxparser.c \ libmpcodecs/vf_flip.c \ libmpcodecs/vf_format.c \ libmpcodecs/vf_framestep.c \ + libmpcodecs/vf_fspp.c \ + libmpcodecs/vf_geq.c \ libmpcodecs/vf_gradfun.c \ libmpcodecs/vf_halfpack.c \ libmpcodecs/vf_harddup.c \ @@ -337,6 +334,7 @@ SRCS_COMMON = asxparser.c \ libmpcodecs/vf_pp.c \ libmpcodecs/vf_pp7.c \ libmpcodecs/vf_pullup.c \ + libmpcodecs/vf_qp.c \ libmpcodecs/vf_rectangle.c \ libmpcodecs/vf_remove_logo.c \ libmpcodecs/vf_rgbtest.c \ diff --git a/access_mpcontext.h b/access_mpcontext.h deleted file mode 100644 index 4b866f255f..0000000000 --- a/access_mpcontext.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * This file is part of MPlayer. - * - * MPlayer is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * MPlayer is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with MPlayer; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef MPLAYER_ACCESS_MPCONTEXT_H -#define MPLAYER_ACCESS_MPCONTEXT_H - -struct MPContext; -void *mpctx_get_video_out(struct MPContext *mpctx); -void *mpctx_get_demuxer(struct MPContext *mpctx); -void *mpctx_get_playtree_iter(struct MPContext *mpctx); -void *mpctx_get_mixer(struct MPContext *mpctx); -int mpctx_get_global_sub_size(struct MPContext *mpctx); -int mpctx_get_osd_function(struct MPContext *mpctx); - -#endif /* MPLAYER_ACCESS_MPCONTEXT_H */ diff --git a/cfg-mplayer.h b/cfg-mplayer.h index f09cd9edd3..342fbccd62 100644 --- a/cfg-mplayer.h +++ b/cfg-mplayer.h @@ -926,7 +926,6 @@ const m_option_t mplayer_opts[]={ OPT_FLAG_ON("list-properties", list_properties, CONF_GLOBAL), {"identify", &mp_msg_levels[MSGT_IDENTIFY], CONF_TYPE_FLAG, CONF_GLOBAL, 0, MSGL_V, NULL}, - {"-help", (void *) help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL}, {"help", (void *) help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL}, {"h", (void *) help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL}, @@ -680,10 +680,8 @@ static int mp_property_pause(m_option_t *prop, int action, void *arg, case M_PROPERTY_STEP_DOWN: if (mpctx->paused) { unpause_player(mpctx); - mpctx->osd_function = OSD_PLAY; } else { pause_player(mpctx); - mpctx->osd_function = OSD_PAUSE; } return M_PROPERTY_OK; default: @@ -6003,27 +6003,21 @@ echores "$_live" -all_libav_libs="libavutil libavcodec libavformat libswscale libpostproc" +all_libav_libs="libavutil >= 51.7.0:libavcodec >= 53.5.0:libavformat >= 53.2.0:libswscale >= 2.0.0:libpostproc >= 52.0.0" echocheck "Libav ($all_libav_libs)" if test "$ffmpeg" = auto ; then + IFS=":" # shell should not be used for programming if $_pkg_config --exists --print-errors $all_libav_libs ; then inc_ffmpeg=$($_pkg_config --cflags $all_libav_libs) _ld_tmp=$($_pkg_config --libs $all_libav_libs) extra_ldflags="$extra_ldflags $_ld_tmp" extra_cflags="$extra_cflags $inc_ffmpeg" - elif header_check libavutil/avutil.h -lpostproc -lswscale -lavformat -lavcodec -lavutil $_ld_lm ; then - extra_ldflags="$extra_ldflags -lpostproc -lswscale -lavformat -lavcodec -lavutil" + unset IFS else die "Unable to find development files for some of the required Libav libraries above. Aborting." fi fi - -ffmpeg_eval_api=no -def_ffmpeg_eval_api="#undef CONFIG_FFMPEG_EVAL_API" -if $_pkg_config --atleast-version=50.33.0 libavutil ; then - ffmpeg_eval_api=yes - def_ffmpeg_eval_api="#define CONFIG_FFMPEG_EVAL_API 1" -fi +echores "yes" def_ffmpeg_internals="#undef CONFIG_FFMPEG_INTERNALS" if ! test -z "$_ffmpeg_source" ; then @@ -6790,7 +6784,6 @@ XVR100 = $_xvr100 YUV4MPEG = $_yuv4mpeg # FFmpeg -FFMPEG_EVAL_API = $ffmpeg_eval_api FFMPEG_INTERNALS = $ffmpeg_internals FFMPEG_SOURCE_PATH = $_ffmpeg_source @@ -7143,7 +7136,6 @@ $def_yuv4mpeg /* FFmpeg */ -$def_ffmpeg_eval_api $def_ffmpeg_internals $def_arpa_inet_h diff --git a/ffmpeg_files/taglists.c b/ffmpeg_files/taglists.c index 1596110907..ec414a35c1 100644 --- a/ffmpeg_files/taglists.c +++ b/ffmpeg_files/taglists.c @@ -181,9 +181,7 @@ const struct mp_AVCodecTag mp_ff_codec_bmp_tags[] = { { CODEC_ID_RAWVIDEO, MKTAG('Y', 'U', 'V', '9') }, { CODEC_ID_RAWVIDEO, MKTAG('Y', 'V', 'U', '9') }, { CODEC_ID_FRWU, MKTAG('F', 'R', 'W', 'U') }, -#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 89, 0) { CODEC_ID_R10K, MKTAG('R', '1', '0', 'k') }, -#endif { CODEC_ID_R210, MKTAG('r', '2', '1', '0') }, { CODEC_ID_V210, MKTAG('v', '2', '1', '0') }, { CODEC_ID_INDEO3, MKTAG('I', 'V', '3', '1') }, @@ -260,9 +258,7 @@ const struct mp_AVCodecTag mp_ff_codec_bmp_tags[] = { { CODEC_ID_AURA2, MKTAG('A', 'U', 'R', '2') }, { CODEC_ID_DPX, MKTAG('d', 'p', 'x', ' ') }, { CODEC_ID_KGV1, MKTAG('K', 'G', 'V', '1') }, -#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 108, 0) { CODEC_ID_LAGARITH, MKTAG('L', 'A', 'G', 'S') }, -#endif { CODEC_ID_NONE, 0 } }; @@ -299,15 +295,11 @@ const struct mp_AVCodecTag mp_ff_codec_wav_tags[] = { { CODEC_ID_WMALOSSLESS, 0x0163 }, { CODEC_ID_ADPCM_CT, 0x0200 }, { CODEC_ID_ATRAC3, 0x0270 }, -#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 88, 0) { CODEC_ID_ADPCM_G722, 0x028F }, -#endif { CODEC_ID_IMC, 0x0401 }, { CODEC_ID_GSM_MS, 0x1500 }, { CODEC_ID_TRUESPEECH, 0x1501 }, -#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 94, 0) { CODEC_ID_AAC_LATM, 0x1602 }, -#endif { CODEC_ID_AC3, 0x2000 }, { CODEC_ID_DTS, 0x2001 }, { CODEC_ID_SONIC, 0x2048 }, diff --git a/fmt-conversion.c b/fmt-conversion.c index 2adc115a4e..6ab6a4b82f 100644 --- a/fmt-conversion.c +++ b/fmt-conversion.c @@ -75,20 +75,16 @@ static const struct { {IMGFMT_420P16_LE, PIX_FMT_YUV420P16LE}, {IMGFMT_420P16_BE, PIX_FMT_YUV420P16BE}, -#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51, 2, 0) {IMGFMT_420P9_LE, PIX_FMT_YUV420P9LE}, {IMGFMT_420P9_BE, PIX_FMT_YUV420P9BE}, {IMGFMT_420P10_LE, PIX_FMT_YUV420P10LE}, {IMGFMT_420P10_BE, PIX_FMT_YUV420P10BE}, {IMGFMT_422P10_LE, PIX_FMT_YUV422P10LE}, {IMGFMT_422P10_BE, PIX_FMT_YUV422P10BE}, -#endif -#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51, 7, 0) {IMGFMT_444P9_BE , PIX_FMT_YUV444P9BE}, {IMGFMT_444P9_LE , PIX_FMT_YUV444P9LE}, {IMGFMT_444P10_BE, PIX_FMT_YUV444P10BE}, {IMGFMT_444P10_LE, PIX_FMT_YUV444P10LE}, -#endif {IMGFMT_422P16_LE, PIX_FMT_YUV422P16LE}, {IMGFMT_422P16_BE, PIX_FMT_YUV422P16BE}, {IMGFMT_444P16_LE, PIX_FMT_YUV444P16LE}, @@ -134,13 +130,9 @@ int pixfmt2imgfmt(enum PixelFormat pix_fmt) break; int fmt = conversion_map[i].fmt; if (!fmt) { -#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51, 2, 0) const char *fmtname = av_get_pix_fmt_name(pix_fmt); mp_msg(MSGT_GLOBAL, MSGL_ERR, "Unsupported PixelFormat %s (%d)\n", fmtname ? fmtname : "INVALID", pix_fmt); -#else - mp_msg(MSGT_GLOBAL, MSGL_ERR, "Unsupported PixelFormat %i\n", pix_fmt); -#endif } return fmt; } diff --git a/input/input.c b/input/input.c index b5e66f6603..d9c95238d1 100644 --- a/input/input.c +++ b/input/input.c @@ -573,9 +573,6 @@ struct cmd_bind_section { struct cmd_queue { struct mp_cmd *first; - struct mp_cmd *last; - int num_cmds; - int num_abort_cmds; }; struct input_ctx { @@ -707,32 +704,52 @@ static bool is_abort_cmd(int cmd_id) return false; } +static int queue_count_cmds(struct cmd_queue *queue) +{ + int res = 0; + for (struct mp_cmd *cmd = queue->first; cmd; cmd = cmd->queue_next) + res++; + return res; +} + +static bool queue_has_abort_cmds(struct cmd_queue *queue) +{ + for (struct mp_cmd *cmd = queue->first; cmd; cmd = cmd->queue_next) { + if (is_abort_cmd(cmd->id)) + return true; + } + return false; +} + +static void queue_remove(struct cmd_queue *queue, struct mp_cmd *cmd) +{ + struct mp_cmd **p_prev = &queue->first; + while (*p_prev != cmd) { + p_prev = &(*p_prev)->queue_next; + } + // if this fails, cmd was not in the queue + assert(*p_prev == cmd); + *p_prev = cmd->queue_next; +} + static void queue_pop(struct cmd_queue *queue) { - assert(queue->num_cmds > 0); - struct mp_cmd *cmd = queue->first; - queue->first = cmd->queue_next; - queue->num_cmds--; - queue->num_abort_cmds -= is_abort_cmd(cmd->id); + queue_remove(queue, queue->first); } static void queue_add(struct cmd_queue *queue, struct mp_cmd *cmd, bool at_head) { - if (!queue->num_cmds) { - queue->first = cmd; - queue->last = cmd; - } else if (at_head) { - queue->first->queue_prev = cmd; + if (at_head) { cmd->queue_next = queue->first; queue->first = cmd; } else { - queue->last->queue_next = cmd; - cmd->queue_prev = queue->last; - queue->last = cmd; + struct mp_cmd **p_prev = &queue->first; + while (*p_prev) + p_prev = &(*p_prev)->queue_next; + *p_prev = cmd; + cmd->queue_next = NULL; } - queue->num_cmds++; - queue->num_abort_cmds += is_abort_cmd(cmd->id); } int mp_input_add_cmd_fd(struct input_ctx *ictx, int fd, int select, @@ -1293,8 +1310,8 @@ void mp_input_feed_key(struct input_ctx *ictx, int code) if (!cmd) return; struct cmd_queue *queue = &ictx->key_cmd_queue; - if (queue->num_cmds >= ictx->key_fifo_size && - (!is_abort_cmd(cmd->id) || queue->num_abort_cmds)) + if (queue_count_cmds(queue) >= ictx->key_fifo_size && + (!is_abort_cmd(cmd->id) || queue_has_abort_cmds(queue))) return; queue_add(queue, cmd, false); } @@ -1445,14 +1462,14 @@ mp_cmd_t *mp_input_get_cmd(struct input_ctx *ictx, int time, int peek_only) if (async_quit_request) return mp_input_parse_cmd("quit 1"); - if (ictx->control_cmd_queue.num_cmds || ictx->key_cmd_queue.num_cmds) + if (ictx->control_cmd_queue.first || ictx->key_cmd_queue.first) time = 0; read_all_events(ictx, time); struct mp_cmd *ret; struct cmd_queue *queue = &ictx->control_cmd_queue; - if (!queue->num_cmds) + if (!queue->first) queue = &ictx->key_cmd_queue; - if (!queue->num_cmds) { + if (!queue->first) { ret = check_autorepeat(ictx); if (!ret) return NULL; @@ -1883,8 +1900,8 @@ static int print_cmd_list(m_option_t *cfg) int mp_input_check_interrupt(struct input_ctx *ictx, int time) { for (int i = 0; ; i++) { - if (async_quit_request || ictx->key_cmd_queue.num_abort_cmds || - ictx->control_cmd_queue.num_abort_cmds) { + if (async_quit_request || queue_has_abort_cmds(&ictx->key_cmd_queue) || + queue_has_abort_cmds(&ictx->control_cmd_queue)) { mp_tmsg(MSGT_INPUT, MSGL_WARN, "Received command to move to " "another file. Aborting current processing.\n"); return true; diff --git a/input/input.h b/input/input.h index 4058ce3d99..8d32a9907c 100644 --- a/input/input.h +++ b/input/input.h @@ -194,7 +194,6 @@ typedef struct mp_cmd { int nargs; struct mp_cmd_arg args[MP_CMD_MAX_ARGS]; int pausing; - struct mp_cmd *queue_prev; struct mp_cmd *queue_next; } mp_cmd_t; diff --git a/libaf/af_volume.c b/libaf/af_volume.c index 768f67c5f3..4e6a3b40f6 100644 --- a/libaf/af_volume.c +++ b/libaf/af_volume.c @@ -142,7 +142,6 @@ static af_data_t* play(struct af_instance_s* af, af_data_t* data) { af_data_t* c = data; // Current working data af_volume_t* s = (af_volume_t*)af->setup; // Setup for this instance - int ch = 0; // Channel counter register int nch = c->nch; // Number of channels register int i = 0; @@ -150,9 +149,9 @@ static af_data_t* play(struct af_instance_s* af, af_data_t* data) if(af->data->format == (AF_FORMAT_S16_NE)){ int16_t* a = (int16_t*)c->audio; // Audio data int len = c->len/2; // Number of samples - for(ch = 0; ch < nch ; ch++){ - if(s->enable[ch]){ - register int vol = (int)(255.0 * s->level[ch]); + for (int ch = 0; ch < nch; ch++) { + int vol = 256.0 * s->level[ch]; + if (s->enable[ch] && vol != 256) { for(i=ch;i<len;i+=nch){ register int x = (a[i] * vol) >> 8; a[i]=clamp(x,SHRT_MIN,SHRT_MAX); @@ -164,7 +163,7 @@ static af_data_t* play(struct af_instance_s* af, af_data_t* data) else if(af->data->format == (AF_FORMAT_FLOAT_NE)){ float* a = (float*)c->audio; // Audio data int len = c->len/4; // Number of samples - for(ch = 0; ch < nch ; ch++){ + for (int ch = 0; ch < nch; ch++) { // Volume control (fader) if(s->enable[ch]){ float t = 1.0 - s->time; diff --git a/libao2/audio_out.c b/libao2/audio_out.c index bd06c8fd5f..b1b5c0e901 100644 --- a/libao2/audio_out.c +++ b/libao2/audio_out.c @@ -74,12 +74,15 @@ static const struct ao_driver * const audio_out_drivers[] = { #ifdef CONFIG_COREAUDIO &audio_out_coreaudio, #endif -#ifdef CONFIG_OSS_AUDIO - &audio_out_oss, +#ifdef CONFIG_PULSE + &audio_out_pulse, #endif #ifdef CONFIG_ALSA &audio_out_alsa, #endif +#ifdef CONFIG_OSS_AUDIO + &audio_out_oss, +#endif #ifdef CONFIG_ALSA5 &audio_out_alsa5, #endif @@ -96,21 +99,18 @@ static const struct ao_driver * const audio_out_drivers[] = { #ifdef CONFIG_ESD &audio_out_esd, #endif -#ifdef CONFIG_PULSE - &audio_out_pulse, -#endif #ifdef CONFIG_JACK &audio_out_jack, #endif #ifdef CONFIG_NAS &audio_out_nas, #endif -#ifdef CONFIG_SDL - &audio_out_sdl, -#endif #ifdef CONFIG_OPENAL &audio_out_openal, #endif +#ifdef CONFIG_SDL + &audio_out_sdl, +#endif &audio_out_mpegpes, #ifdef CONFIG_IVTV &audio_out_ivtv, diff --git a/libmpcodecs/ad_ffmpeg.c b/libmpcodecs/ad_ffmpeg.c index 762c80282d..cd742cf8f8 100644 --- a/libmpcodecs/ad_ffmpeg.c +++ b/libmpcodecs/ad_ffmpeg.c @@ -20,6 +20,7 @@ #include <stdlib.h> #include <unistd.h> #include <stdbool.h> +#include <assert.h> #include <libavcodec/avcodec.h> @@ -47,7 +48,7 @@ LIBAD_EXTERN(ffmpeg) struct priv { AVCodecContext *avctx; - bool old_packet; + int previous_data_left; }; static int preinit(sh_audio_t *sh) @@ -230,7 +231,7 @@ static int control(sh_audio_t *sh, int cmd, void *arg, ...) case ADCTRL_RESYNC_STREAM: avcodec_flush_buffers(ctx->avctx); ds_clear_parser(sh->ds); - ctx->old_packet = false; + ctx->previous_data_left = 0; return CONTROL_TRUE; } return CONTROL_UNKNOWN; @@ -247,23 +248,37 @@ static int decode_audio(sh_audio_t *sh_audio, unsigned char *buf, int minlen, while (len < minlen) { AVPacket pkt; int len2 = maxlen; - double pts; - int x = ds_get_packet_pts(sh_audio->ds, &start, &pts); - if (x <= 0) { + double pts = MP_NOPTS_VALUE; + int x; + bool packet_already_used = ctx->previous_data_left; + struct demux_packet *mpkt = ds_get_packet2(sh_audio->ds, + ctx->previous_data_left); + if (!mpkt) { + assert(!ctx->previous_data_left); start = NULL; x = 0; - ds_parse(sh_audio->ds, &start, &x, MP_NOPTS_VALUE, 0); + ds_parse(sh_audio->ds, &start, &x, pts, 0); if (x <= 0) break; // error } else { - int in_size = x; + assert(mpkt->len >= ctx->previous_data_left); + if (!ctx->previous_data_left) { + ctx->previous_data_left = mpkt->len; + pts = mpkt->pts; + } + x = ctx->previous_data_left; + start = mpkt->buffer + mpkt->len - ctx->previous_data_left; int consumed = ds_parse(sh_audio->ds, &start, &x, pts, 0); - sh_audio->ds->buffer_pos -= in_size - consumed; + ctx->previous_data_left -= consumed; } av_init_packet(&pkt); pkt.data = start; pkt.size = x; - if (pts != MP_NOPTS_VALUE && !ctx->old_packet) { + if (mpkt && mpkt->avpacket) { + pkt.side_data = mpkt->avpacket->side_data; + pkt.side_data_elems = mpkt->avpacket->side_data_elems; + } + if (pts != MP_NOPTS_VALUE && !packet_already_used) { sh_audio->pts = pts; sh_audio->pts_bytes = 0; } @@ -275,14 +290,11 @@ static int decode_audio(sh_audio_t *sh_audio, unsigned char *buf, int minlen, mp_msg(MSGT_DECAUDIO, MSGL_V, "lavc_audio: error\n"); break; } - if (!sh_audio->parser && y < x) { - sh_audio->ds->buffer_pos += y - x; // put back data (HACK!) - ctx->old_packet = true; - } + if (!sh_audio->parser) + ctx->previous_data_left += x - y; if (len2 > 0) { if (avctx->channels >= 5) { - int samplesize = av_get_bits_per_sample_format( - avctx->sample_fmt) / 8; + int samplesize = av_get_bytes_per_sample(avctx->sample_fmt); reorder_channel_nch(buf, AF_CHANNEL_LAYOUT_LAVC_DEFAULT, AF_CHANNEL_LAYOUT_MPLAYER_DEFAULT, avctx->channels, diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index b7f189ec5f..0688aae7cc 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -147,10 +147,7 @@ static int init(sh_video_t *sh) && lavc_codec->id != CODEC_ID_H264 && lavc_codec->id != CODEC_ID_INTERPLAY_VIDEO && lavc_codec->id != CODEC_ID_ROQ && lavc_codec->id != CODEC_ID_VP8 -#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 108, 0) - && lavc_codec->id != CODEC_ID_LAGARITH -#endif - ) + && lavc_codec->id != CODEC_ID_LAGARITH) ctx->do_dr1 = 1; ctx->b_age = ctx->ip_age[0] = ctx->ip_age[1] = 256 * 256 * 256 * 64; ctx->ip_count = ctx->b_count = 0; @@ -314,27 +311,12 @@ static int init(sh_video_t *sh) memcpy(avctx->extradata, sh->bih + 1, avctx->extradata_size); break; } - /* Pass palette to codec */ - if (sh->bih && (sh->bih->biBitCount <= 8)) { - avctx->palctrl = calloc(1, sizeof(AVPaletteControl)); - avctx->palctrl->palette_changed = 1; - if (sh->bih->biSize - sizeof(*sh->bih)) - /* Palette size in biSize */ - memcpy(avctx->palctrl->palette, sh->bih + 1, - FFMIN(sh->bih->biSize - sizeof(*sh->bih), AVPALETTE_SIZE)); - else - /* Palette size in biClrUsed */ - memcpy(avctx->palctrl->palette, sh->bih + 1, - FFMIN(sh->bih->biClrUsed * 4, AVPALETTE_SIZE)); - } if (sh->bih) avctx->bits_per_coded_sample = sh->bih->biBitCount; - if (lavc_param->threads > 1) { - avctx->thread_count = lavc_param->threads; - avcodec_thread_init(avctx, lavc_param->threads); - } + avctx->thread_count = lavc_param->threads; + /* open it */ if (avcodec_open(avctx, lavc_codec) < 0) { mp_tmsg(MSGT_DECVIDEO, MSGL_ERR, "Could not open codec.\n"); @@ -365,7 +347,6 @@ static void uninit(sh_video_t *sh) mp_tmsg(MSGT_DECVIDEO, MSGL_ERR, "Could not close codec.\n"); av_freep(&avctx->extradata); - free(avctx->palctrl); av_freep(&avctx->slice_offset); } @@ -663,12 +644,10 @@ static struct mp_image *decode(struct sh_video *sh, struct demux_packet *packet, pkt.size = len; // HACK: make PNGs decode normally instead of as CorePNG delta frames pkt.flags = AV_PKT_FLAG_KEY; -#if LIBAVCODEC_VERSION_MAJOR >= 53 if (packet && packet->avpacket) { pkt.side_data = packet->avpacket->side_data; pkt.side_data_elems = packet->avpacket->side_data_elems; } -#endif // The avcodec opaque field stupidly supports only int64_t type union pts { int64_t i; double d; }; avctx->reordered_opaque = (union pts){.d = *reordered_pts}.i; diff --git a/libmpcodecs/vf.c b/libmpcodecs/vf.c index 34790e3d62..d973db6d3e 100644 --- a/libmpcodecs/vf.c +++ b/libmpcodecs/vf.c @@ -138,6 +138,7 @@ static const vf_info_t *const filter_list[] = { &vf_info_lavc, &vf_info_lavcdeint, &vf_info_screenshot, + &vf_info_fspp, &vf_info_uspp, &vf_info_dvbscale, @@ -182,13 +183,10 @@ static const vf_info_t *const filter_list[] = { &vf_info_hue, #ifdef CONFIG_FFMPEG_INTERNALS &vf_info_spp, - &vf_info_fspp, &vf_info_mcdeint, #endif -#ifdef CONFIG_FFMPEG_EVAL_API &vf_info_geq, &vf_info_qp, -#endif &vf_info_yuvcsp, &vf_info_kerndeint, &vf_info_rgbtest, diff --git a/libmpcodecs/vf_ass.c b/libmpcodecs/vf_ass.c index a062149364..ce80caa74b 100644 --- a/libmpcodecs/vf_ass.c +++ b/libmpcodecs/vf_ass.c @@ -61,8 +61,9 @@ static const struct vf_priv_s { int auto_insert; struct osd_state *osd; - ASS_Renderer *renderer_realaspect; - ASS_Renderer *renderer_vsfilter; + ASS_Renderer *renderer; + + double realaspect; unsigned char *planes[3]; struct line_limits { @@ -93,14 +94,10 @@ static int config(struct vf_instance *vf, vf->priv->planes[2] = malloc(vf->priv->outw * vf->priv->outh); vf->priv->line_limits = malloc((vf->priv->outh + 1) / 2 * sizeof(*vf->priv->line_limits)); - if (vf->priv->renderer_realaspect) { - mp_ass_configure(vf->priv->renderer_realaspect, opts, - vf->priv->outw, vf->priv->outh, 0); - mp_ass_configure(vf->priv->renderer_vsfilter, opts, + if (vf->priv->renderer) { + mp_ass_configure(vf->priv->renderer, opts, vf->priv->outw, vf->priv->outh, 0); - ass_set_aspect_ratio(vf->priv->renderer_realaspect, - (double)width / height * d_height / d_width, 1); - ass_set_aspect_ratio(vf->priv->renderer_vsfilter, 1, 1); + vf->priv->realaspect = (double)width / height * d_height / d_width; } return vf_next_config(vf, vf->priv->outw, vf->priv->outh, d_width, @@ -363,17 +360,16 @@ static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts) { struct osd_state *osd = vf->priv->osd; ASS_Image *images = 0; - ASS_Renderer *renderer = osd->vsfilter_aspect + double scale = osd->vsfilter_aspect && vf->opts->ass_vsfilter_aspect_compat - ? vf->priv->renderer_vsfilter : vf->priv->renderer_realaspect; - if (sub_visibility && renderer && osd->ass_track + ? 1 : vf->priv->realaspect; + if (sub_visibility && vf->priv->renderer && osd->ass_track && (pts != MP_NOPTS_VALUE)) { - if (osd->ass_force_reload) {< |