Skip to content

Commit

Permalink
Adjusted version in IFDEF guard
Browse files Browse the repository at this point in the history
  • Loading branch information
kala13x committed Nov 22, 2024
1 parent 14d3d1f commit 131daea
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
7 changes: 3 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,20 +126,19 @@ clean_project
build_lbrary

for arg in "$@"; do
if [[ $arg == "--example" ]]; then
if [[ $arg == "--example" || $arg == "-e" ]]; then
build_example
fi

if [[ $arg == "--install" ]]; then
if [[ $arg == "--install" || $arg == "-i" ]]; then
install_library
install_example
fi
done

# Do cleanup last
for arg in "$@"; do
if [[ $arg == "--cleanup" ||
$arg == "--clean" ]]; then
if [[ $arg == "--clean" || $arg == "-c" ]]; then
clean_project
fi
done
Expand Down
6 changes: 2 additions & 4 deletions example/xmedia.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static void clear_cb(xarray_data_t *pArrData)
free(pArrData->pData);
}

#if XMEDIA_AVCODEC_VER_AT_LEAST(59, 24)
#if XMEDIA_AVCODEC_VER_AT_LEAST(60, 31)
static int muxer_cb(void *pCtx, const uint8_t *pData, int nSize)
#else
static int muxer_cb(void *pCtx, uint8_t *pData, int nSize)
Expand All @@ -97,12 +97,10 @@ static int encoder_cb(void *pCtx, AVPacket *pPacket)

static int decoder_cb(void *pCtx, AVFrame *pFrame, int nStreamIndex)
{
xlogd("Decoder callback: stream(%d), size(%d), pts(%lld)",
nStreamIndex, pFrame->pkt_size, pFrame->pts);

xtranscoder_t *pTransmuxer = (xtranscoder_t*)pCtx;
xencoder_t *pDecoder = (xencoder_t*)&pTransmuxer->decoder;
xencoder_t *pEncoder = (xencoder_t*)&pTransmuxer->encoder;
xlogd("Decoder callback: stream(%d), pts(%lld)", nStreamIndex, pFrame->pts);

xstream_t *pStream = XStreams_GetBySrcIndex(&pDecoder->streams, nStreamIndex);
XASSERT(pStream, xthrow("Source stream is not found: src(%d)", nStreamIndex));
Expand Down
2 changes: 1 addition & 1 deletion src/encoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ typedef void(*xencoder_stat_cb_t)(void *pUserCtx, const char *pStatus);
typedef void(*xencoder_err_cb_t)(void *pUserCtx, const char *pErrStr);
typedef int(*xencoder_pkt_cb_t)(void *pUserCtx, AVPacket *pPacket);

#if XMEDIA_AVCODEC_VER_AT_LEAST(59, 24)
#if XMEDIA_AVCODEC_VER_AT_LEAST(60, 31)
typedef int(*xmuxer_cb_t)(void *pUserCtx, const uint8_t *pData, int nSize);
#else
typedef int(*xmuxer_cb_t)(void *pUserCtx, uint8_t *pData, int nSize);
Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#define XMEDIA_VERSION_MAX 1
#define XMEDIA_VERSION_MIN 2
#define XMEDIA_BUILD_NUMBER 16
#define XMEDIA_BUILD_NUMBER 17

#ifdef __cplusplus
extern "C" {
Expand Down

0 comments on commit 131daea

Please sign in to comment.