Browse Source

win-dshow: Do not update encoders if active

Do not update the avermedia encoders if they are already active, they
weren't designed to be updated in real time, so it will cause encoding
to break.
jp9000 10 years ago
parent
commit
8e9924d6a1
1 changed files with 6 additions and 1 deletions
  1. 6 1
      plugins/win-dshow/win-dshow-encoder.cpp

+ 6 - 1
plugins/win-dshow/win-dshow-encoder.cpp

@@ -140,7 +140,12 @@ inline bool DShowEncoder::Update(obs_data_t *settings)
 
 static bool UpdateDShowEncoder(void *data, obs_data_t *settings)
 {
-	return reinterpret_cast<DShowEncoder*>(data)->Update(settings);
+	DShowEncoder *encoder = reinterpret_cast<DShowEncoder*>(data);
+
+	if (!obs_encoder_active(encoder->context))
+		return encoder->Update(settings);
+
+	return true;
 }
 
 static inline void *CreateDShowEncoder(obs_data_t *settings,