]> git.sesse.net Git - vlc/commitdiff
* modules/codec/ffmpeg/video.c: fixed screwed up indirect rendering.
authorGildas Bazin <gbazin@videolan.org>
Tue, 28 Oct 2003 14:17:52 +0000 (14:17 +0000)
committerGildas Bazin <gbazin@videolan.org>
Tue, 28 Oct 2003 14:17:52 +0000 (14:17 +0000)
* modules/codec/ffmpeg/postprocess.c: idem for postprocessing.

modules/codec/ffmpeg/postprocess.c
modules/codec/ffmpeg/video.c

index 07dcf68cd44e3054546e42f962ed29a2a1289cee..f9b5c7a0096915cba6dbfdba6885fbc20b970425 100644 (file)
@@ -2,7 +2,7 @@
  * postprocess.c: video postprocessing using the ffmpeg library
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: postprocess.c,v 1.1 2003/10/27 01:04:38 gbazin Exp $
+ * $Id: postprocess.c,v 1.2 2003/10/28 14:17:51 gbazin Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Gildas Bazin <gbazin@netcourrier.com>
@@ -99,7 +99,7 @@ int E_(OpenPostproc)( decoder_t *p_dec, void **pp_data )
 
         *pp_sys = malloc( sizeof(video_postproc_sys_t) );
         (*pp_sys)->pp_context = NULL;
-        (*pp_sys)->pp_mode    = NULL;
+        (*pp_sys)->pp_mode    = pp_mode;
 
         return VLC_SUCCESS;
     }
index cbe9d210ca32f6b185c623f9f441e7c70af09da6..1349a26c4cd0749030d3f3cfe09043e52cfafb69 100644 (file)
@@ -2,7 +2,7 @@
  * video.c: video decoder using the ffmpeg library
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: video.c,v 1.42 2003/10/27 01:04:38 gbazin Exp $
+ * $Id: video.c,v 1.43 2003/10/28 14:17:52 gbazin Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Gildas Bazin <gbazin@netcourrier.com>
@@ -257,6 +257,7 @@ int E_(InitVideoDec)( decoder_t *p_dec, AVCodecContext *p_context,
     }
 
 #ifdef LIBAVCODEC_PP
+    p_sys->p_pp = NULL;
     if( E_(OpenPostproc)( p_dec, &p_sys->p_pp ) == VLC_SUCCESS )
     {
         /* for now we cannot do postproc and dr */
@@ -329,7 +330,6 @@ int E_(InitVideoDec)( decoder_t *p_dec, AVCodecContext *p_context,
     p_sys->i_late_frames = 0;
     p_sys->i_buffer = 1;
     p_sys->p_buffer = malloc( p_sys->i_buffer );
-    p_sys->p_pp = NULL;
 
     return VLC_SUCCESS;
 }
@@ -399,7 +399,8 @@ int E_(DecodeVideo)( decoder_t *p_dec, block_t *p_block )
     if( i_buffer + FF_INPUT_BUFFER_PADDING_SIZE > p_sys->i_buffer )
     {
         free( p_sys->p_buffer );
-        p_sys->p_buffer = malloc( i_buffer + FF_INPUT_BUFFER_PADDING_SIZE );
+        p_sys->i_buffer = i_buffer + FF_INPUT_BUFFER_PADDING_SIZE;
+        p_sys->p_buffer = malloc( p_sys->i_buffer );
     }
     p_buffer = p_sys->p_buffer;
     p_dec->p_vlc->pf_memcpy( p_buffer, p_block->p_buffer, p_block->i_buffer );
@@ -543,14 +544,15 @@ static void ffmpeg_CopyPicture( decoder_t *p_dec,
 
     if( ffmpeg_PixFmtToChroma( p_sys->p_context->pix_fmt ) )
     {
-#ifdef LIBAVCODEC_PP
-        if( p_sys->p_pp )
-            E_(PostprocPict)( p_dec, p_sys->p_pp, p_pic, p_ff_pic );
-#else
         int i_plane, i_size, i_line;
         uint8_t *p_dst, *p_src;
         int i_src_stride, i_dst_stride;
 
+#ifdef LIBAVCODEC_PP
+        if( p_sys->p_pp )
+            E_(PostprocPict)( p_dec, p_sys->p_pp, p_pic, p_ff_pic );
+        else
+#endif
         for( i_plane = 0; i_plane < p_pic->i_planes; i_plane++ )
         {
             p_src  = p_ff_pic->data[i_plane];
@@ -566,7 +568,6 @@ static void ffmpeg_CopyPicture( decoder_t *p_dec,
                 p_dst += i_dst_stride;
             }
         }
-#endif
     }
     else
     {