[FFmpeg-devel] [PATCH] examples/demuxing_decoding return value error

Even Wiik Thomassen e.thomassen at sportradar.com
Fri Dec 13 09:32:53 CET 2013


>> From: Even Wiik Thomassen <e.thomassen at sportradar.com>
>> Date: Thu, 12 Dec 2013 16:51:28 +0100
>> Subject: [PATCH] examples/demuxing_decoding: Return error when no codec found.
>>
>> The open_codec_context function, when it fails to find a codec, now
>> return -1 to signal an error.
>>
>> Before it would return the stream index, which was always >= 0, and
>> continue as if a codec was found. This change make it fail faster,
>> instead of repeated failed tries to decode frames with no codec.
>
> It should be AVERROR_DECODER_NOT_FOUND (which I dislike, but there is
> no point in complaining) or AVERROR(EINVAL). -1 usually is mapped to
> ENOPERM.
> 
> Looks correct otherwise.

I've attached an updated patch that uses AVERROR(EINVAL), as that seemed
more consistent with the rest of the file, and tested it.

Regards,
-- 
Even Wiik Thomassen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-examples-demuxing_decoding-Return-error-when-no-code.patch
Type: text/x-patch
Size: 1260 bytes
Desc: 0001-examples-demuxing_decoding-Return-error-when-no-code.patch
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20131213/df614c90/attachment.bin>


More information about the ffmpeg-devel mailing list