lavf: deprecate avformat_alloc_output_context() in favor of avformat_alloc_output_context2()

The new function accepts a slightly more intuitive order of paramters,
and returns an error code, thus allowing applications to report a
meaningful error message.
This commit is contained in:
Stefano Sabatini
2011-05-19 22:09:34 +02:00
parent 83db719777
commit 5ecdfd008b
6 changed files with 60 additions and 12 deletions

View File

@@ -443,10 +443,10 @@ int main(int argc, char **argv)
filename = argv[1];
/* allocate the output media context */
oc = avformat_alloc_output_context(NULL, NULL, filename);
avformat_alloc_output_context2(&oc, NULL, NULL, filename);
if (!oc) {
printf("Could not deduce output format from file extension: using MPEG.\n");
oc = avformat_alloc_output_context("mpeg", NULL, filename);
avformat_alloc_output_context2(&oc, NULL, "mpeg", filename);
}
if (!oc) {
exit(1);