Message ID | 20220720144937.93133-4-zane@zanevaniperen.com |
---|---|
State | New |
Headers | show |
Series | [FFmpeg-devel,v2,1/4] avformat/argo_cvg: name unk{1, 2} fields correctly | expand |
Context | Check | Description |
---|---|---|
yinshiyou/make_loongarch64 | success | Make finished |
yinshiyou/make_fate_loongarch64 | success | Make fate finished |
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
Zane van Iperen: > Signed-off-by: Zane van Iperen <zane@zanevaniperen.com> > --- > libavformat/argo_cvg.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/libavformat/argo_cvg.c b/libavformat/argo_cvg.c > index 12465dcbcc..3d4abb4758 100644 > --- a/libavformat/argo_cvg.c > +++ b/libavformat/argo_cvg.c > @@ -162,6 +162,15 @@ static int argo_cvg_read_header(AVFormatContext *s) > if ((ret = argo_cvg_read_checksum(s->pb, &ctx->header, &ctx->checksum)) < 0) > return ret; > > + if (av_dict_set_int(&st->metadata, "loop", ctx->header.loop, 0) < 0) > + return AVERROR(ENOMEM); > + > + if (av_dict_set_int(&st->metadata, "reverb", ctx->header.reverb, 0) < 0) > + return AVERROR(ENOMEM); > + > + if (av_dict_set_int(&st->metadata, "checksum", ctx->checksum, 0) < 0) > + return AVERROR(ENOMEM); > + > par = st->codecpar; > par->codec_type = AVMEDIA_TYPE_AUDIO; > par->codec_id = AV_CODEC_ID_ADPCM_PSX; Don't second-guess error codes (unless you have a good reason to). - Andreas
On 21/7/22 08:00, Andreas Rheinhardt wrote: >> + if (av_dict_set_int(&st->metadata, "loop", ctx->header.loop, 0) < 0) >> + return AVERROR(ENOMEM); >> + >> + if (av_dict_set_int(&st->metadata, "reverb", ctx->header.reverb, 0) < 0) >> + return AVERROR(ENOMEM); >> + >> + if (av_dict_set_int(&st->metadata, "checksum", ctx->checksum, 0) < 0) >> + return AVERROR(ENOMEM); >> > Don't second-guess error codes (unless you have a good reason to). > Right, don't know why I did that... I'll apply in a few days (with the fixed return codes).
diff --git a/libavformat/argo_cvg.c b/libavformat/argo_cvg.c index 12465dcbcc..3d4abb4758 100644 --- a/libavformat/argo_cvg.c +++ b/libavformat/argo_cvg.c @@ -162,6 +162,15 @@ static int argo_cvg_read_header(AVFormatContext *s) if ((ret = argo_cvg_read_checksum(s->pb, &ctx->header, &ctx->checksum)) < 0) return ret; + if (av_dict_set_int(&st->metadata, "loop", ctx->header.loop, 0) < 0) + return AVERROR(ENOMEM); + + if (av_dict_set_int(&st->metadata, "reverb", ctx->header.reverb, 0) < 0) + return AVERROR(ENOMEM); + + if (av_dict_set_int(&st->metadata, "checksum", ctx->checksum, 0) < 0) + return AVERROR(ENOMEM); + par = st->codecpar; par->codec_type = AVMEDIA_TYPE_AUDIO; par->codec_id = AV_CODEC_ID_ADPCM_PSX;
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com> --- libavformat/argo_cvg.c | 9 +++++++++ 1 file changed, 9 insertions(+)