# include "config.h"
#endif
-#include <vlc/vlc.h>
+#include <vlc_common.h>
+#include <vlc_plugin.h>
#include <vlc_vout.h>
#include <vlc_codec.h>
-#include <mpeg2dec/mpeg2.h>
+#include <mpeg2.h>
#include <vlc_codec_synchro.h>
*/
mpeg2dec_t *p_mpeg2dec;
const mpeg2_info_t *p_info;
- vlc_bool_t b_skip;
+ bool b_skip;
/*
* Input properties
mtime_t i_current_dts;
int i_current_rate;
picture_t * p_picture_to_destroy;
- vlc_bool_t b_garbage_pic;
- vlc_bool_t b_after_sequence_header; /* is it the next frame after
+ bool b_garbage_pic;
+ bool b_after_sequence_header; /* is it the next frame after
* the sequence header ? */
- vlc_bool_t b_slice_i; /* intra-slice refresh stream */
- vlc_bool_t b_second_field;
+ bool b_slice_i; /* intra-slice refresh stream */
+ bool b_second_field;
- vlc_bool_t b_preroll;
+ bool b_preroll;
/*
* Output properties
* Module descriptor
*****************************************************************************/
vlc_module_begin();
- set_description( _("MPEG I/II video decoder (using libmpeg2)") );
+ set_description( N_("MPEG I/II video decoder (using libmpeg2)") );
set_capability( "decoder", 150 );
set_category( CAT_INPUT );
set_subcategory( SUBCAT_INPUT_VCODEC );
/* Allocate the memory needed to store the decoder's structure */
if( ( p_dec->p_sys = p_sys =
(decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
- {
- msg_Err( p_dec, "out of memory" );
- return VLC_EGENERIC;
- }
+ return VLC_ENOMEM;
/* Initialize the thread properties */
memset( p_sys, 0, sizeof(decoder_sys_t) );
p_sys->b_slice_i = 0;
p_sys->b_second_field = 0;
p_sys->b_skip = 0;
- p_sys->b_preroll = VLC_FALSE;
+ p_sys->b_preroll = false;
#if defined( __i386__ ) || defined( __x86_64__ )
if( vlc_CPU() & CPU_CAPABILITY_MMX )
if( p_block->i_flags & BLOCK_FLAG_PREROLL )
{
- p_sys->b_preroll = VLC_TRUE;
+ p_sys->b_preroll = true;
}
else if( p_sys->b_preroll )
{
- p_sys->b_preroll = VLC_FALSE;
+ p_sys->b_preroll = false;
/* Reset synchro */
decoder_SynchroReset( p_sys->p_synchro );
}
p_block->i_buffer = 0;
break;
-#ifdef STATE_SEQUENCE_MODIFIED
-/* FIXME - the above ifdef is always FALSE, even with libmpeg2-0.5.0
- * Need to improve the implementation to avoid invalid/unref pictures */
+#if MPEG2_RELEASE >= MPEG2_VERSION (0, 5, 0)
case STATE_SEQUENCE_MODIFIED:
GetAR( p_dec );
}
mpeg2_set_buf( p_sys->p_mpeg2dec, buf, p_pic );
- mpeg2_stride( p_sys->p_mpeg2dec, p_pic->p[Y_PLANE].i_pitch );
+ mpeg2_stride( p_sys->p_mpeg2dec, p_pic->p[Y_PLANE].i_pitch );
/* This picture will never go through display_picture. */
p_pic->date = 0;
}
/* For still frames */
- if( state == STATE_END && p_pic ) p_pic->b_force = VLC_TRUE;
+ if( state == STATE_END && p_pic ) p_pic->b_force = true;
if( p_pic )
{
if( (p_pic = GetNewPicture( p_dec, buf )) == NULL )
break;
mpeg2_set_buf( p_sys->p_mpeg2dec, buf, p_pic );
- mpeg2_stride( p_sys->p_mpeg2dec, p_pic->p[Y_PLANE].i_pitch );
+ mpeg2_stride( p_sys->p_mpeg2dec, p_pic->p[Y_PLANE].i_pitch );
}
p_sys->p_picture_to_destroy = p_pic;