GST_OBJECT_LOCK (dec);
min_latency += dec->priv->min_latency;
- if (max_latency != GST_CLOCK_TIME_NONE) {
+ if (dec->priv->max_latency == GST_CLOCK_TIME_NONE) {
+ max_latency = GST_CLOCK_TIME_NONE;
+ } else if (max_latency != GST_CLOCK_TIME_NONE) {
max_latency += dec->priv->max_latency;
}
GST_OBJECT_UNLOCK (dec);
GST_OBJECT_LOCK (enc);
min_latency += priv->min_latency;
- if (max_latency != GST_CLOCK_TIME_NONE) {
- max_latency += priv->max_latency;
+ if (enc->priv->max_latency == GST_CLOCK_TIME_NONE) {
+ max_latency = GST_CLOCK_TIME_NONE;
+ } else if (max_latency != GST_CLOCK_TIME_NONE) {
+ max_latency += enc->priv->max_latency;
}
GST_OBJECT_UNLOCK (enc);