aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-04-30 20:43:16 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-04-30 22:09:15 +0200
commit7d727f1338fb23ce26975ba0e5487d2fa5783d16 (patch)
tree080186557141e418db57e78461e9e1ac69706470 /ffmpeg.c
parenta2eef3e9f579db4278ff32cba6281452a163b05f (diff)
downloadffmpeg-7d727f1338fb23ce26975ba0e5487d2fa5783d16.tar.gz
LAVFAPI: avformat_alloc_output_context() / simplify usage of muxers.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index b61df524a9..bde23e0ba9 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -3779,30 +3779,13 @@ static void opt_output_file(const char *filename)
if (!strcmp(filename, "-"))
filename = "pipe:";
- oc = avformat_alloc_context();
+ oc = avformat_alloc_output_context(last_asked_format, NULL, filename);
+ last_asked_format = NULL;
if (!oc) {
print_error(filename, AVERROR(ENOMEM));
ffmpeg_exit(1);
}
-
- if (last_asked_format) {
- file_oformat = av_guess_format(last_asked_format, NULL, NULL);
- if (!file_oformat) {
- fprintf(stderr, "Requested output format '%s' is not a suitable output format\n", last_asked_format);
- ffmpeg_exit(1);
- }
- last_asked_format = NULL;
- } else {
- file_oformat = av_guess_format(NULL, filename, NULL);
- if (!file_oformat) {
- fprintf(stderr, "Unable to find a suitable output format for '%s'\n",
- filename);
- ffmpeg_exit(1);
- }
- }
-
- oc->oformat = file_oformat;
- av_strlcpy(oc->filename, filename, sizeof(oc->filename));
+ file_oformat= oc->oformat;
if (!strcmp(file_oformat->name, "ffm") &&
av_strstart(filename, "http:", NULL)) {