doc/examples/qsv_transcode: EINVAL is more appropriate and ENAVAIL will fail build with visual studio

Signed-off-by: clarkh <hungkuishing@outlook.com>
This commit is contained in:
hung kuishing 2023-12-07 06:44:06 +00:00 committed by Haihao Xiang
parent 8d24a28d06
commit 6d129d8df5

View File

@ -62,10 +62,10 @@ static int str_to_dict(char* optstr, AVDictionary **opt)
return 0;
key = strtok(optstr, " ");
if (key == NULL)
return AVERROR(ENAVAIL);
return AVERROR(EINVAL);
value = strtok(NULL, " ");
if (value == NULL)
return AVERROR(ENAVAIL);
return AVERROR(EINVAL);
av_dict_set(opt, key, value, 0);
do {
key = strtok(NULL, " ");
@ -73,7 +73,7 @@ static int str_to_dict(char* optstr, AVDictionary **opt)
return 0;
value = strtok(NULL, " ");
if (value == NULL)
return AVERROR(ENAVAIL);
return AVERROR(EINVAL);
av_dict_set(opt, key, value, 0);
} while(key != NULL);
return 0;
@ -181,7 +181,7 @@ static int open_input_file(char *filename)
break;
default:
fprintf(stderr, "Codec is not supportted by qsv\n");
return AVERROR(ENAVAIL);
return AVERROR(EINVAL);
}
if (!(decoder_ctx = avcodec_alloc_context3(decoder)))