mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-01-24 02:21:11 +01:00
avformat: Forward errors where possible
It is not uncommon to find code where the caller thinks to know better what the return value should be than the callee. E.g. something like "if (av_new_packet(pkt, size) < 0) return AVERROR(ENOMEM);". This commit changes several instances of this to instead forward the actual error. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
cb88cdf773
commit
c1e439d7e9
71 changed files with 310 additions and 275 deletions
|
|
@ -795,12 +795,13 @@ static int flv_read_close(AVFormatContext *s)
|
|||
|
||||
static int flv_get_extradata(AVFormatContext *s, AVStream *st, int size)
|
||||
{
|
||||
int ret;
|
||||
if (!size)
|
||||
return 0;
|
||||
|
||||
av_freep(&st->codecpar->extradata);
|
||||
if (ff_get_extradata(s, st->codecpar, s->pb, size) < 0)
|
||||
return AVERROR(ENOMEM);
|
||||
if ((ret = ff_get_extradata(s, st->codecpar, s->pb, size)) < 0)
|
||||
return ret;
|
||||
st->internal->need_context_update = 1;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue