mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-05 14:50:25 +00:00
avcodec/mediacodecenc: Extract configOBUs from AV1CodecConfigurationRecord
MediaCodec can generate AV1CodecConfigurationRecord, which shouldn't be put into packet->data. Skip four bytes and extract configOBUs if it exist. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
This commit is contained in:
parent
0552238570
commit
0ee18ff23d
@ -429,6 +429,16 @@ static int mediacodec_receive(AVCodecContext *avctx, AVPacket *pkt)
|
||||
}
|
||||
|
||||
if (out_info.flags & ff_AMediaCodec_getBufferFlagCodecConfig(codec)) {
|
||||
if (avctx->codec_id == AV_CODEC_ID_AV1) {
|
||||
// Skip AV1CodecConfigurationRecord without configOBUs
|
||||
if (out_info.size <= 4) {
|
||||
ff_AMediaCodec_releaseOutputBuffer(codec, index, false);
|
||||
return mediacodec_receive(avctx, pkt);
|
||||
}
|
||||
out_info.size -= 4;
|
||||
out_info.offset += 4;
|
||||
}
|
||||
|
||||
ret = av_reallocp(&s->extradata, out_info.size);
|
||||
if (ret)
|
||||
goto bailout;
|
||||
|
Loading…
Reference in New Issue
Block a user