History

avfilter/dnn_backend_tf: Remove one level of indentation

Zhao Zhili committed 2 years ago

Commit d3db7bb1 parent 57a3c2c1 file · +32 −31Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/dnn/dnn_backend_tf.c+32−31
@@ -483,41 +483,42 @@ static void dnn_free_model_tf(DNNModel **model) · 482 unmodified lines
483{483{
484 TFModel *tf_model;484 TFModel *tf_model;
485 485
486 if (*model){486 if (!model || !*model)
487 tf_model = (*model)->model;487 return;
488 while (ff_safe_queue_size(tf_model->request_queue) != 0) {
489 TFRequestItem *item = ff_safe_queue_pop_front(tf_model->request_queue);
490 destroy_request_item(&item);
491 }
492 ff_safe_queue_destroy(tf_model->request_queue);
493 488
494 while (ff_queue_size(tf_model->lltask_queue) != 0) {489 tf_model = (*model)->model;
495 LastLevelTaskItem *item = ff_queue_pop_front(tf_model->lltask_queue);490 while (ff_safe_queue_size(tf_model->request_queue) != 0) {
496 av_freep(&item);491 TFRequestItem *item = ff_safe_queue_pop_front(tf_model->request_queue);
497 }492 destroy_request_item(&item);
498 ff_queue_destroy(tf_model->lltask_queue);493 }
494 ff_safe_queue_destroy(tf_model->request_queue);
499 495
500 while (ff_queue_size(tf_model->task_queue) != 0) {496 while (ff_queue_size(tf_model->lltask_queue) != 0) {
501 TaskItem *item = ff_queue_pop_front(tf_model->task_queue);497 LastLevelTaskItem *item = ff_queue_pop_front(tf_model->lltask_queue);
502 av_frame_free(&item->in_frame);498 av_freep(&item);
503 av_frame_free(&item->out_frame);499 }
504 av_freep(&item);500 ff_queue_destroy(tf_model->lltask_queue);
505 }
506 ff_queue_destroy(tf_model->task_queue);
507 501
508 if (tf_model->graph){502 while (ff_queue_size(tf_model->task_queue) != 0) {
509 TF_DeleteGraph(tf_model->graph);503 TaskItem *item = ff_queue_pop_front(tf_model->task_queue);
510 }504 av_frame_free(&item->in_frame);
511 if (tf_model->session){505 av_frame_free(&item->out_frame);
512 TF_CloseSession(tf_model->session, tf_model->status);506 av_freep(&item);
513 TF_DeleteSession(tf_model->session, tf_model->status);507 }
514 }508 ff_queue_destroy(tf_model->task_queue);
515 if (tf_model->status){509
516 TF_DeleteStatus(tf_model->status);510 if (tf_model->graph){
517 }511 TF_DeleteGraph(tf_model->graph);
518 av_freep(&tf_model);512 }
519 av_freep(&model);513 if (tf_model->session){
514 TF_CloseSession(tf_model->session, tf_model->status);
515 TF_DeleteSession(tf_model->session, tf_model->status);
516 }
517 if (tf_model->status){
518 TF_DeleteStatus(tf_model->status);
520 }519 }
520 av_freep(&tf_model);
521 av_freep(&model);
521}522}
522 523
523static DNNModel *dnn_load_model_tf(DnnContext *ctx, DNNFunctionType func_type, AVFilterContext *filter_ctx)524static DNNModel *dnn_load_model_tf(DnnContext *ctx, DNNFunctionType func_type, AVFilterContext *filter_ctx)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t