[vlc-commits] avcodec: fail if the specified encoder is not found

Thomas Guillem git at videolan.org
Tue Mar 27 17:41:45 CEST 2018


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Mar 27 17:40:32 2018 +0200| [2d628e37d2e9d28038bc5904deb2fe3d6837e4a6] | committer: Thomas Guillem

avcodec: fail if the specified encoder is not found

Instead of using the default avcodec encoder.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2d628e37d2e9d28038bc5904deb2fe3d6837e4a6
---

 modules/codec/avcodec/encoder.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c
index 7bf2f0e1ba..8c8a442e14 100644
--- a/modules/codec/avcodec/encoder.c
+++ b/modules/codec/avcodec/encoder.c
@@ -344,12 +344,15 @@ int InitVideoEnc( vlc_object_t *p_this )
     {
         p_codec = avcodec_find_encoder_by_name( psz_encoder );
         if( !p_codec )
+        {
             msg_Err( p_this, "Encoder `%s' not found", psz_encoder );
+            return VLC_EGENERIC;
+        }
         else if( p_codec->id != i_codec_id )
         {
             msg_Err( p_this, "Encoder `%s' can't handle %4.4s",
                     psz_encoder, (char*)&p_enc->fmt_out.i_codec );
-            p_codec = NULL;
+            return VLC_EGENERIC;
         }
     }
     free( psz_encoder );



More information about the vlc-commits mailing list