X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fcodec%2Ftelx.c;h=e361760c46b0273fad893a0d9494d15629133009;hb=5ebacd11d10f9acc39afc0b3d41beb280eaac293;hp=1d36118d1f0156d6f4ed392f2265895aaaf81f2b;hpb=4f028428053d0342c55deb6ba8b8da114c6a0caa;p=vlc diff --git a/modules/codec/telx.c b/modules/codec/telx.c index 1d36118d1f..e361760c46 100644 --- a/modules/codec/telx.c +++ b/modules/codec/telx.c @@ -25,10 +25,16 @@ * http://pdc.ro.nu/teletext.html * *****************************************************************************/ -#include +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif #include #include +#include +#include +#include + #include "vlc_vout.h" #include "vlc_bits.h" #include "vlc_codec.h" @@ -64,7 +70,7 @@ static subpicture_t *Decode( decoder_t *, block_t ** ); "your subtitles don't appear.") vlc_module_begin(); - set_description( _("Teletext subtitles decoder") ); + set_description( N_("Teletext subtitles decoder") ); set_shortname( "Teletext" ); set_capability( "decoder", 50 ); set_category( CAT_INPUT ); @@ -72,11 +78,11 @@ vlc_module_begin(); set_callbacks( Open, Close ); add_integer( "telx-override-page", -1, NULL, - OVERRIDE_PAGE_TEXT, OVERRIDE_PAGE_LONGTEXT, VLC_TRUE ); + OVERRIDE_PAGE_TEXT, OVERRIDE_PAGE_LONGTEXT, true ); add_bool( "telx-ignore-subtitle-flag", 0, NULL, - IGNORE_SUB_FLAG_TEXT, IGNORE_SUB_FLAG_LONGTEXT, VLC_TRUE ); + IGNORE_SUB_FLAG_TEXT, IGNORE_SUB_FLAG_LONGTEXT, true ); add_bool( "telx-french-workaround", 0, NULL, - FRENCH_WORKAROUND_TEXT, FRENCH_WORKAROUND_LONGTEXT, VLC_TRUE ); + FRENCH_WORKAROUND_TEXT, FRENCH_WORKAROUND_LONGTEXT, true ); vlc_module_end(); @@ -87,15 +93,15 @@ vlc_module_end(); struct decoder_sys_t { int i_align; - vlc_bool_t b_is_subtitle[9]; + bool b_is_subtitle[9]; char ppsz_lines[32][128]; char psz_prev_text[512]; mtime_t prev_pts; int i_page[9]; - vlc_bool_t b_erase[9]; + bool b_erase[9]; uint16_t * pi_active_national_set[9]; int i_wanted_page, i_wanted_magazine; - vlc_bool_t b_ignore_sub_flag; + bool b_ignore_sub_flag; }; /**************************************************************************** @@ -178,10 +184,7 @@ static int Open( vlc_object_t *p_this ) p_dec->pf_decode_sub = Decode; p_sys = p_dec->p_sys = malloc( sizeof(decoder_sys_t) ); if( p_sys == NULL ) - { - msg_Err( p_dec, "out of memory" ); return VLC_ENOMEM; - } memset( p_sys, 0, sizeof(decoder_sys_t) ); @@ -446,13 +449,16 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block ) int i_wanted_page = 0x10 * ((i_conf_wanted_page % 100) / 10) | (i_conf_wanted_page % 10); #endif - vlc_bool_t b_update = VLC_FALSE; + bool b_update = false; char psz_text[512], *pt = psz_text; char psz_line[256]; int i, total; - if( pp_block == NULL || *pp_block == NULL ) return NULL; + if( pp_block == NULL || *pp_block == NULL ) + return NULL; p_block = *pp_block; + if( p_block->i_rate != 0 ) + p_block->i_length = p_block->i_length * p_block->i_rate / INPUT_RATE_DEFAULT; *pp_block = NULL; dbg((p_dec, "start of telx packet with header %2x\n", @@ -556,7 +562,7 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block ) for ( i = 1; i < 32; i++ ) { if ( !p_sys->ppsz_lines[i][0] ) continue; - /* b_update = VLC_TRUE; */ + /* b_update = true; */ p_sys->ppsz_lines[i][0] = 0; } } @@ -567,7 +573,7 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block ) strncpy( p_sys->ppsz_lines[row], psz_line, sizeof(p_sys->ppsz_lines[row]) - 1); } - b_update = VLC_TRUE; + b_update = true; } else if ( row < 24 ) @@ -599,7 +605,7 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block ) { strncpy( p_sys->ppsz_lines[row], t, sizeof(p_sys->ppsz_lines[row]) - 1 ); - b_update = VLC_TRUE; + b_update = true; } if (t[0]) @@ -645,7 +651,7 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block ) { strncpy( p_sys->ppsz_lines[0], psz_line, sizeof(p_sys->ppsz_lines[0]) - 1 ); - /* b_update = VLC_TRUE; */ + /* b_update = true; */ } } /* else if (row == 26) { */ @@ -717,8 +723,8 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block ) p_spu->i_start = p_block->i_pts; p_spu->i_stop = p_block->i_pts + p_block->i_length; p_spu->b_ephemer = (p_block->i_length == 0); - p_spu->b_absolute = VLC_FALSE; - p_spu->b_pausable = VLC_TRUE; + p_spu->b_absolute = false; + p_spu->b_pausable = true; dbg((p_dec, "%ld --> %ld\n", (long int) p_block->i_pts/100000, (long int)p_block->i_length/100000)); block_Release( p_block );