[FFmpeg-cvslog] fftools/ffmpeg_enc: simplify error handling for decoded_side_data setup

Anton Khirnov git at videolan.org
Wed Mar 27 12:41:55 EET 2024


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sat Mar 23 13:58:25 2024 +0100| [8fc1e1358b074d2e3655177faee8cde5857d59af] | committer: Anton Khirnov

fftools/ffmpeg_enc: simplify error handling for decoded_side_data setup

There is no need to free the already-added items, they will be freed
alongside the codec context. There is also little point in an error
message, as the only reason this can fail is malloc failure.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8fc1e1358b074d2e3655177faee8cde5857d59af
---

 fftools/ffmpeg_enc.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c
index 9397818acb..260af435e9 100644
--- a/fftools/ffmpeg_enc.c
+++ b/fftools/ffmpeg_enc.c
@@ -198,15 +198,8 @@ int enc_open(void *opaque, const AVFrame *frame)
                                            &enc_ctx->nb_decoded_side_data,
                                            frame->side_data[i],
                                            AV_FRAME_SIDE_DATA_FLAG_UNIQUE);
-            if (ret < 0) {
-                av_frame_side_data_free(
-                    &enc_ctx->decoded_side_data,
-                    &enc_ctx->nb_decoded_side_data);
-                av_log(NULL, AV_LOG_ERROR,
-                        "failed to configure video encoder: %s!\n",
-                        av_err2str(ret));
+            if (ret < 0)
                 return ret;
-            }
         }
     }
 



More information about the ffmpeg-cvslog mailing list