From 46f3e7c6fd9148677e97e01c5a29f07f59a132b3 Mon Sep 17 00:00:00 2001 From: Sjoerd Simons Date: Sun, 13 Feb 2011 14:42:14 +0000 Subject: [PATCH] theoraenc: Don't reset the video quality setting the bitrate libtheora has two encoding modes, CBR, where it tries to hit a target bitrate and VBR where it tries to achieve a target quality. Internally if the target bitrate is set to anything other then 0 the encoding-mode is CBR. This means that the gstreamer element can leave the video_quality setting alone as long as the user is tweaking the bitrate. Which has the nice side-effect that if the user explicitely sets the bitrate to 0 (which is actually the default), the quality value doesn't get reset and one ends up encoding VBR at quality-level 0... --- ext/theora/gsttheoraenc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ext/theora/gsttheoraenc.c b/ext/theora/gsttheoraenc.c index d31485bfd8..03acef80bc 100644 --- a/ext/theora/gsttheoraenc.c +++ b/ext/theora/gsttheoraenc.c @@ -1372,13 +1372,12 @@ theora_enc_set_property (GObject * object, guint prop_id, case PROP_BITRATE: GST_OBJECT_LOCK (enc); enc->video_bitrate = g_value_get_int (value) * 1000; - enc->video_quality = 0; enc->bitrate_changed = TRUE; GST_OBJECT_UNLOCK (enc); break; case PROP_QUALITY: GST_OBJECT_LOCK (enc); - if (GST_STATE (enc) >= GST_STATE_PAUSED && enc->video_quality == 0) { + if (GST_STATE (enc) >= GST_STATE_PAUSED && enc->video_bitrate > 0) { GST_WARNING_OBJECT (object, "Can't change from bitrate to quality mode" " while playing"); } else {