[FFmpeg-devel] [FFmpeg-cvslog] avcodec/libdav1d: fix build after a recent API break
Carl Eugen Hoyos
ceffmpeg at gmail.com
Wed Nov 14 17:35:42 EET 2018
2018-11-14 16:19 GMT+01:00, James Almer <jamrial at gmail.com>:
> On 11/14/2018 12:03 PM, Carl Eugen Hoyos wrote:
>> 2018-11-14 14:06 GMT+01:00, James Almer <git at videolan.org>:
>>> ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Wed Nov 14
>>> 10:05:25 2018 -0300| [752659327d4ac73640781376d214a26765f971f4] |
>>> committer:
>>> James Almer
>>>
>>> avcodec/libdav1d: fix build after a recent API break
>>>
>>> Signed-off-by: James Almer <jamrial at gmail.com>
>>>
>>>> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=752659327d4ac73640781376d214a26765f971f4
>>> ---
>>>
>>> libavcodec/libdav1d.c | 12 +++++++++---
>>> 1 file changed, 9 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
>>> index 873adfda40..b19aee4e9e 100644
>>> --- a/libavcodec/libdav1d.c
>>> +++ b/libavcodec/libdav1d.c
>>> @@ -140,12 +140,18 @@ static int libdav1d_receive_frame(AVCodecContext
>>> *c,
>>> AVFrame *frame)
>>> }
>>>
>>> av_fifo_generic_write(dav1d->cache, &pkt, sizeof(pkt),
>>> libdav1d_fifo_write);
>>> - } else {
>>> - data = NULL;
>>> }
>>> }
>>>
>>> - res = dav1d_decode(dav1d->c, data, &p);
>>> + res = dav1d_send_data(dav1d->c, data);
>>> + if (res < 0) {
>>> + if (res == -EINVAL)
>>> + res = AVERROR_INVALIDDATA;
>>
>>> + if (res != -EAGAIN)
>>
>> How does this line make sense?
>
> We're meant to keep going and fetch decoded frames even if the library
> refuses new data. Eventually it will consume it once its internal data
> buffer is depleted.
>
> We're only mean to abort on other errno values, like -EINVAL (Which for
> ffmpeg is AVERROR_INVALIDDATA).
Thank you!
Carl Eugen
More information about the ffmpeg-devel
mailing list