MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / main

Function main

tools/ffhash.c:118–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118int main(int argc, char **argv)
119{
120 int i;
121 int ret = 0;
122 const char *hash_name;
123
124 if (argc == 1) {
125 usage();
126 return 0;
127 }
128
129 hash_name = argv[1];
130 out_b64 = av_strstart(hash_name, "b64:", &hash_name);
131 if ((ret = av_hash_alloc(&hash, hash_name)) < 0) {
132 switch(ret) {
133 case AVERROR(EINVAL):
134 printf("Invalid hash type: %s\n", hash_name);
135 break;
136 case AVERROR(ENOMEM):
137 printf("%s\n", strerror(errno));
138 break;
139 }
140 return 1;
141 }
142
143 for (i = 2; i < argc; i++)
144 ret |= check(argv[i]);
145
146 if (argc < 3)
147 ret |= check(NULL);
148
149 av_hash_freep(&hash);
150
151 return ret;
152}

Callers

nothing calls this directly

Calls 5

av_strstartFunction · 0.85
av_hash_allocFunction · 0.85
av_hash_freepFunction · 0.85
usageFunction · 0.70
checkFunction · 0.70

Tested by

no test coverage detected