diff fmt-conversion.c @ 36172:7bf03a973142

Do not pass random unsupported data to encoder.
author reimar
date Mon, 13 May 2013 19:34:44 +0000
parents 4e3c56728d1e
children d649e84ea8d5
line wrap: on
line diff
--- a/fmt-conversion.c	Mon May 13 19:34:43 2013 +0000
+++ b/fmt-conversion.c	Mon May 13 19:34:44 2013 +0000
@@ -180,7 +180,7 @@
     {AF_FORMAT_S16_NE, AV_SAMPLE_FMT_S16},
     {AF_FORMAT_S32_NE, AV_SAMPLE_FMT_S32},
     {AF_FORMAT_FLOAT_NE, AV_SAMPLE_FMT_FLT},
-    {0, AV_SAMPLE_FMT_NONE}
+    {AF_FORMAT_UNKNOWN, AV_SAMPLE_FMT_NONE}
 };
 
 enum AVSampleFormat affmt2samplefmt(int fmt)
@@ -206,7 +206,7 @@
         if (samplefmt_conversion_map[i].sample_fmt == sample_fmt)
             break;
     fmt = samplefmt_conversion_map[i].fmt;
-    if (!fmt)
+    if (fmt == AF_FORMAT_UNKNOWN)
         mp_msg(MSGT_GLOBAL, MSGL_ERR, "Unsupported AVSampleFormat %i\n", sample_fmt);
     return fmt;
 }