OSDN Git Service

When encoding anamorphic with lavc, ensure PAR values are 8-bit. Thanks, j45!
[handbrake-jp/handbrake-jp-git.git] / libhb / encxvid.c
index 6d869ae..1772389 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id: encxvid.c,v 1.10 2005/03/09 23:28:39 titer Exp $
 
    This file is part of the HandBrake source code.
-   Homepage: <http://handbrake.m0k.org/>.
+   Homepage: <http://handbrake.fr/>.
    It may be used under the terms of the GNU General Public License. */
 
 #include "hb.h"
@@ -131,7 +131,7 @@ void encxvidClose( hb_work_object_t * w )
         hb_log( "encxvid: closing libxvidcore" );
         xvid_encore( pv->xvid, XVID_ENC_DESTROY, NULL, NULL);
     }
-    
+
     free( pv );
     w->private_data = NULL;
 }
@@ -149,10 +149,18 @@ int encxvidWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
     xvid_enc_frame_t frame;
     hb_buffer_t * in = *buf_in, * buf;
 
+    /* If this is the last empty frame, we're done */
+    if(!in->data)
+    {
+       *buf_out        = NULL;
+       return HB_WORK_DONE;
+    }
+
     /* Should be way too large */
     buf = hb_buffer_init( 3 * job->width * job->height / 2 );
     buf->start = in->start;
     buf->stop  = in->stop;
+    //buf->chap  = in->chap;
 
     memset( &frame, 0, sizeof( frame ) );
 
@@ -186,7 +194,7 @@ int encxvidWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
     frame.quant_inter_matrix = NULL;
 
     buf->size = xvid_encore( pv->xvid, XVID_ENC_ENCODE, &frame, NULL );
-    buf->key = ( frame.out_flags & XVID_KEYFRAME );
+    buf->frametype = ( frame.out_flags & XVID_KEYFRAME ) ? HB_FRAME_KEY : HB_FRAME_REF;
 
     if( !pv->configDone )
     {