mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 16:50:47 +00:00
theora: Add assertions that functions don't fail
Some functions in libtheora can return an error, but that error cannot ever happen inside theoraenc. In those cases assert that it doesn't.
This commit is contained in:
parent
7ba0a36a07
commit
9d4f72f2fa
1 changed files with 7 additions and 1 deletions
|
@ -351,8 +351,12 @@ theora_enc_finalize (GObject * object)
|
|||
static void
|
||||
theora_enc_reset (GstTheoraEnc * enc)
|
||||
{
|
||||
int result;
|
||||
|
||||
theora_clear (&enc->state);
|
||||
theora_encode_init (&enc->state, &enc->info);
|
||||
result = theora_encode_init (&enc->state, &enc->info);
|
||||
/* We ensure this function cannot fail. */
|
||||
g_assert (result == 0);
|
||||
#ifdef TH_ENCCTL_SET_SPLEVEL
|
||||
theora_control (&enc->state, TH_ENCCTL_SET_SPLEVEL, &enc->speed_level,
|
||||
sizeof (enc->speed_level));
|
||||
|
@ -1062,6 +1066,8 @@ theora_enc_chain (GstPad * pad, GstBuffer * buffer)
|
|||
}
|
||||
|
||||
res = theora_encode_YUVin (&enc->state, &yuv);
|
||||
/* none of the failure cases can happen here */
|
||||
g_assert (res == 0);
|
||||
|
||||
ret = GST_FLOW_OK;
|
||||
while (theora_encode_packetout (&enc->state, 0, &op)) {
|
||||
|
|
Loading…
Reference in a new issue