* libmpeg2.c: mpeg2 video decoder module making use of libmpeg2.
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: libmpeg2.c,v 1.34 2003/11/22 23:39:14 fenrir Exp $
+ * $Id: libmpeg2.c,v 1.37 2003/12/07 12:11:13 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Christophe Massiot <massiot@via.ecp.fr>
return NULL;
}
- if( p_block->b_discontinuity && p_sys->p_synchro
- && p_sys->p_info->sequence->width != (unsigned)-1 )
+ if( p_block->b_discontinuity && p_sys->p_synchro &&
+ p_sys->p_info->sequence &&
+ p_sys->p_info->sequence->width != (unsigned)-1 )
{
vout_SynchroReset( p_sys->p_synchro );
if( p_sys->p_info->current_fbuf != NULL
if( p_dec->fmt_in.video.i_aspect )
{
p_sys->i_aspect = p_dec->fmt_in.video.i_aspect;
+ if( p_sys->i_aspect <= AR_221_1_PICTURE )
switch( p_sys->i_aspect )
{
case AR_3_4_PICTURE:
p_sys->i_aspect = VOUT_ASPECT_FACTOR * 221 / 100;
break;
case AR_SQUARE_PICTURE:
- default:
p_sys->i_aspect = VOUT_ASPECT_FACTOR *
p_sys->p_info->sequence->width /
p_sys->p_info->sequence->height;
/* For some reason, libmpeg2 will put this pic twice in
* discard_picture. This can be considered a bug in libmpeg2. */
- //vout_LinkPicture( p_sys->p_vout, p_pic );
+ p_dec->pf_picture_link( p_dec, p_pic );
if( p_sys->p_synchro )
{
case STATE_END:
case STATE_SLICE:
+ p_pic = NULL;
if( p_sys->p_info->display_fbuf
&& p_sys->p_info->display_fbuf->id )
{
p_sys->p_picture_to_destroy = NULL;
p_pic->date = 0;
}
- return p_pic; /* FIXME */
}
if( p_sys->p_info->discard_fbuf &&
p_sys->p_info->discard_fbuf->id )
{
- //p_pic = (picture_t *)p_sys->p_info->discard_fbuf->id;
- //vout_UnlinkPicture( p_sys->p_vout, p_pic );
+ p_dec->pf_picture_unlink( p_dec,
+ p_sys->p_info->discard_fbuf->id );
}
- //return p_pic; /* FIXME */
+ if( p_pic ) return p_pic;
break;
( ( p_sys->p_info->current_picture->flags &
PIC_MASK_CODING_TYPE) != B_CODING_TYPE ) )
{
- vout_SynchroReset( p_sys->p_synchro );
+ if( p_sys->p_synchro ) vout_SynchroReset( p_sys->p_synchro );
}
mpeg2_skip( p_sys->p_mpeg2dec, 1 );
p_sys->b_skip = 1;
p_sys->b_garbage_pic = 1;
p_pic = p_sys->p_info->current_fbuf->id;
}
+ else if( !p_sys->p_info->sequence )
+ {
+ break;
+ }
else
{
if( (p_pic = GetNewPicture( p_dec, buf )) == NULL )
p_pic->i_nb_fields = p_sys->p_info->current_picture != NULL ?
p_sys->p_info->current_picture->nb_fields : 2;
- //vout_LinkPicture( p_sys->p_vout, p_pic );
+ p_dec->pf_picture_link( p_dec, p_pic );
pp_buf[0] = p_pic->p[0].p_pixels;
pp_buf[1] = p_pic->p[1].p_pixels;