mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-10-09 02:30:45 +08:00
lavc, lavf: move avformat static mutex from avcodec to avformat
It's completely absurd that libavcodec would care about libavformat locking, but it was there because the lock manager was in libavcodec. This is more stright forward. Changes ABI, but we don't require ABI compatibility currently.
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
#include "libavutil/opt.h"
|
||||
#include "libavutil/parseutils.h"
|
||||
#include "libavutil/pixdesc.h"
|
||||
#include "libavutil/thread.h"
|
||||
#include "libavutil/time.h"
|
||||
#include "libavutil/time_internal.h"
|
||||
#include "libavutil/timestamp.h"
|
||||
@@ -55,6 +56,8 @@
|
||||
#include "libavutil/ffversion.h"
|
||||
const char av_format_ffversion[] = "FFmpeg version " FFMPEG_VERSION;
|
||||
|
||||
static AVMutex avformat_mutex = AV_MUTEX_INITIALIZER;
|
||||
|
||||
/**
|
||||
* @file
|
||||
* various utility functions for use within FFmpeg
|
||||
@@ -77,6 +80,16 @@ const char *avformat_license(void)
|
||||
return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1;
|
||||
}
|
||||
|
||||
int ff_lock_avformat(void)
|
||||
{
|
||||
return ff_mutex_lock(&avformat_mutex) ? -1 : 0;
|
||||
}
|
||||
|
||||
int ff_unlock_avformat(void)
|
||||
{
|
||||
return ff_mutex_unlock(&avformat_mutex) ? -1 : 0;
|
||||
}
|
||||
|
||||
#define RELATIVE_TS_BASE (INT64_MAX - (1LL<<48))
|
||||
|
||||
static int is_relative(int64_t ts) {
|
||||
|
Reference in New Issue
Block a user