Skip to content

Commit

Permalink
fix link order
Browse files Browse the repository at this point in the history
  • Loading branch information
mthrok committed Nov 6, 2021
1 parent 13a1273 commit 700f298
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 3 additions & 3 deletions third_party/ffmpeg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ set(envs

set(FFMPEG_LIBRARIES
${INSTALL_DIR}/lib/libavformat.a
${INSTALL_DIR}/lib/libavcodec.a
${INSTALL_DIR}/lib/libavdevice.a
${INSTALL_DIR}/lib/libavfilter.a
${INSTALL_DIR}/lib/libswscale.a
${INSTALL_DIR}/lib/libavcodec.a
${INSTALL_DIR}/lib/libavutil.a
${INSTALL_DIR}/lib/libavfilter.a
${INSTALL_DIR}/lib/libswresample.a
${INSTALL_DIR}/lib/libavdevice.a
)

ExternalProject_Add(ffmpeg_
Expand Down
10 changes: 9 additions & 1 deletion torchaudio/csrc/ffmpeg/prototype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ extern "C" {
#include <libavformat/avformat.h>
#include <libavformat/avio.h>
#include <libavutil/file.h>
#include <libavdevice/avdevice.h>
}
namespace torchaudio {
namespace ffmpeg {
Expand Down Expand Up @@ -100,11 +101,18 @@ int64_t ffmpeg_test(const std::string input) {
}
return 0;
}


void ffmpeg_test2(const std::string input) {
av_log_set_flags(AV_LOG_SKIP_REPEATED);
avdevice_register_all();
avformat_network_init();
}

TORCH_LIBRARY_FRAGMENT(torchaudio, m) {
m.def(
"torchaudio::ffmpeg_test",
&torchaudio::ffmpeg::ffmpeg_test);
&torchaudio::ffmpeg::ffmpeg_test2);
}

} // namespace ffmpeg
Expand Down

0 comments on commit 700f298

Please sign in to comment.