*** ffmpeg.c.orig	Mon May 26 09:43:58 2008
--- ffmpeg.c	Mon May 26 09:58:05 2008
***************
*** 132,137 ****
--- 132,138 ----
  static int do_deinterlace = 0;
  static int strict = 0;
  static int top_field_first = -1;
+ static int ejo_interlaced = -1;
  static int me_threshold = 0;
  static int intra_dc_precision = 8;
  static int loop_input = 0;
***************
*** 873,879 ****
              big_picture= *final_picture;
              /* better than nothing: use input picture interlaced
                 settings */
!             big_picture.interlaced_frame = in_picture->interlaced_frame;
              if(avctx_opts[CODEC_TYPE_VIDEO]->flags & (CODEC_FLAG_INTERLACED_DCT|CODEC_FLAG_INTERLACED_ME)){
                  if(top_field_first == -1)
                      big_picture.top_field_first = in_picture->top_field_first;
--- 874,884 ----
              big_picture= *final_picture;
              /* better than nothing: use input picture interlaced
                 settings */
!             if(ejo_interlaced == -1)
!                 big_picture.interlaced_frame = in_picture->interlaced_frame;
!             else
!                 big_picture.interlaced_frame = ejo_interlaced;
! 
              if(avctx_opts[CODEC_TYPE_VIDEO]->flags & (CODEC_FLAG_INTERLACED_DCT|CODEC_FLAG_INTERLACED_ME)){
                  if(top_field_first == -1)
                      big_picture.top_field_first = in_picture->top_field_first;
***************
*** 1019,1026 ****
              float t = (av_gettime()-timer_start) / 1000000.0;
  
              frame_number = ost->frame_number;
!             snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "frame=%5d fps=%3d q=%3.1f ",
!                      frame_number, (t>1)?(int)(frame_number/t+0.5) : 0,
                       enc->coded_frame && !ost->st->stream_copy ?
                       enc->coded_frame->quality/(float)FF_QP2LAMBDA : -1);
              if(is_last_report)
--- 1024,1034 ----
              float t = (av_gettime()-timer_start) / 1000000.0;
  
              frame_number = ost->frame_number;
!             snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "frame=%5d%c fps=%3d q=%3.1f ",
!                      frame_number, 
!                      enc->coded_frame->interlaced_frame?
!                          (enc->coded_frame->top_field_first?'t':'b'):'p',
!                      (t>1)?(int)(frame_number/t+0.5) : 0,
                       enc->coded_frame && !ost->st->stream_copy ?
                       enc->coded_frame->quality/(float)FF_QP2LAMBDA : -1);
              if(is_last_report)
***************
*** 2501,2506 ****
--- 2509,2519 ----
      strict= atoi(arg);
  }
  
+ static void opt_ejo_interlaced(const char *arg)
+ {
+     ejo_interlaced= atoi(arg);
+ }
+ 
  static void opt_top_field_first(const char *arg)
  {
      top_field_first= atoi(arg);
***************
*** 3720,3725 ****
--- 3733,3739 ----
  #endif
      { "intra_matrix", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_intra_matrix}, "specify intra matrix coeffs", "matrix" },
      { "inter_matrix", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_inter_matrix}, "specify inter matrix coeffs", "matrix" },
+     { "interlace", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_ejo_interlaced}, "progressive=0/interlaced=1/auto=-1", "" },
      { "top", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_top_field_first}, "top=1/bottom=0/auto=-1 field first", "" },
      { "dc", OPT_INT | HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)&intra_dc_precision}, "intra_dc_precision", "precision" },
      { "vtag", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_video_tag}, "force video tag/fourcc", "fourcc/tag" },
