Skip to content

Commit

Permalink
build: hedge lavc depends
Browse files Browse the repository at this point in the history
Allow linking libavcodec conversions outside UG with reasonably small
amount of dependencies.
  • Loading branch information
MartinPulec committed Nov 10, 2023
1 parent 405e18f commit 9f5530d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
7 changes: 6 additions & 1 deletion src/libavcodec/lavc_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,20 @@ static void av_log_ug_callback(void *avcl, int av_level, const char *fmt, va_lis
buf[0] = '\0';
}

#ifdef HAVE_CONFIG_H // built inside UG
ADD_TO_PARAM("lavcd-log-level",
"* lavcd-log-level=<num>[U][D]\n"
" Set libavcodec log level (FFmpeg range semantics, unless 'U' suffix, then UltraGrid)\n"
" - 'D' - use FFmpeg default log handler\n");
#endif
/// Sets specified log level either given explicitly or from UG-wide log_level
void ug_set_av_logging() {
av_log_set_level(uv_to_av_log(log_level));
av_log_set_callback(av_log_ug_callback);
const char *param = get_commandline_param("lavcd-log-level");
const char *param = NULL;
#ifdef HAVE_CONFIG_H // built inside UG
param = get_commandline_param("lavcd-log-level");
#endif
if (param == NULL) {
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/utils/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@

#ifdef HAVE_CONFIG_H
#include "config.h"
#include "config_unix.h"
#include "config_win32.h"
#endif

#include <libgen.h>
#ifdef HAVE_SETTHREADDESCRIPTION
#include <processthreadsapi.h>
#endif
#include <stdlib.h>
#include <string.h>

#include "debug.h"
#include "host.h"
Expand Down
8 changes: 2 additions & 6 deletions src/utils/worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,13 @@
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#include "config_unix.h"
#include "config_win32.h"
#endif // HAVE_CONFIG_H

#include "utils/misc.h" // get_cpu_core_count
#include "utils/thread.h"
#include "utils/worker.h"

#include <cassert>
#include <algorithm>
#include <pthread.h>
#include <queue>
#include <set>
#include <vector>
Expand Down

0 comments on commit 9f5530d

Please sign in to comment.