Report caps update only once per video resolution change.

This commit is contained in:
Gwenole Beauchesne 2011-07-22 15:34:48 +02:00
parent ab6efa04ca
commit 2f91c9e8c1

View file

@ -440,24 +440,24 @@ gst_vaapi_decoder_set_picture_size(
)
{
GstVaapiDecoderPrivate * const priv = decoder->priv;
g_object_freeze_notify(G_OBJECT(decoder));
gboolean size_changed = FALSE;
if (priv->width != width) {
GST_DEBUG("picture width changed to %d", width);
priv->width = width;
gst_caps_set_simple(priv->caps, "width", G_TYPE_INT, width, NULL);
g_object_notify(G_OBJECT(decoder), "caps");
size_changed = TRUE;
}
if (priv->height != height) {
GST_DEBUG("picture height changed to %d", height);
priv->height = height;
gst_caps_set_simple(priv->caps, "height", G_TYPE_INT, height, NULL);
g_object_notify(G_OBJECT(decoder), "caps");
size_changed = TRUE;
}
g_object_thaw_notify(G_OBJECT(decoder));
if (size_changed)
g_object_notify(G_OBJECT(decoder), "caps");
}
void