mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
pad: simplify some more
If we get a context in the chain functions we always need to do a full update of the context on the peer pad.
This commit is contained in:
parent
d3e0a37900
commit
f663c9770b
1 changed files with 5 additions and 16 deletions
21
gst/gstpad.c
21
gst/gstpad.c
|
@ -3491,13 +3491,8 @@ gst_pad_chain_data_unchecked (GstPad * pad, gboolean is_buffer, void *data,
|
|||
|
||||
if (G_LIKELY (context)) {
|
||||
GstContext *oldctx = GST_PAD_CONTEXT (pad);
|
||||
if (G_UNLIKELY (context != oldctx)) {
|
||||
GST_PAD_CONTEXT (pad) = context;
|
||||
gst_context_unref (oldctx);
|
||||
} else {
|
||||
gst_context_unref (context);
|
||||
context = NULL;
|
||||
}
|
||||
GST_PAD_CONTEXT (pad) = context;
|
||||
gst_context_unref (oldctx);
|
||||
}
|
||||
emit_signal = GST_PAD_DO_BUFFER_SIGNALS (pad) > 0;
|
||||
GST_OBJECT_UNLOCK (pad);
|
||||
|
@ -3771,8 +3766,7 @@ gst_pad_push_data (GstPad * pad, gboolean is_buffer, void *data,
|
|||
|
||||
/* if we have a context pending, push it along too */
|
||||
if (GST_PAD_IS_CONTEXT_PENDING (pad)) {
|
||||
context = GST_PAD_CONTEXT (pad);
|
||||
if (G_LIKELY (context))
|
||||
if (G_LIKELY ((context = GST_PAD_CONTEXT (pad))))
|
||||
gst_context_ref (context);
|
||||
GST_OBJECT_FLAG_UNSET (pad, GST_PAD_CONTEXT_PENDING);
|
||||
}
|
||||
|
@ -4433,13 +4427,8 @@ gst_pad_pull_range (GstPad * pad, guint64 offset, guint size,
|
|||
|
||||
if (G_UNLIKELY (context)) {
|
||||
GstContext *oldctx = GST_PAD_CONTEXT (pad);
|
||||
if (G_UNLIKELY (context != oldctx)) {
|
||||
GST_PAD_CONTEXT (pad) = context;
|
||||
gst_context_unref (oldctx);
|
||||
} else {
|
||||
gst_context_unref (context);
|
||||
context = NULL;
|
||||
}
|
||||
GST_PAD_CONTEXT (pad) = context;
|
||||
gst_context_unref (oldctx);
|
||||
}
|
||||
GST_OBJECT_UNLOCK (pad);
|
||||
|
||||
|
|
Loading…
Reference in a new issue