]> git.sesse.net Git - vlc/blobdiff - modules/stream_out/switcher.c
Make Zorglub less unhappy
[vlc] / modules / stream_out / switcher.c
index afdb85821431ce1d293371a8458af2626be071d5..46391110f7e81b9ad46eb64012f14f2edec58065 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * switcher.c: MPEG2 video switcher module
  *****************************************************************************
- * Copyright (C) 2004 VideoLAN
+ * Copyright (C) 2004 the VideoLAN team
  * $Id$
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
@@ -740,8 +740,13 @@ static mtime_t VideoCommand( sout_stream_t *p_stream, sout_stream_id_t *id )
                    i_aspect_num * (int64_t)id->ff_enc_c->height,
                    i_aspect_den * (int64_t)id->ff_enc_c->width, 1 << 30 );
 
+#if LIBAVCODEC_BUILD >= 4754
+        id->ff_enc_c->time_base.num = 1;
+        id->ff_enc_c->time_base.den = 25; /* FIXME */
+#else
         id->ff_enc_c->frame_rate    = 25; /* FIXME */
         id->ff_enc_c->frame_rate_base = 1;
+#endif
 
         id->ff_enc_c->gop_size = 200;
         id->ff_enc_c->max_b_frames = 0;
@@ -751,6 +756,7 @@ static mtime_t VideoCommand( sout_stream_t *p_stream, sout_stream_id_t *id )
                             | CODEC_FLAG_LOW_DELAY;
 
         id->ff_enc_c->mb_decision = FF_MB_DECISION_SIMPLE;
+        id->ff_enc_c->pix_fmt = PIX_FMT_YUV420P;
 
         if( avcodec_open( id->ff_enc_c, id->ff_enc ) )
         {
@@ -872,6 +878,7 @@ static block_t *VideoGetBuffer( sout_stream_t *p_stream, sout_stream_id_t *id,
     p_out->i_length = p_buffer->i_length;
     p_out->i_pts = p_buffer->i_dts;
     p_out->i_dts = p_buffer->i_dts;
+    p_out->i_rate = p_buffer->i_rate;
 
     switch ( id->ff_enc_c->coded_frame->pict_type )
     {
@@ -914,6 +921,7 @@ static block_t *AudioGetBuffer( sout_stream_t *p_stream, sout_stream_id_t *id,
     p_out->i_length = p_buffer->i_length;
     p_out->i_pts = p_buffer->i_dts;
     p_out->i_dts = p_buffer->i_dts;
+    p_out->i_rate = p_buffer->i_rate;
 
     block_Release( p_buffer );