<div dir="ltr"><pre>fixes bug: <a href="https://trac.videolan.org/vlc/ticket/11813">https://trac.videolan.org/vlc/ticket/11813</a><br>mkv spec: <a href="https://www.matroska.org/technical/specs/index.html#languages">https://www.matroska.org/technical/specs/index.html#languages</a><br>---<br> modules/demux/mkv/matroska_segment_parse.cpp | 8 +++++---<br> 1 file changed, 5 insertions(+), 3 deletions(-)<br><br>diff --git a/modules/demux/mkv/matroska_segment_parse.cpp b/modules/demux/mkv/matroska_segment_parse.cpp<br>index f4d73613c9..206a1630a6 100644<br>--- a/modules/demux/mkv/matroska_segment_parse.cpp<br>+++ b/modules/demux/mkv/matroska_segment_parse.cpp<br>@@ -379,9 +379,11 @@ void matroska_segment_c::ParseTrackEntry( KaxTrackEntry *m )<br>         }<br>         E_CASE( KaxTrackLanguage, lang )<br>         {<br>-            free( vars.tk->fmt.psz_language );<br>-            vars.tk->fmt.psz_language = strdup( std::string( lang ).c_str() );<br>-            debug( vars, "Track Language=`%s'", vars.tk->fmt.psz_language );<br>+            std::string const& slang ( lang );<br>+            free(vars.tk->fmt.psz_language);<br>+            vars.tk->fmt.psz_language = strndup( slang.c_str (),<br>+                    slang.find_first_of( '-' ) );<br>+            debug(vars, "Track Language=`%s'", vars.tk->fmt.psz_language );<br>         }<br>         E_CASE( KaxCodecID, codecid )<br>         {<br>-- <br>2.12.2<br><br></pre><pre>Hello Filip<br></pre><pre>Sorry for a late response, I am not so familiar with mailing lists<br>and had missed some of the responses to my patch coupled <br>with my exams coming up in between.<br><br></pre><pre>What I had inferred from your first message and erred was your suggestion <br>about using a function at all and made clear by your next message about<br>using C++ Utility/Library classes.<br>I have taken your advice and moved to a complete C++ implementation.<br></pre></div>