History

avfilter/dnn_backend_tf: Remove one level of indentation

Zhao Zhili committed 2 years ago

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

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
483483 {
484484 TFModel *tf_model;
485485
486− if (*model){
487− tf_model = (*model)->model;
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);
486+ if (!model || !*model)
487+ return;
493488
494− while (ff_queue_size(tf_model->lltask_queue) != 0) {
495− LastLevelTaskItem *item = ff_queue_pop_front(tf_model->lltask_queue);
496− av_freep(&item);
497− }
498− ff_queue_destroy(tf_model->lltask_queue);
489+ tf_model = (*model)->model;
490+ while (ff_safe_queue_size(tf_model->request_queue) != 0) {
491+ TFRequestItem *item = ff_safe_queue_pop_front(tf_model->request_queue);
492+ destroy_request_item(&item);
493+ }
494+ ff_safe_queue_destroy(tf_model->request_queue);
499495
500− while (ff_queue_size(tf_model->task_queue) != 0) {
501− TaskItem *item = ff_queue_pop_front(tf_model->task_queue);
502− av_frame_free(&item->in_frame);
503− av_frame_free(&item->out_frame);
504− av_freep(&item);
505− }
506− ff_queue_destroy(tf_model->task_queue);
496+ while (ff_queue_size(tf_model->lltask_queue) != 0) {
497+ LastLevelTaskItem *item = ff_queue_pop_front(tf_model->lltask_queue);
498+ av_freep(&item);
499+ }
500+ ff_queue_destroy(tf_model->lltask_queue);
507501
508− if (tf_model->graph){
509− TF_DeleteGraph(tf_model->graph);
510− }
511− if (tf_model->session){
512− TF_CloseSession(tf_model->session, tf_model->status);
513− TF_DeleteSession(tf_model->session, tf_model->status);
514− }
515− if (tf_model->status){
516− TF_DeleteStatus(tf_model->status);
517− }
518− av_freep(&tf_model);
519− av_freep(&model);
502+ while (ff_queue_size(tf_model->task_queue) != 0) {
503+ TaskItem *item = ff_queue_pop_front(tf_model->task_queue);
504+ av_frame_free(&item->in_frame);
505+ av_frame_free(&item->out_frame);
506+ av_freep(&item);
507+ }
508+ ff_queue_destroy(tf_model->task_queue);
509+
510+ if (tf_model->graph){
511+ TF_DeleteGraph(tf_model->graph);
512+ }
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);
520519 }
520+ av_freep(&tf_model);
521+ av_freep(&model);
521522 }
522523
523524 static 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