summaryrefslogtreecommitdiffstats
path: root/video/img_format.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-11-29 17:39:57 +0100
committerwm4 <wm4@nowhere>2013-11-29 17:39:57 +0100
commit597b8a355002306486c5d4a19890bb403b5d3ded (patch)
tree17de2fbbb77868cb184b6a0f2eca5fffd14d2e9b /video/img_format.c
parentf1072e7629c56e6fdd9aab40be15fe9800789b1a (diff)
downloadmpv-597b8a355002306486c5d4a19890bb403b5d3ded.tar.bz2
mpv-597b8a355002306486c5d4a19890bb403b5d3ded.tar.xz
Take care of some libavutil deprecations, drop support for FFmpeg 1.0
PIX_FMT_* -> AV_PIX_FMT_* (except some pixdesc constants) enum PixelFormat -> enum AVPixelFormat Losen some version checks in certain newer pixel formats. av_pix_fmt_descriptors -> av_pix_fmt_desc_get This removes support for FFmpeg 1.0.x, which is even older than Libav 9.x. Support for it probably was already broken, and its libswresample was rejected by our build system anyway because it's broken. Mostly untested; it does compile with Libav 9.9.
Diffstat (limited to 'video/img_format.c')
-rw-r--r--video/img_format.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/video/img_format.c b/video/img_format.c
index 73e50bd803..b3d0c8bd91 100644
--- a/video/img_format.c
+++ b/video/img_format.c
@@ -157,8 +157,9 @@ const char *mp_imgfmt_to_name(unsigned int fmt)
struct mp_imgfmt_desc mp_imgfmt_get_desc(int mpfmt)
{
- enum PixelFormat fmt = imgfmt2pixfmt(mpfmt);
- if (fmt == PIX_FMT_NONE) {
+ enum AVPixelFormat fmt = imgfmt2pixfmt(mpfmt);
+ const AVPixFmtDescriptor *pd = av_pix_fmt_desc_get(fmt);
+ if (!pd || fmt == AV_PIX_FMT_NONE) {
const char *name = mp_imgfmt_to_name(mpfmt);
if (name) {
mp_msg(MSGT_DECVIDEO, MSGL_V,
@@ -167,9 +168,6 @@ struct mp_imgfmt_desc mp_imgfmt_get_desc(int mpfmt)
return (struct mp_imgfmt_desc) {0};
}
- const AVPixFmtDescriptor *pd = &av_pix_fmt_descriptors[fmt];
- assert(pd);
-
struct mp_imgfmt_desc desc = {
.id = mpfmt,
.avformat = fmt,
@@ -207,7 +205,7 @@ struct mp_imgfmt_desc mp_imgfmt_get_desc(int mpfmt)
if (mpfmt == IMGFMT_XYZ12_LE || mpfmt == IMGFMT_XYZ12_BE) {
desc.flags |= MP_IMGFLAG_XYZ;
- } else if (!(pd->flags & PIX_FMT_RGB) && fmt != PIX_FMT_MONOBLACK &&
+ } else if (!(pd->flags & PIX_FMT_RGB) && fmt != AV_PIX_FMT_MONOBLACK &&
fmt != PIX_FMT_PAL8)
{
desc.flags |= MP_IMGFLAG_YUV;