encodebin: Rebuilt internal state when swicthing to avoid-reencoding
authorThibault Saunier <tsaunier@igalia.com>
Sat, 4 Jul 2020 16:20:44 +0000 (12:20 -0400)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 22 Jul 2020 16:01:25 +0000 (16:01 +0000)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/751>

gst/encoding/gstencodebin.c

index cc1a7fb..c662b79 100644 (file)
@@ -548,8 +548,14 @@ gst_encode_bin_set_property (GObject * object, guint prop_id,
       ebin->tolerance = g_value_get_uint64 (value);
       break;
     case PROP_AVOID_REENCODING:
+    {
+      gboolean avoided_reencoding = ebin->avoid_reencoding;
       ebin->avoid_reencoding = g_value_get_boolean (value);
+      if (ebin->avoid_reencoding != avoided_reencoding && ebin->profile)
+        gst_encode_bin_set_profile (ebin, gst_object_ref (ebin->profile));
+
       break;
+    }
     case PROP_FLAGS:
       ebin->flags = g_value_get_flags (value);
       break;