[FFmpeg-cvslog] dv: Set FS flag from AVFrame.top_field_first

Tomas Härdin git at videolan.org
Mon Oct 15 18:54:07 CEST 2012


ffmpeg | branch: master | Tomas Härdin <tomas.hardin at codemill.se> | Mon Oct 15 17:15:37 2012 +0200| [8cbb8f53575d40a26d5b1d065acb0a85bbb15e74] | committer: Michael Niedermayer

dv: Set FS flag from AVFrame.top_field_first

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8cbb8f53575d40a26d5b1d065acb0a85bbb15e74
---

 libavcodec/dv.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/dv.c b/libavcodec/dv.c
index a7dfbdc..5b4ad23 100644
--- a/libavcodec/dv.c
+++ b/libavcodec/dv.c
@@ -818,6 +818,7 @@ static inline int dv_write_pack(enum dv_pack_type pack_id, DVVideoContext *c,
      *      compression scheme (if any).
      */
     int apt   = (c->sys->pix_fmt == AV_PIX_FMT_YUV420P ? 0 : 1);
+    int fs    = c->picture.top_field_first ? 0x00 : 0x40;
 
     uint8_t aspect = 0;
     if ((int)(av_q2d(c->avctx->sample_aspect_ratio) * c->avctx->width / c->avctx->height * 10) >= 17) /* 16:9 */
@@ -856,7 +857,7 @@ static inline int dv_write_pack(enum dv_pack_type pack_id, DVVideoContext *c,
           buf[2] = 0xc8 |     /* reserved -- always b11001xxx */
                    aspect;
           buf[3] = (1 << 7) | /* frame/field flag 1 -- frame, 0 -- field */
-                   (1 << 6) | /* first/second field flag 0 -- field 2, 1 -- field 1 */
+                   fs       | /* first/second field flag 0 -- field 2, 1 -- field 1 */
                    (1 << 5) | /* frame change flag 0 -- same picture as before, 1 -- different */
                    (1 << 4) | /* 1 - interlaced, 0 - noninterlaced */
                    0xc;       /* reserved -- always b1100 */



More information about the ffmpeg-cvslog mailing list