Ver Fonte

obs-ffmpeg: Call av_register_all before nvenc check

Closes jp9000/obs-studio#1157
Lucian Poston há 7 anos atrás
pai
commit
ff45b7b119
1 ficheiros alterados com 4 adições e 0 exclusões
  1. 4 0
      plugins/obs-ffmpeg/obs-ffmpeg.c

+ 4 - 0
plugins/obs-ffmpeg/obs-ffmpeg.c

@@ -3,6 +3,7 @@
 #include <util/platform.h>
 #include <util/platform.h>
 #include <libavutil/log.h>
 #include <libavutil/log.h>
 #include <libavcodec/avcodec.h>
 #include <libavcodec/avcodec.h>
+#include <libavformat/avformat.h>
 #include <pthread.h>
 #include <pthread.h>
 
 
 #ifndef __APPLE__
 #ifndef __APPLE__
@@ -147,7 +148,10 @@ typedef NVENCSTATUS (NVENCAPI *NVENCODEAPICREATEINSTANCE)(
 
 
 static bool nvenc_supported(void)
 static bool nvenc_supported(void)
 {
 {
+	av_register_all();
+
 	profile_start(nvenc_check_name);
 	profile_start(nvenc_check_name);
+
 	AVCodec *nvenc = avcodec_find_encoder_by_name("nvenc_h264");
 	AVCodec *nvenc = avcodec_find_encoder_by_name("nvenc_h264");
 	void *lib = NULL;
 	void *lib = NULL;
 	void *cudalib = NULL;
 	void *cudalib = NULL;