X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fcodec%2Fkate.c;h=b85bf2e7c17b1f978d36cbb04ac6a14c1a76436c;hb=174f75debc6ff4b0b3a7037bc21e7b77bfe2a9d8;hp=6af25e4d25a7a2f613e59af2ecc2d81d81df0495;hpb=72fa5a9d8e8f5a1bbe0d83ffd1f30b3265a531c7;p=vlc diff --git a/modules/codec/kate.c b/modules/codec/kate.c index 6af25e4d25..b85bf2e7c1 100644 --- a/modules/codec/kate.c +++ b/modules/codec/kate.c @@ -346,7 +346,7 @@ static int OpenDecoder( vlc_object_t *p_this ) decoder_sys_t *p_sys; int i_ret; - if( p_dec->fmt_in.i_codec != VLC_FOURCC('k','a','t','e') ) + if( p_dec->fmt_in.i_codec != VLC_CODEC_KATE ) { return VLC_EGENERIC; } @@ -360,8 +360,7 @@ static int OpenDecoder( vlc_object_t *p_this ) DecodeBlock; /* 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 ) + if( ( p_dec->p_sys = p_sys = malloc(sizeof(*p_sys)) ) == NULL ) return VLC_ENOMEM; vlc_mutex_init( &p_sys->lock ); @@ -426,8 +425,10 @@ static int OpenDecoder( vlc_object_t *p_this ) #endif + es_format_Init( &p_dec->fmt_out, SPU_ES, 0 ); + /* add the decoder to the global list */ - decoder_t **list = ( decoder_t** ) realloc( kate_decoder_list, (kate_decoder_list_size+1) * sizeof( decoder_t* )); + decoder_t **list = realloc( kate_decoder_list, (kate_decoder_list_size+1) * sizeof( *list )); if( list ) { list[ kate_decoder_list_size++ ] = p_dec; @@ -449,7 +450,7 @@ static int OpenPacketizer( vlc_object_t *p_this ) if( i_ret == VLC_SUCCESS ) { p_dec->p_sys->b_packetizer = true; - p_dec->fmt_out.i_codec = VLC_FOURCC( 'k', 'a', 't', 'e' ); + p_dec->fmt_out.i_codec = VLC_CODEC_KATE; } return i_ret; @@ -951,7 +952,7 @@ static void TigerUpdateRegions( spu_t *p_spu, subpicture_t *p_subpic, const vide /* create a full frame region - this will also tell Tiger the size of the frame */ fmt = *p_fmt; - fmt.i_chroma = VLC_FOURCC('R','G','B','A'); + fmt.i_chroma = VLC_CODEC_RGBA; fmt.i_width = fmt.i_visible_width; fmt.i_height = fmt.i_visible_height; fmt.i_bits_per_pixel = 0; @@ -1347,7 +1348,7 @@ static subpicture_t *SetupSimpleKateSPU( decoder_t *p_dec, subpicture_t *p_spu, /* create a separate region for the bitmap */ memset( &fmt, 0, sizeof(video_format_t) ); - fmt.i_chroma = VLC_FOURCC('Y','U','V','P'); + fmt.i_chroma = VLC_CODEC_YUVP; fmt.i_aspect = 0; fmt.i_width = fmt.i_visible_width = ev->bitmap->width; fmt.i_height = fmt.i_visible_height = ev->bitmap->height; @@ -1370,7 +1371,7 @@ static subpicture_t *SetupSimpleKateSPU( decoder_t *p_dec, subpicture_t *p_spu, } /* text region */ - fmt.i_chroma = VLC_FOURCC('T','E','X','T'); + fmt.i_chroma = VLC_CODEC_TEXT; fmt.i_aspect = 0; fmt.i_width = fmt.i_height = 0; fmt.i_x_offset = fmt.i_y_offset = 0;