[vlc-commits] subtitles: support MicroDVD size extension

Jean-Baptiste Kempf git at videolan.org
Mon Jun 27 15:37:36 CEST 2016


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Jun 27 14:49:32 2016 +0200| [9dd890b3eab3fb4a03538cb078dd709a9924628c] | committer: Jean-Baptiste Kempf

subtitles: support MicroDVD size extension

Ref #1825

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9dd890b3eab3fb4a03538cb078dd709a9924628c
---

 modules/codec/subsdec.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/modules/codec/subsdec.c b/modules/codec/subsdec.c
index 3949cd8..96c8a77 100644
--- a/modules/codec/subsdec.c
+++ b/modules/codec/subsdec.c
@@ -984,6 +984,19 @@ static text_segment_t* ParseSubtitles( int *pi_align, const char *psz_subtitle )
                 p_segment = NewTextSegmentPushStyle( p_segment, &p_stack );
                 p_segment->style->psz_fontname = strndup( &psz_subtitle[3], i_len );
             }
+            else if( psz_subtitle[1] == 'S' || psz_subtitle[1] == 's' )
+            {
+                char *value = strndup( &psz_subtitle[3], i_len );
+                int size = atoi( value );
+                if( size )
+                {
+                    p_segment = NewTextSegmentPushStyle( p_segment, &p_stack );
+                    p_segment->style->i_font_size = size;
+                    p_segment->style->f_font_relsize = STYLE_DEFAULT_REL_FONT_SIZE *
+                                STYLE_DEFAULT_FONT_SIZE / p_segment->style->i_font_size;
+
+                }
+            }
             // Hide other {x:y} atrocities, like {c:$bbggrr} or {P:x}
             psz_subtitle = psz_tag_end + 1;
         }



More information about the vlc-commits mailing list