mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-05-27 09:32:35 -04:00
Making memory management more efficient.
This commit is contained in:
@@ -222,7 +222,7 @@ Stream *ExtractSubtitles(const char *path, const char *outPath, int *streamCount
|
||||
if (inputCodecpar->codec_type != AVMEDIA_TYPE_SUBTITLE)
|
||||
outputList[i] = NULL;
|
||||
else
|
||||
{
|
||||
{
|
||||
//Get metadata for file name
|
||||
Stream stream(NULL, //title
|
||||
av_dict_get(inputStream->metadata, "language", NULL, 0)->value, //language
|
||||
@@ -344,4 +344,9 @@ Stream *ExtractSubtitles(const char *path, const char *outPath, int *streamCount
|
||||
return subtitleStreams;
|
||||
//*streamCount = subtitleStreams->size();
|
||||
//return subtitleStreams->data();
|
||||
}
|
||||
|
||||
void FreeMemory(Stream *streamsPtr)
|
||||
{
|
||||
delete[] streamsPtr;
|
||||
}
|
||||
@@ -11,7 +11,9 @@
|
||||
|
||||
extern "C" API int Init();
|
||||
|
||||
extern "C" API int Transmux(const char *path, const char *outPath);
|
||||
|
||||
//Take the path of the file and the path of the output directory. It will return the list of subtitle streams in the streams variable. The int returned is the number of subtitles extracted.
|
||||
extern "C" API Stream *ExtractSubtitles(const char *path, const char *outPath, int *streamCount, int *subtitleCount);
|
||||
|
||||
extern "C" API int Transmux(const char *path, const char *outPath);
|
||||
extern "C" API void FreeMemory(Stream *streamsPtr);
|
||||
|
||||
Reference in New Issue
Block a user