aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-05-10 04:01:29 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-05-10 04:03:17 +0200
commitb97b4b58a6e1ac595002b3e3f3469161771c6003 (patch)
tree8c2833931fb16084f95bf0adf8317e1fa28aca12 /ffmpeg.c
parent67d441499a042edcfb0f8a120e6196d10b1d13db (diff)
parenta88ef93b4abbea9f18c8750113dc9e99931f2f8a (diff)
downloadffmpeg-b97b4b58a6e1ac595002b3e3f3469161771c6003.tar.gz
Merge remote branch 'qatar/master'
* qatar/master: mpegaudiodec: group #includes more sanely mpegaudio: remove #if 0 blocks ffmpeg.c: reset avoptions after each input/output file. ffmpeg.c: store per-output stream sws flags. mpegaudio: remove CONFIG_MPEGAUDIO_HP option mpegtsenc: Clear st->priv_data when freeing it udp: Fix receiving RTP data over multicast rtpproto: Remove an unused variable regtest: fix wma tests NOT pulled: mpegaudio: remove CONFIG_AUDIO_NONSHORT regtest: separate flags for encoding and decoding Conflicts: ffmpeg.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index f47e281454..aa3c33d709 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -316,6 +316,8 @@ typedef struct AVOutputStream {
char *avfilter;
AVFilterGraph *graph;
#endif
+
+ int sws_flags;
} AVOutputStream;
static AVOutputStream **output_streams_for_file[MAX_FILES] = { NULL };
@@ -393,7 +395,7 @@ static int configure_video_filters(AVInputStream *ist, AVOutputStream *ost)
snprintf(args, 255, "%d:%d:flags=0x%X",
codec->width,
codec->height,
- (int)av_get_int(sws_opts, "sws_flags", NULL));
+ ost->sws_flags);
if ((ret = avfilter_graph_create_filter(&filter, avfilter_get_by_name("scale"),
NULL, args, NULL, ost->graph)) < 0)
return ret;
@@ -402,7 +404,7 @@ static int configure_video_filters(AVInputStream *ist, AVOutputStream *ost)
last_filter = filter;
}
- snprintf(args, sizeof(args), "flags=0x%X", (int)av_get_int(sws_opts, "sws_flags", NULL));
+ snprintf(args, sizeof(args), "flags=0x%X", ost->sws_flags);
ost->graph->scale_sws_opts = av_strdup(args);
if (ost->avfilter) {
@@ -690,6 +692,8 @@ static AVOutputStream *new_output_stream(AVFormatContext *oc, int file_idx)
}
ost->file_index = file_idx;
ost->index = idx;
+
+ ost->sws_flags = av_get_int(sws_opts, "sws_flags", NULL);
return ost;
}
@@ -1227,10 +1231,9 @@ static void do_video_out(AVFormatContext *s,
}
/* initialize a new scaler context */
sws_freeContext(ost->img_resample_ctx);
- sws_flags = av_get_int(sws_opts, "sws_flags", NULL);
ost->img_resample_ctx = sws_getContext(dec->width, dec->height, dec->pix_fmt,
enc->width, enc->height, enc->pix_fmt,
- sws_flags, NULL, NULL, NULL);
+ ost->sws_flags, NULL, NULL, NULL);
if (ost->img_resample_ctx == NULL) {
fprintf(stderr, "Cannot get resampling context\n");
ffmpeg_exit(1);
@@ -3406,6 +3409,8 @@ static void opt_input_file(const char *filename)
av_freep(&video_codec_name);
av_freep(&audio_codec_name);
av_freep(&subtitle_codec_name);
+ uninit_opts();
+ init_opts();
}
static void check_inputs(int *has_video_ptr,
@@ -3939,6 +3944,8 @@ static void opt_output_file(const char *filename)
set_context_opts(oc, avformat_opts, AV_OPT_FLAG_ENCODING_PARAM, NULL);
av_freep(&forced_key_frames);
+ uninit_opts();
+ init_opts();
}
/* same option as mencoder */