mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
gstdataqueue: Don't break ABI
The order of the field was wrong, and the size of the structure didn't end up being the same.
This commit is contained in:
parent
a813aad0ac
commit
01039b1671
2 changed files with 17 additions and 13 deletions
|
@ -277,7 +277,7 @@ gst_data_queue_locked_flush (GstDataQueue * queue)
|
|||
gst_data_queue_cleanup (queue);
|
||||
STATUS (queue, "after flushing");
|
||||
/* we deleted something... */
|
||||
if (queue->waiting_del)
|
||||
if (queue->abidata.ABI.waiting_del)
|
||||
g_cond_signal (queue->item_del);
|
||||
}
|
||||
|
||||
|
@ -384,9 +384,9 @@ gst_data_queue_set_flushing (GstDataQueue * queue, gboolean flushing)
|
|||
queue->flushing = flushing;
|
||||
if (flushing) {
|
||||
/* release push/pop functions */
|
||||
if (queue->waiting_add)
|
||||
if (queue->abidata.ABI.waiting_add)
|
||||
g_cond_signal (queue->item_add);
|
||||
if (queue->waiting_del)
|
||||
if (queue->abidata.ABI.waiting_del)
|
||||
g_cond_signal (queue->item_del);
|
||||
}
|
||||
GST_DATA_QUEUE_MUTEX_UNLOCK (queue);
|
||||
|
@ -432,9 +432,9 @@ gst_data_queue_push (GstDataQueue * queue, GstDataQueueItem * item)
|
|||
|
||||
/* signal might have removed some items */
|
||||
while (gst_data_queue_locked_is_full (queue)) {
|
||||
queue->waiting_del = TRUE;
|
||||
queue->abidata.ABI.waiting_del = TRUE;
|
||||
g_cond_wait (queue->item_del, queue->qlock);
|
||||
queue->waiting_del = FALSE;
|
||||
queue->abidata.ABI.waiting_del = FALSE;
|
||||
if (queue->flushing)
|
||||
goto flushing;
|
||||
}
|
||||
|
@ -448,7 +448,7 @@ gst_data_queue_push (GstDataQueue * queue, GstDataQueueItem * item)
|
|||
queue->cur_level.time += item->duration;
|
||||
|
||||
STATUS (queue, "after pushing");
|
||||
if (queue->waiting_add)
|
||||
if (queue->abidata.ABI.waiting_add)
|
||||
g_cond_signal (queue->item_add);
|
||||
|
||||
GST_DATA_QUEUE_MUTEX_UNLOCK (queue);
|
||||
|
@ -497,9 +497,9 @@ gst_data_queue_pop (GstDataQueue * queue, GstDataQueueItem ** item)
|
|||
GST_DATA_QUEUE_MUTEX_LOCK_CHECK (queue, flushing);
|
||||
|
||||
while (gst_data_queue_locked_is_empty (queue)) {
|
||||
queue->waiting_add = TRUE;
|
||||
queue->abidata.ABI.waiting_add = TRUE;
|
||||
g_cond_wait (queue->item_add, queue->qlock);
|
||||
queue->waiting_add = FALSE;
|
||||
queue->abidata.ABI.waiting_add = FALSE;
|
||||
if (queue->flushing)
|
||||
goto flushing;
|
||||
}
|
||||
|
@ -515,7 +515,7 @@ gst_data_queue_pop (GstDataQueue * queue, GstDataQueueItem ** item)
|
|||
queue->cur_level.time -= (*item)->duration;
|
||||
|
||||
STATUS (queue, "after popping");
|
||||
if (queue->waiting_del)
|
||||
if (queue->abidata.ABI.waiting_del)
|
||||
g_cond_signal (queue->item_del);
|
||||
|
||||
GST_DATA_QUEUE_MUTEX_UNLOCK (queue);
|
||||
|
@ -600,7 +600,7 @@ gst_data_queue_limits_changed (GstDataQueue * queue)
|
|||
g_return_if_fail (GST_IS_DATA_QUEUE (queue));
|
||||
|
||||
GST_DATA_QUEUE_MUTEX_LOCK (queue);
|
||||
if (queue->waiting_del) {
|
||||
if (queue->abidata.ABI.waiting_del) {
|
||||
GST_DEBUG ("signal del");
|
||||
g_cond_signal (queue->item_del);
|
||||
}
|
||||
|
|
|
@ -128,16 +128,20 @@ struct _GstDataQueue
|
|||
gpointer *checkdata;
|
||||
|
||||
GMutex *qlock; /* lock for queue (vs object lock) */
|
||||
gboolean waiting_add;
|
||||
GCond *item_add; /* signals buffers now available for reading */
|
||||
gboolean waiting_del;
|
||||
GCond *item_del; /* signals space now available for writing */
|
||||
gboolean flushing; /* indicates whether conditions where signalled because
|
||||
* of external flushing */
|
||||
GstDataQueueFullCallback fullcallback;
|
||||
GstDataQueueEmptyCallback emptycallback;
|
||||
|
||||
gpointer _gst_reserved[GST_PADDING - 4];
|
||||
union {
|
||||
struct {
|
||||
gboolean waiting_add;
|
||||
gboolean waiting_del;
|
||||
} ABI;
|
||||
gpointer _gst_reserved[GST_PADDING - 2];
|
||||
} abidata;
|
||||
};
|
||||
|
||||
struct _GstDataQueueClass
|
||||
|
|
Loading…
Reference in a new issue