Revision 1435f2fa ffmpeg.c

View differences:

ffmpeg.c
245 245

  
246 246
static float dts_delta_threshold = 10;
247 247

  
248
static unsigned int sws_flags = SWS_BICUBIC;
249

  
250 248
static int64_t timer_start;
251 249

  
252 250
static uint8_t *audio_buf;
......
303 301
    AVAudioConvert *reformat_ctx;
304 302
    AVFifoBuffer *fifo;     /* for compression: one audio fifo per codec */
305 303
    FILE *logfile;
304

  
305
   int sws_flags;
306 306
} AVOutputStream;
307 307

  
308 308
static AVOutputStream **output_streams_for_file[MAX_FILES] = { NULL };
......
378 378
        snprintf(args, 255, "%d:%d:flags=0x%X",
379 379
                 codec->width,
380 380
                 codec->height,
381
                 (int)av_get_int(sws_opts, "sws_flags", NULL));
381
                 ost->sws_flags);
382 382
        if ((ret = avfilter_graph_create_filter(&filter, avfilter_get_by_name("scale"),
383 383
                                                NULL, args, NULL, graph)) < 0)
384 384
            return ret;
......
387 387
        last_filter = filter;
388 388
    }
389 389

  
390
    snprintf(args, sizeof(args), "flags=0x%X", (int)av_get_int(sws_opts, "sws_flags", NULL));
390
    snprintf(args, sizeof(args), "flags=0x%X", ost->sws_flags);
391 391
    graph->scale_sws_opts = av_strdup(args);
392 392

  
393 393
    if (vfilters) {
......
617 617
    }
618 618
    ost->file_index = file_idx;
619 619
    ost->index = idx;
620

  
621
    ost->sws_flags = av_get_int(sws_opts, "sws_flags", NULL);
620 622
    return ost;
621 623
}
622 624

  
......
1141 1143

  
1142 1144
            /* initialize a new scaler context */
1143 1145
            sws_freeContext(ost->img_resample_ctx);
1144
            sws_flags = av_get_int(sws_opts, "sws_flags", NULL);
1145 1146
            ost->img_resample_ctx = sws_getContext(
1146 1147
                ist->st->codec->width,
1147 1148
                ist->st->codec->height,
......
1149 1150
                ost->st->codec->width,
1150 1151
                ost->st->codec->height,
1151 1152
                ost->st->codec->pix_fmt,
1152
                sws_flags, NULL, NULL, NULL);
1153
                ost->sws_flags, NULL, NULL, NULL);
1153 1154
            if (ost->img_resample_ctx == NULL) {
1154 1155
                fprintf(stderr, "Cannot get resampling context\n");
1155 1156
                ffmpeg_exit(1);
......
2177 2178
                        fprintf(stderr, "Cannot allocate temp picture, check pix fmt\n");
2178 2179
                        ffmpeg_exit(1);
2179 2180
                    }
2180
                    sws_flags = av_get_int(sws_opts, "sws_flags", NULL);
2181 2181
                    ost->img_resample_ctx = sws_getContext(
2182 2182
                        icodec->width,
2183 2183
                        icodec->height,
......
2185 2185
                            codec->width,
2186 2186
                            codec->height,
2187 2187
                            codec->pix_fmt,
2188
                            sws_flags, NULL, NULL, NULL);
2188
                            ost->sws_flags, NULL, NULL, NULL);
2189 2189
                    if (ost->img_resample_ctx == NULL) {
2190 2190
                        fprintf(stderr, "Cannot get resampling context\n");
2191 2191
                        ffmpeg_exit(1);

Also available in: Unified diff