From 72a88f22f00c4567503adf852dd2f3f2938ecf7c Mon Sep 17 00:00:00 2001
From: andyweiqiu <andywei_89@163.COM>
Date: 星期四, 07 九月 2023 15:18:56 +0800
Subject: [PATCH] Delete redundant parts from an iOS project (#922)
---
funasr/runtime/onnxruntime/src/audio.cpp | 21 ++++++++++++++++++---
1 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/funasr/runtime/onnxruntime/src/audio.cpp b/funasr/runtime/onnxruntime/src/audio.cpp
index 6335f4e..94fcefc 100644
--- a/funasr/runtime/onnxruntime/src/audio.cpp
+++ b/funasr/runtime/onnxruntime/src/audio.cpp
@@ -9,6 +9,11 @@
#include "audio.h"
#include "precomp.h"
+
+#if defined(__APPLE__)
+#include <string.h>
+#else
+
extern "C" {
#include <libavutil/opt.h>
#include <libavcodec/avcodec.h>
@@ -17,6 +22,10 @@
#include <libavutil/samplefmt.h>
#include <libswresample/swresample.h>
}
+
+#endif
+
+
using namespace std;
@@ -245,6 +254,9 @@
}
bool Audio::FfmpegLoad(const char *filename, bool copy2char){
+#if defined(__APPLE__)
+ return false;
+#else
// from file
AVFormatContext* formatContext = avformat_alloc_context();
if (avformat_open_input(&formatContext, filename, NULL, NULL) != 0) {
@@ -403,10 +415,13 @@
}
else
return false;
-
+#endif
}
bool Audio::FfmpegLoad(const char* buf, int n_file_len){
+#if defined(__APPLE__)
+ return false;
+#else
// from buf
char* buf_copy = (char *)malloc(n_file_len);
memcpy(buf_copy, buf, n_file_len);
@@ -577,7 +592,7 @@
}
else
return false;
-
+#endif
}
@@ -1229,4 +1244,4 @@
}
-} // namespace funasr
\ No newline at end of file
+} // namespace funasr
--
Gitblit v1.9.1