[Spice-devel,spice-server] gstreamer: Correctly don't allow too limited bit rates

Submitted by Frediano Ziglio on Dec. 1, 2016, 12:25 p.m.

Details

Message ID 20161201122554.21744-1-fziglio@redhat.com
State Accepted
Commit 41d52961dbb5f6a999ba93cca3763998aa9409da
Headers show
Series "gstreamer: Correctly don't allow too limited bit rates" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Frediano Ziglio Dec. 1, 2016, 12:25 p.m.
The check to limit too low bit rates was setting encoder->bit_rate
instead of bit_rate. However after some lines bit_rate was used
to set encoder->bit_rate basically removing the lower threshold.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
---
 server/gstreamer-encoder.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/server/gstreamer-encoder.c b/server/gstreamer-encoder.c
index b9b1a56..e28ab00 100644
--- a/server/gstreamer-encoder.c
+++ b/server/gstreamer-encoder.c
@@ -595,7 +595,7 @@  static void set_bit_rate(SpiceGstEncoder *encoder, uint64_t bit_rate)
     }
     if (bit_rate < SPICE_GST_MIN_BITRATE) {
         /* Don't let the bit rate go too low... */
-        encoder->bit_rate = SPICE_GST_MIN_BITRATE;
+        bit_rate = SPICE_GST_MIN_BITRATE;
     } else if (bit_rate > encoder->bit_rate) {
         /* or too high */
         bit_rate = MIN(bit_rate, get_bit_rate_cap(encoder));

Comments

On Thu, 1 Dec 2016, Frediano Ziglio wrote:

> The check to limit too low bit rates was setting encoder->bit_rate
> instead of bit_rate. However after some lines bit_rate was used
> to set encoder->bit_rate basically removing the lower threshold.
> 
> Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
> ---

Acked-by: Francois Gouget <fgouget@codeweavers.com>


>  server/gstreamer-encoder.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/server/gstreamer-encoder.c b/server/gstreamer-encoder.c
> index b9b1a56..e28ab00 100644
> --- a/server/gstreamer-encoder.c
> +++ b/server/gstreamer-encoder.c
> @@ -595,7 +595,7 @@ static void set_bit_rate(SpiceGstEncoder *encoder, uint64_t bit_rate)
>      }
>      if (bit_rate < SPICE_GST_MIN_BITRATE) {
>          /* Don't let the bit rate go too low... */
> -        encoder->bit_rate = SPICE_GST_MIN_BITRATE;
> +        bit_rate = SPICE_GST_MIN_BITRATE;
>      } else if (bit_rate > encoder->bit_rate) {
>          /* or too high */
>          bit_rate = MIN(bit_rate, get_bit_rate_cap(encoder));
>