On Mon, 7 Jul 2014 16:28:46 -0400, Vittorio Giovara 
<[email protected]> wrote:
> On Sat, Jul 5, 2014 at 5:20 AM, Anton Khirnov <[email protected]> wrote:
> > 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.
> > ---
> >  libavformat/yuv4mpegenc.c | 8 +++++---
> >  1 file changed, 5 insertions(+), 3 deletions(-)
> >
> > 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;
> > +    }
> 
> This would mark a AV_FIELD_TB and a AV_FIELD_BT context as progressive, no?

Which is the same it does currently.
Besides, it makes no sense for raw video.

-- 
Anton Khirnov
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to