diff mbox series

[FFmpeg-devel,11/17] avformat/evc: don't use an AVIOContext as log context

Message ID 20230618234332.1370-1-jamrial@gmail.com
State New
Headers show
Series [FFmpeg-devel,1/3] avcodec/evc_frame_merge: use av_fast_realloc() | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 fail Make fate failed
andriy/make_x86 success Make finished
andriy/make_fate_x86 fail Make fate failed

Commit Message

James Almer June 18, 2023, 11:43 p.m. UTC
Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/evc_parse.h | 3 ++-
 libavformat/evc.c      | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

Comments

James Almer June 20, 2023, 2:38 p.m. UTC | #1
On 6/18/2023 8:43 PM, James Almer wrote:
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>   libavcodec/evc_parse.h | 3 ++-
>   libavformat/evc.c      | 4 ++--
>   2 files changed, 4 insertions(+), 3 deletions(-)

Dropped patches 11 and 12, pushed patches 13 to 17.
diff mbox series

Patch

diff --git a/libavcodec/evc_parse.h b/libavcodec/evc_parse.h
index a1fbbc643d..677e01a64a 100644
--- a/libavcodec/evc_parse.h
+++ b/libavcodec/evc_parse.h
@@ -105,7 +105,8 @@  static inline uint32_t evc_read_nal_unit_length(const uint8_t *bits, int bits_si
     uint32_t nalu_len = 0;
 
     if (bits_size < EVC_NALU_LENGTH_PREFIX_SIZE) {
-        av_log(logctx, AV_LOG_ERROR, "Can't read NAL unit length\n");
+        if (logctx) // Don't log without a context
+            av_log(logctx, AV_LOG_ERROR, "Can't read NAL unit length\n");
         return 0;
     }
 
diff --git a/libavformat/evc.c b/libavformat/evc.c
index dc75ccb56d..a7cc6167e8 100644
--- a/libavformat/evc.c
+++ b/libavformat/evc.c
@@ -359,7 +359,7 @@  int ff_isom_write_evcc(AVIOContext *pb, const uint8_t *data,
     evcc_init(&evcc);
 
     while (bytes_to_read > EVC_NALU_LENGTH_PREFIX_SIZE) {
-        nalu_size = evc_read_nal_unit_length(data, EVC_NALU_LENGTH_PREFIX_SIZE, pb);
+        nalu_size = evc_read_nal_unit_length(data, EVC_NALU_LENGTH_PREFIX_SIZE, NULL);
         if (nalu_size == 0) break;
 
         data += EVC_NALU_LENGTH_PREFIX_SIZE;
@@ -367,7 +367,7 @@  int ff_isom_write_evcc(AVIOContext *pb, const uint8_t *data,
 
         if (bytes_to_read < nalu_size) break;
 
-        nalu_type = evc_get_nalu_type(data, bytes_to_read, pb);
+        nalu_type = evc_get_nalu_type(data, bytes_to_read, NULL);
 
         // @see ISO/IEC 14496-15:2021 Coding of audio-visual objects - Part 15: section 12.3.3.3
         // NAL_unit_type indicates the type of the NAL units in the following array (which shall be all of that type);