mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
timedvaluecontrolsource: Check that the only iter is the end iter in the GSequence
Previous patch was assuming that if the returned iter was the last iter the GSequence was empty, which is obviously wrong.
This commit is contained in:
parent
78bbaeb6e7
commit
33924a7f04
1 changed files with 14 additions and 11 deletions
|
@ -182,21 +182,24 @@ gst_timed_value_control_source_set_internal (GstTimedValueControlSource *
|
|||
iter =
|
||||
g_sequence_search (self->values, ×tamp,
|
||||
(GCompareDataFunc) gst_control_point_find, NULL);
|
||||
if (iter && !g_sequence_iter_is_end (iter)) {
|
||||
if (iter) {
|
||||
GSequenceIter *prev = g_sequence_iter_prev (iter);
|
||||
GstControlPoint *cp = g_sequence_get (prev);
|
||||
|
||||
/* If the timestamp is the same just update the control point value */
|
||||
if (cp->timestamp == timestamp) {
|
||||
if (!g_sequence_iter_is_end (prev)) {
|
||||
GstControlPoint *cp = g_sequence_get (prev);
|
||||
|
||||
/* update control point */
|
||||
cp->value = value;
|
||||
g_mutex_unlock (&self->lock);
|
||||
/* If the timestamp is the same just update the control point value */
|
||||
if (cp->timestamp == timestamp) {
|
||||
|
||||
g_signal_emit (self,
|
||||
gst_timed_value_control_source_signals[VALUE_CHANGED_SIGNAL], 0,
|
||||
cp);
|
||||
goto done;
|
||||
/* update control point */
|
||||
cp->value = value;
|
||||
g_mutex_unlock (&self->lock);
|
||||
|
||||
g_signal_emit (self,
|
||||
gst_timed_value_control_source_signals[VALUE_CHANGED_SIGNAL], 0,
|
||||
cp);
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue