summaryrefslogtreecommitdiffstats
path: root/video/fmt-conversion.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-01-17 16:10:26 +0100
committerwm4 <wm4@nowhere>2013-01-17 16:39:26 +0100
commit52d1f3cc533e28c81cd9807ddb0a51d0de543b9d (patch)
tree877197ebe1fd599069be1bfd0ba36479de24266d /video/fmt-conversion.c
parenta410d82adeef52354f819d53c988cf48fa575f65 (diff)
downloadmpv-52d1f3cc533e28c81cd9807ddb0a51d0de543b9d.tar.bz2
mpv-52d1f3cc533e28c81cd9807ddb0a51d0de543b9d.tar.xz
options: also accept ffmpeg pixel format names
Options that take pixel format names now also accept ffmpeg names. mpv internal names are preferred. We leave this undocumented intentionally, and may be removed once libswscale stops printing ffmpeg pixel format names to the terminal (or if we stop passing the SWS_PRINT_INFO flag to it, which makes it print these). (We insist on keeping the mpv specific names instead of dropping them in favor of ffmpeg's name due to NIH, and also because ffmpeg always appends the endian suffixes "le" and "be".)
Diffstat (limited to 'video/fmt-conversion.c')
-rw-r--r--video/fmt-conversion.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/video/fmt-conversion.c b/video/fmt-conversion.c
index c20097224e..b37bd6c441 100644
--- a/video/fmt-conversion.c
+++ b/video/fmt-conversion.c
@@ -175,6 +175,9 @@ static const struct {
enum PixelFormat imgfmt2pixfmt(int fmt)
{
+ if (fmt == IMGFMT_NONE)
+ return PIX_FMT_NONE;
+
int i;
enum PixelFormat pix_fmt;
for (i = 0; conversion_map[i].fmt; i++)
@@ -188,6 +191,9 @@ enum PixelFormat imgfmt2pixfmt(int fmt)
int pixfmt2imgfmt(enum PixelFormat pix_fmt)
{
+ if (pix_fmt == PIX_FMT_NONE)
+ return IMGFMT_NONE;
+
int i;
for (i = 0; conversion_map[i].pix_fmt != PIX_FMT_NONE; i++)
if (conversion_map[i].pix_fmt == pix_fmt)