Ticket #428: patchavisynthupsidedown.diff

File patchavisynthupsidedown.diff, 1.0 KB (added by chinshou, 5 years ago)
  • libavformat/avisynth.c

    diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c
    index e41e1c0..af13bce 100644
    a b static int avisynth_read_header(AVFormatContext *s, AVFormatParameters *ap) 
    122122                  st->codec->bit_rate = (uint64_t)stream->info.dwSampleSize * (uint64_t)stream->info.dwRate * 8 / (uint64_t)stream->info.dwScale; 
    123123                  st->codec->codec_tag = imgfmt.bmiHeader.biCompression; 
    124124                  st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, imgfmt.bmiHeader.biCompression); 
     125                  if (st->codec->codec_id == CODEC_ID_RAWVIDEO && imgfmt.bmiHeader.biCompression== BI_RGB) { 
     126                    st->codec->extradata = av_malloc(9 + FF_INPUT_BUFFER_PADDING_SIZE); 
     127                    if (st->codec->extradata) { 
     128                      st->codec->extradata_size = 9; 
     129                      memcpy(st->codec->extradata, "BottomUp", 9); 
     130                    } 
     131                  } 
     132 
    125133 
    126134                  st->duration = stream->info.dwLength; 
    127135                }