* modules/stream_out/switcher.c: Explicitly set the pixel format (this is
authorChristophe Massiot <massiot@videolan.org>
Tue, 31 May 2005 15:19:33 +0000 (15:19 +0000)
committerChristophe Massiot <massiot@videolan.org>
Tue, 31 May 2005 15:19:33 +0000 (15:19 +0000)
   due to a recent change of the default value in ffmpeg which used to be
   YUV 420P). Forward i_rate in case a transcode or display operation
   takes place after switcher.

modules/stream_out/switcher.c

index 84b19d6..030f03b 100644 (file)
@@ -756,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 ) )
         {
@@ -877,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 )
     {
@@ -919,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 );