avformat/movenc: remove one level of indentation

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2024-04-23 12:46:49 -03:00
parent 63702d5f9c
commit ce33a5f16d
1 changed files with 25 additions and 30 deletions

View File

@ -6672,6 +6672,7 @@ static int mov_write_subtitle_end_packet(AVFormatContext *s,
#if CONFIG_IAMFENC #if CONFIG_IAMFENC
static int mov_build_iamf_packet(AVFormatContext *s, MOVTrack *trk, AVPacket *pkt) static int mov_build_iamf_packet(AVFormatContext *s, MOVTrack *trk, AVPacket *pkt)
{ {
uint8_t *data;
int ret; int ret;
if (pkt->stream_index == trk->first_iamf_idx) { if (pkt->stream_index == trk->first_iamf_idx) {
@ -6685,40 +6686,34 @@ static int mov_build_iamf_packet(AVFormatContext *s, MOVTrack *trk, AVPacket *pk
if (ret < 0) if (ret < 0)
return ret; return ret;
if (pkt->stream_index == trk->last_iamf_idx) { if (pkt->stream_index != trk->last_iamf_idx)
uint8_t *data; return AVERROR(EAGAIN);
ret = avio_close_dyn_buf(trk->iamf_buf, &data); ret = avio_close_dyn_buf(trk->iamf_buf, &data);
trk->iamf_buf = NULL; trk->iamf_buf = NULL;
if (!ret) {
if (!ret) { if (pkt->size) {
if (pkt->size) { // Either all or none of the packets for a single
// Either all or none of the packets for a single // IA Sample may be empty.
// IA Sample may be empty. av_log(s, AV_LOG_ERROR, "Unexpected packet from "
av_log(s, AV_LOG_ERROR, "Unexpected packet from " "stream #%d\n", pkt->stream_index);
"stream #%d\n", pkt->stream_index); ret = AVERROR_INVALIDDATA;
ret = AVERROR_INVALIDDATA;
}
av_free(data);
return ret;
} }
av_buffer_unref(&pkt->buf); av_free(data);
pkt->buf = av_buffer_create(data, ret, NULL, NULL, 0); return ret;
if (!pkt->buf) { }
av_free(data);
return AVERROR(ENOMEM);
}
pkt->data = data;
pkt->size = ret;
pkt->stream_index = trk->first_iamf_idx;
ret = avio_open_dyn_buf(&trk->iamf_buf); av_buffer_unref(&pkt->buf);
if (ret < 0) pkt->buf = av_buffer_create(data, ret, NULL, NULL, 0);
return ret; if (!pkt->buf) {
} else av_free(data);
ret = AVERROR(EAGAIN); return AVERROR(ENOMEM);
}
pkt->data = data;
pkt->size = ret;
pkt->stream_index = trk->first_iamf_idx;
return ret; return avio_open_dyn_buf(&trk->iamf_buf);
} }
#endif #endif