[FFmpeg-devel] [PATCH] examples/hw_decode: Use hw-config information to find pixfmt

Timo Rothenpieler timo at rothenpieler.org
Wed Nov 29 14:41:29 EET 2017


Am 29.11.2017 um 13:22 schrieb Moritz Barsnick:
> On Wed, Nov 29, 2017 at 00:34:03 +0000, Mark Thompson wrote:
>> +    if (type == AV_HWDEVICE_TYPE_NONE) {
>> +        fprintf(stderr, "Device type %s is not supported.\n", argv[1]);
>> +        fprintf(stderr, "Available device types:");
>> +        type = AV_HWDEVICE_TYPE_NONE;
>> +        while((type = av_hwdevice_iterate_types(type)) != AV_HWDEVICE_TYPE_NONE)
>> +            fprintf(stderr, " %s", av_hwdevice_get_type_name(type));
> 
> I see what you're trying to do with "type = AV_HWDEVICE_TYPE_NONE"
> (initialize the iterator), but the assignment is redundant.
> 
> I guess if the compiler optimizes it away anyway, it may be good for
> readability, especially since it's an example. *shrug*

I fail to see how the assignment is redundant?
Without the assignment, that would be an infinite loop.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3994 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20171129/8d82ea3a/attachment.bin>


More information about the ffmpeg-devel mailing list