Solving bugs.

This commit is contained in:
Zoe Roux
2019-10-02 00:22:29 +02:00
parent ab630b9b84
commit c852d0c3b9
7 changed files with 22 additions and 24 deletions
+4 -1
View File
@@ -25,8 +25,11 @@ extern "C" struct Stream
{
if(title != NULL)
this->title= _strdup(title);
if(languageCode != NULL)
if (languageCode != NULL)
language = _strdup(languageCode);
else
language = _strdup("und");
if (codec != NULL)
this->codec = _strdup(codec);
+3 -1
View File
@@ -226,9 +226,11 @@ Stream *ExtractSubtitles(const char *path, const char *outPath, int *streamCount
{
*subtitleCount += 1;
AVDictionaryEntry *languagePtr = av_dict_get(inputStream->metadata, "language", NULL, 0);
//Get metadata for file name
streams[i] = Stream(NULL, //title
av_dict_get(inputStream->metadata, "language", NULL, 0)->value, //language
languagePtr ? languagePtr->value : NULL, //language
avcodec_get_name(inputCodecpar->codec_id), //format
inputStream->disposition & AV_DISPOSITION_DEFAULT, //isDefault
inputStream->disposition & AV_DISPOSITION_FORCED); //isForced