[vlc-devel] [PATCH] ttml.c : Added parsing of time and displaying subtitle
Jean-Baptiste Kempf
jb at videolan.org
Mon Mar 23 23:43:42 CET 2015
On 24 Mar, Sushma Reddy wrote :
> +
> +typedef struct
> +{
> + int64_t i_start;
> + int64_t i_stop;
> + char *psz_text;
> +} subtitle_t;
> +
Indentatio is still not 4 spaces wide.
> switch( i_query )
> {
> - case DEMUX_GET_TIME:
> - pi64 = (int64_t*)va_arg( args, int64_t * );
> - *pi64 = 0;
> - break;
> + case DEMUX_GET_TIME:
> + pi64 = (int64_t*)va_arg( args, int64_t * );
> + if( p_sys->i_length )
> + {
> + *pi64 = p_sys->subtitle[p_sys->i_subtitle].i_start;
> + return VLC_SUCCESS;
> + }
> + return VLC_EGENERIC;
Indentation is completely off.
You cannot use tabs!
> if ( psz_begin && psz_end )
> {
> - const char* psz_text = NULL;
> + const char* psz_text = NULL;
> + int i_len = 0;
> + subtitle_t *p_subtitle = &p_sys->subtitle[p_sys->i_subtitle];
> +
> + p_subtitle = malloc ( sizeof ( subtitle_t ) );
> +
> i_type = xml_ReaderNextNode( p_sys->p_reader, &psz_text );
> if ( i_type == XML_READER_TEXT && psz_text != NULL )
> - {
> - p_block = block_Alloc( strlen( psz_text ) );
> + {
> + i_len = strlen( psz_text ) + 1;
> + if( i_len <= 1 )
> + {
> + p_sys->i_subtitle++;
> + }
> +
> + if( ( p_block = block_Alloc( i_len ) ) == NULL )
> + {
> + p_sys->i_subtitle++;
> + }
> +
All this indentation is wrong.
With my kindest regards,
--
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device
More information about the vlc-devel
mailing list