* video.c: video decoder using the ffmpeg library
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: video.c,v 1.58 2004/01/08 00:12:50 gbazin Exp $
+ * $Id: video.c,v 1.63 2004/02/08 12:09:50 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
vlc_bool_t b_pp_init;
};
+/* FIXME (dummy palette for now) */
+static AVPaletteControl palette_control;
+
/*****************************************************************************
* Local prototypes
*****************************************************************************/
p_dec->fmt_out.i_cat = VIDEO_ES;
p_dec->fmt_out.i_codec = ffmpeg_PixFmtToChroma( p_context->pix_fmt );
+ /* Setup palette */
+#if LIBAVCODEC_BUILD >= 4688
+ if( p_dec->fmt_in.video.p_palette )
+ p_sys->p_context->palctrl =
+ (AVPaletteControl *)p_dec->fmt_in.video.p_palette;
+ else
+ p_sys->p_context->palctrl = &palette_control;
+#endif
+
/* ***** Open the codec ***** */
vlc_mutex_lock( lockval.p_address );
if( avcodec_open( p_sys->p_context, p_sys->p_codec ) < 0 )
p_sys->p_buffer += i_used;
/* Nothing to display */
- if( !b_gotpicture ) continue;
+ if( !b_gotpicture )
+ {
+ if( i_used == 0 )
+ {
+ break;
+ }
+ continue;
+ }
/* Update frame late count*/
if( p_sys->i_pts && p_sys->i_pts <= mdate() )
continue;
}
- if( !p_sys->b_direct_rendering || p_sys->b_pp )
+ if( !p_sys->b_direct_rendering ||
+ p_sys->b_pp || !p_sys->p_ff_pic->opaque )
{
/* Get a new picture */
p_pic = ffmpeg_NewPictBuf( p_dec, p_sys->p_context );
else p_ff_pic->pts = 0;
p_sys->input_pts = p_sys->input_dts = 0;
+ p_ff_pic->opaque = 0;
/* Not much to do in indirect rendering mode */
if( !p_sys->b_direct_rendering || p_sys->b_pp )