summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZebediah Figura <z.figura12@gmail.com>2020-10-21 14:55:40 -0500
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>2020-10-22 08:05:20 +0000
commite999318fd7f6384fed9962597b326ec77ebf452d (patch)
treea6c9a4240104b7d43b1acf8c952be215ce26abb8
parentc9d15fec7e5bc6c0eb2d736f467318c4fcacb17e (diff)
theoradec: Set telemetry options only if they are nonzero
Setting telemetry options, even to zero, causes libtheora to enable an expensive code path. For large enough videos (e.g. 1920x1080) this can increase the time to decode each frame by 30-40 ms, which can be enough to cause noticeable stutter. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/887>
-rw-r--r--ext/theora/gsttheoradec.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/ext/theora/gsttheoradec.c b/ext/theora/gsttheoradec.c
index 862aa1698..e76374a23 100644
--- a/ext/theora/gsttheoradec.c
+++ b/ext/theora/gsttheoradec.c
@@ -471,19 +471,23 @@ theora_handle_type_packet (GstTheoraDec * dec)
/* done */
dec->decoder = th_decode_alloc (&dec->info, dec->setup);
- if (th_decode_ctl (dec->decoder, TH_DECCTL_SET_TELEMETRY_MV,
+ if (dec->telemetry_mv &&
+ th_decode_ctl (dec->decoder, TH_DECCTL_SET_TELEMETRY_MV,
&dec->telemetry_mv, sizeof (dec->telemetry_mv)) != TH_EIMPL) {
GST_WARNING_OBJECT (dec, "Could not enable MV visualisation");
}
- if (th_decode_ctl (dec->decoder, TH_DECCTL_SET_TELEMETRY_MBMODE,
+ if (dec->telemetry_mbmode &&
+ th_decode_ctl (dec->decoder, TH_DECCTL_SET_TELEMETRY_MBMODE,
&dec->telemetry_mbmode, sizeof (dec->telemetry_mbmode)) != TH_EIMPL) {
GST_WARNING_OBJECT (dec, "Could not enable MB mode visualisation");
}
- if (th_decode_ctl (dec->decoder, TH_DECCTL_SET_TELEMETRY_QI,
+ if (dec->telemetry_qi &&
+ th_decode_ctl (dec->decoder, TH_DECCTL_SET_TELEMETRY_QI,
&dec->telemetry_qi, sizeof (dec->telemetry_qi)) != TH_EIMPL) {
GST_WARNING_OBJECT (dec, "Could not enable QI mode visualisation");
}
- if (th_decode_ctl (dec->decoder, TH_DECCTL_SET_TELEMETRY_BITS,
+ if (dec->telemetry_bits &&
+ th_decode_ctl (dec->decoder, TH_DECCTL_SET_TELEMETRY_BITS,
&dec->telemetry_bits, sizeof (dec->telemetry_bits)) != TH_EIMPL) {
GST_WARNING_OBJECT (dec, "Could not enable BITS mode visualisation");
}