Although rare, extradata can be present but empty and extraction will fail.
However Android also supports passing codec-specific data inline and
will likely play such a stream anyway. So there's no reason to abort
initialization before we know for sure.
---
 libavcodec/mediacodecdec.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/mediacodecdec.c b/libavcodec/mediacodecdec.c
index ac1725e466..67adefb530 100644
--- a/libavcodec/mediacodecdec.c
+++ b/libavcodec/mediacodecdec.c
@@ -167,8 +167,8 @@ static int h264_set_extradata(AVCodecContext *avctx, FFAMediaFormat *format) ff_AMediaFormat_setBuffer(format, "csd-1", (void*)data, data_size);
         av_freep(&data);
     } else {
- av_log(avctx, AV_LOG_ERROR, "Could not extract PPS/SPS from extradata");
-        ret = AVERROR_INVALIDDATA;
+ av_log(avctx, AV_LOG_WARNING, "Could not extract PPS/SPS from extradata\n");
+        ret = 0;
     }
  done:
@@ -254,8 +254,8 @@ static int hevc_set_extradata(AVCodecContext *avctx, FFAMediaFormat *format)
          av_freep(&data);
     } else {
- av_log(avctx, AV_LOG_ERROR, "Could not extract VPS/PPS/SPS from extradata");
-        ret = AVERROR_INVALIDDATA;
+ av_log(avctx, AV_LOG_WARNING, "Could not extract VPS/PPS/SPS from extradata\n");
+        ret = 0;
     }
  done:
--
2.30.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to