Revision 01a3c821

View differences:

ffmpeg.c
256 256
    struct SwsContext *img_resample_ctx; /* for image resampling */
257 257
    int resample_height;
258 258
    int resample_width;
259
    int resample_pix_fmt;
259 260

  
260 261
    /* full frame size of first frame */
261 262
    int original_height;
......
938 939
        padding_src = NULL;
939 940
        final_picture = &ost->pict_tmp;
940 941
        if(  (ost->resample_height != (ist->st->codec->height - (ost->topBand  + ost->bottomBand)))
941
          || (ost->resample_width  != (ist->st->codec->width  - (ost->leftBand + ost->rightBand)))) {
942
          || (ost->resample_width  != (ist->st->codec->width  - (ost->leftBand + ost->rightBand)))
943
          || (ost->resample_pix_fmt!= ist->st->codec->pix_fmt) ) {
942 944

  
943
            fprintf(stderr,"Input Stream #%d.%d frame size changed to %dx%d\n", ist->file_index, ist->index, ist->st->codec->width, ist->st->codec->height);
945
            fprintf(stderr,"Input Stream #%d.%d frame size changed to %dx%d, %s\n", ist->file_index, ist->index, ist->st->codec->width, ist->st->codec->height,avcodec_get_pix_fmt_name(ist->st->codec->pix_fmt));
944 946
            /* keep bands proportional to the frame size */
945 947
            topBand    = ((int64_t)ist->st->codec->height * ost->original_topBand    / ost->original_height) & ~1;
946 948
            bottomBand = ((int64_t)ist->st->codec->height * ost->original_bottomBand / ost->original_height) & ~1;
......
960 962

  
961 963
            ost->resample_height = ist->st->codec->height - (ost->topBand  + ost->bottomBand);
962 964
            ost->resample_width  = ist->st->codec->width  - (ost->leftBand + ost->rightBand);
965
            ost->resample_pix_fmt= ist->st->codec->pix_fmt;
963 966

  
964 967
            /* initialize a new scaler context */
965 968
            sws_freeContext(ost->img_resample_ctx);
......
1937 1940

  
1938 1941
                    ost->resample_height = icodec->height - (frame_topBand  + frame_bottomBand);
1939 1942
                    ost->resample_width  = icodec->width  - (frame_leftBand + frame_rightBand);
1943
                    ost->resample_pix_fmt= icodec->pix_fmt;
1940 1944
                    codec->bits_per_raw_sample= 0;
1941 1945
                }
1942 1946
                ost->encoding_needed = 1;

Also available in: Unified diff