소스 검색

obs-ffmpeg: Fix warning and remove unnecessary null checks

The if statement erroneously ended with a ';', which means that the code
is always executed, but there's no reason to even have these if checks
in the first place as the functions themselves return safely with null
pointers.
jp9000 9 년 전
부모
커밋
43eba49a50
1개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 4
      plugins/obs-ffmpeg/obs-ffmpeg-nvenc.c

+ 2 - 4
plugins/obs-ffmpeg/obs-ffmpeg-nvenc.c

@@ -192,10 +192,8 @@ static void nvenc_destroy(void *data)
 {
 	struct nvenc_encoder *enc = data;
 
-	if (enc->context)
-		avcodec_close(enc->context);
-	if (enc->vframe);
-		av_frame_free(&enc->vframe);
+	avcodec_close(enc->context);
+	av_frame_free(&enc->vframe);
 	avpicture_free(&enc->dst_picture);
 	da_free(enc->buffer);
 	bfree(enc->header);