Revision 0f230c53

View differences:

ffmpeg.c
1141 1141
                         AVFrame *in_picture,
1142 1142
                         int *frame_size)
1143 1143
{
1144
    int nb_frames, i, ret;
1144
    int nb_frames, i, ret, resample_changed;
1145 1145
    AVFrame *final_picture, *formatted_picture, *resampling_dst;
1146 1146
    AVCodecContext *enc, *dec;
1147 1147
    double sync_ipts;
......
1189 1189
    final_picture = formatted_picture;
1190 1190
    resampling_dst = &ost->pict_tmp;
1191 1191

  
1192
    if (   ost->resample_height != ist->st->codec->height
1193
        || ost->resample_width  != ist->st->codec->width
1194
        || (ost->resample_pix_fmt!= ist->st->codec->pix_fmt) ) {
1192
    resample_changed = ost->resample_width   != dec->width  ||
1193
                       ost->resample_height  != dec->height ||
1194
                       ost->resample_pix_fmt != dec->pix_fmt;
1195

  
1196
    if (resample_changed) {
1195 1197
        av_log(NULL, AV_LOG_INFO,
1196 1198
               "Input stream #%d.%d frame changed from size:%dx%d fmt:%s to size:%dx%d fmt:%s\n",
1197 1199
               ist->file_index, ist->index,
......
1204 1206
#if !CONFIG_AVFILTER
1205 1207
    if (ost->video_resample) {
1206 1208
        final_picture = &ost->pict_tmp;
1207
        if(  ost->resample_height != ist->st->codec->height
1208
          || ost->resample_width  != ist->st->codec->width
1209
          || (ost->resample_pix_fmt!= ist->st->codec->pix_fmt) ) {
1210

  
1209
        if (resample_changed) {
1211 1210
            /* initialize a new scaler context */
1212 1211
            sws_freeContext(ost->img_resample_ctx);
1213 1212
            sws_flags = av_get_int(sws_opts, "sws_flags", NULL);

Also available in: Unified diff