diff options
author | Uoti Urpala <uau@mplayer2.org> | 2011-12-22 02:06:52 +0200 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2011-12-22 04:43:02 +0200 |
commit | 1bd5871762b9ddf50d7e2598a79c2e69c49b2757 (patch) | |
tree | c53da1b5d3bf251c1154011cdaa57e6bad2b6142 /libmpcodecs/vd_ffmpeg.c | |
parent | 37e4a928ca78bad9ea5e7ec07c0561c511de8ac9 (diff) | |
download | mpv-1bd5871762b9ddf50d7e2598a79c2e69c49b2757.tar.bz2 mpv-1bd5871762b9ddf50d7e2598a79c2e69c49b2757.tar.xz |
Libav API updates (remove most deprecated-in-0.7 uses)
Update various code using Libav libraries to remove use of API
features that were deprecated at Libav release 0.7. I think this
removes them all with the exception of URLContext functions still used
in stream_ffmpeg.c (at least other uses that generated deprecation
warnings with libraries from 0.7 are removed).
Diffstat (limited to 'libmpcodecs/vd_ffmpeg.c')
-rw-r--r-- | libmpcodecs/vd_ffmpeg.c | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index 8fc17f1a41..bed70543b2 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -311,27 +311,13 @@ 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) { + if (lavc_param->threads > 1) avctx->thread_count = lavc_param->threads; - avcodec_thread_init(avctx, lavc_param->threads); - } + /* open it */ if (avcodec_open(avctx, lavc_codec) < 0) { mp_tmsg(MSGT_DECVIDEO, MSGL_ERR, "Could not open codec.\n"); @@ -362,7 +348,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); } |