Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bf9ef58b authored by Arun Menon's avatar Arun Menon
Browse files

msm: vidc: fix setting of client buffer count



The client requested buffer count was not honoured
in specific case - when requested buffer count
was less than actual buffer count, but greater than
min buffer count. It would be set to the min buffer
count, which would fail playback.

Change-Id: I10859fd2cb309b8f2b4fb106f9a78f4dc46d45ed
Signed-off-by: default avatarArun Menon <avmenon@codeaurora.org>
parent c99f9b85
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -1071,15 +1071,13 @@ static int msm_vdec_queue_setup(struct vb2_queue *q,
			mutex_unlock(&inst->lock);
			break;
		}
		if (*num_buffers && *num_buffers >=
			bufreq->buffer_count_actual) {
		*num_buffers = max(*num_buffers, bufreq->buffer_count_min);
		if (*num_buffers != bufreq->buffer_count_actual) {
			property_id = HAL_PARAM_BUFFER_COUNT_ACTUAL;
			new_buf_count.buffer_type = HAL_BUFFER_OUTPUT;
			new_buf_count.buffer_count_actual = *num_buffers;
			rc = call_hfi_op(hdev, session_set_property,
				inst->session, property_id, &new_buf_count);
		} else {
			*num_buffers = bufreq->buffer_count_min;
		}
		mutex_unlock(&inst->lock);
		dprintk(VIDC_DBG, "count =  %d, size = %d, alignment = %d\n",