Skip to content

Commit 23d4b31

Browse files
committed
Fix opus_demo -e/-d with weights blob
1 parent 1bb6d78 commit 23d4b31

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/opus_demo.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -803,9 +803,9 @@ int main(int argc, char *argv[])
803803
dred_dec = opus_dred_decoder_create(&err);
804804
dred = opus_dred_alloc(&err);
805805
#ifdef USE_WEIGHTS_FILE
806-
opus_encoder_ctl(enc, OPUS_SET_DNN_BLOB(blob_data, blob_len));
807-
opus_decoder_ctl(dec, OPUS_SET_DNN_BLOB(blob_data, blob_len));
808-
opus_dred_decoder_ctl(dred_dec, OPUS_SET_DNN_BLOB(blob_data, blob_len));
806+
if (enc) opus_encoder_ctl(enc, OPUS_SET_DNN_BLOB(blob_data, blob_len));
807+
if (dec) opus_decoder_ctl(dec, OPUS_SET_DNN_BLOB(blob_data, blob_len));
808+
if (dred_dec) opus_dred_decoder_ctl(dred_dec, OPUS_SET_DNN_BLOB(blob_data, blob_len));
809809
#endif
810810
while (!stop)
811811
{

0 commit comments

Comments
 (0)