diff options
Diffstat (limited to 'libmpcodecs')
-rw-r--r-- | libmpcodecs/ad_ffmpeg.c | 3 | ||||
-rw-r--r-- | libmpcodecs/vd_ffmpeg.c | 19 |
2 files changed, 3 insertions, 19 deletions
diff --git a/libmpcodecs/ad_ffmpeg.c b/libmpcodecs/ad_ffmpeg.c index 762c80282d..e76c536957 100644 --- a/libmpcodecs/ad_ffmpeg.c +++ b/libmpcodecs/ad_ffmpeg.c @@ -281,8 +281,7 @@ static int decode_audio(sh_audio_t *sh_audio, unsigned char *buf, int minlen, } 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 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); } |