[Spice-devel] [PATCH] gst: new_sample: remove redundant sample? condition

Pavel Grunt pgrunt at redhat.com
Thu Jul 20 17:04:54 UTC 2017


Ack

Thanks,
Pavel

On Thu, 2017-07-20 at 19:41 +0300, Uri Lublin wrote:
> Move the declaration and assignment of 'buffer' into
> the if (sample) block, where sample is not NULL.
> 	
> Signed-off-by: Uri Lublin <uril at redhat.com>
> ---
>  src/channel-display-gst.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/channel-display-gst.c b/src/channel-display-gst.c
> index 3f51361..03c6044 100644
> --- a/src/channel-display-gst.c
> +++ b/src/channel-display-gst.c
> @@ -200,8 +200,8 @@ static GstFlowReturn new_sample(GstAppSink *gstappsink,
> gpointer video_decoder)
>      SpiceGstDecoder *decoder = video_decoder;
>  
>      GstSample *sample = gst_app_sink_pull_sample(decoder->appsink);
> -    GstBuffer *buffer = sample ? gst_sample_get_buffer(sample) : NULL;
>      if (sample) {
> +        GstBuffer *buffer = gst_sample_get_buffer(sample);
>          g_mutex_lock(&decoder->queues_mutex);
>  
>          /* gst_app_sink_pull_sample() sometimes returns the same buffer twice


More information about the Spice-devel mailing list