mpegtsdescriptor: Fix handling of unknown stream encodings

If we cannot identify the encoding used for a string, return a NULL
string instead of garbage and add a FIXME so we can detect and later
fix it.
This commit is contained in:
Edward Hervey 2013-07-04 07:48:10 +02:00
parent 4fe26740c7
commit 34164610b0

View file

@ -376,11 +376,9 @@ get_encoding_and_convert (const gchar * text, guint length)
if (__iconvs[encoding] == ((GIConv) - 1)) if (__iconvs[encoding] == ((GIConv) - 1))
__iconvs[encoding] = g_iconv_open ("utf-8", iconvtablename[encoding]); __iconvs[encoding] = g_iconv_open ("utf-8", iconvtablename[encoding]);
giconv = __iconvs[encoding]; giconv = __iconvs[encoding];
} } else {
GST_FIXME ("Could not detect encoding. Returning NULL string");
if (giconv == ((GIConv) - 1)) { converted_str = NULL;
GST_WARNING ("Could not detect encoding");
converted_str = g_strndup (text, length);
goto beach; goto beach;
} }