1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

yuv4mpegenc: do not access AVCodecContext.coded_frame

Its contents are meaningful only if the stream codec context is the one
actually used for encoding, which is often not the case (and is
discouraged).

Use AVCodecContext.field_order instead.
This commit is contained in:
Anton Khirnov 2014-07-05 06:44:00 +00:00
parent 27c1f82f56
commit 650d384048

View File

@ -48,9 +48,11 @@ static int yuv4_generate_header(AVFormatContext *s, char* buf)
if (aspectn == 0 && aspectd == 1) if (aspectn == 0 && aspectd == 1)
aspectd = 0; // 0:0 means unknown aspectd = 0; // 0:0 means unknown
inter = 'p'; /* progressive is the default */ switch (st->codec->field_order) {
if (st->codec->coded_frame && st->codec->coded_frame->interlaced_frame) case AV_FIELD_TT: inter = 't'; break;
inter = st->codec->coded_frame->top_field_first ? 't' : 'b'; case AV_FIELD_BB: inter = 'b'; break;
default: inter = 'p'; break;
}
switch (st->codec->pix_fmt) { switch (st->codec->pix_fmt) {
case AV_PIX_FMT_GRAY8: case AV_PIX_FMT_GRAY8: