[SCM] libav/experimental: yuv4mpegenc: do not access AVCodecContext.coded_frame
siretart at users.alioth.debian.org
siretart at users.alioth.debian.org
Sun Aug 10 16:03:48 UTC 2014
The following commit has been merged in the experimental branch:
commit 650d384048ed42579cc6d67bf32a94b468c0b6cb
Author: Anton Khirnov <anton at khirnov.net>
Date: Sat Jul 5 06:44:00 2014 +0000
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.
diff --git a/libavformat/yuv4mpegenc.c b/libavformat/yuv4mpegenc.c
index abe967f..2caa364 100644
--- a/libavformat/yuv4mpegenc.c
+++ b/libavformat/yuv4mpegenc.c
@@ -48,9 +48,11 @@ static int yuv4_generate_header(AVFormatContext *s, char* buf)
if (aspectn == 0 && aspectd == 1)
aspectd = 0; // 0:0 means unknown
- inter = 'p'; /* progressive is the default */
- if (st->codec->coded_frame && st->codec->coded_frame->interlaced_frame)
- inter = st->codec->coded_frame->top_field_first ? 't' : 'b';
+ switch (st->codec->field_order) {
+ case AV_FIELD_TT: inter = 't'; break;
+ case AV_FIELD_BB: inter = 'b'; break;
+ default: inter = 'p'; break;
+ }
switch (st->codec->pix_fmt) {
case AV_PIX_FMT_GRAY8:
--
Libav/FFmpeg packaging
More information about the pkg-multimedia-commits
mailing list