mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-27 15:33:00 +02:00
libeplayer3-arm: reduce compiler warnings
This commit is contained in:
@@ -163,33 +163,33 @@ static int32_t ffmpeg_read_wrapper(void *opaque, uint8_t *buf, int32_t buf_size)
|
||||
return ffmpeg_real_read_org(opaque, buf, buf_size);
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int32_t ffmpeg_read_wrapper2(void *opaque, uint8_t *buf, int32_t buf_size)
|
||||
{
|
||||
return ffmpeg_read_wrapper_base(opaque, buf, buf_size, 1);
|
||||
}
|
||||
|
||||
#endif
|
||||
//for buffered io
|
||||
void getfillerMutex(const char *filename, const char *function, int line)
|
||||
void getfillerMutex(const char *filename __attribute__((unused)), const char *function __attribute__((unused)), int line __attribute__((unused)))
|
||||
{
|
||||
ffmpeg_printf(100, "::%d requesting mutex\n", line);
|
||||
pthread_mutex_lock(&fillermutex);
|
||||
ffmpeg_printf(100, "::%d received mutex\n", line);
|
||||
}
|
||||
|
||||
void releasefillerMutex(const char *filename, const const char *function, int line)
|
||||
void releasefillerMutex(const char *filename __attribute__((unused)), const const char *function __attribute__((unused)), int line __attribute__((unused)))
|
||||
{
|
||||
pthread_mutex_unlock(&fillermutex);
|
||||
ffmpeg_printf(100, "::%d released mutex\n", line);
|
||||
}
|
||||
//for buffered io (end)encoding
|
||||
|
||||
#if 0
|
||||
static int32_t container_set_ffmpeg_buf_seek_time(int32_t *time)
|
||||
{
|
||||
ffmpeg_buf_seek_time = (*time);
|
||||
return cERR_CONTAINER_FFMPEG_NO_ERROR;
|
||||
}
|
||||
|
||||
#endif
|
||||
static int32_t container_set_ffmpeg_buf_size(int32_t *size)
|
||||
{
|
||||
if (ffmpeg_buf == NULL)
|
||||
@@ -229,13 +229,13 @@ static int32_t container_get_fillbufstatus(int32_t *size)
|
||||
}
|
||||
return cERR_CONTAINER_FFMPEG_NO_ERROR;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int32_t container_stop_buffer()
|
||||
{
|
||||
ffmpeg_buf_stop = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
//flag 0: start direct
|
||||
//flag 1: from thread
|
||||
static void ffmpeg_filler(Context_t *context, int32_t id, int32_t *inpause, int32_t flag)
|
||||
@@ -414,7 +414,7 @@ static int32_t ffmpeg_start_fillerTHREAD(Context_t *context)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int32_t ffmpeg_read_real(void *opaque, uint8_t *buf, int32_t buf_size)
|
||||
static int32_t ffmpeg_read_real(void *opaque __attribute__((unused)), uint8_t *buf, int32_t buf_size)
|
||||
{
|
||||
int32_t len = buf_size;
|
||||
int32_t rwdiff = 0;
|
||||
@@ -495,7 +495,7 @@ static int32_t ffmpeg_read(void *opaque, uint8_t *buf, int32_t buf_size)
|
||||
return sumlen;
|
||||
}
|
||||
|
||||
static int64_t ffmpeg_seek(void *opaque, int64_t offset, int32_t whence)
|
||||
static int64_t ffmpeg_seek(void *opaque __attribute__((unused)), int64_t offset, int32_t whence)
|
||||
{
|
||||
int64_t diff;
|
||||
int32_t rwdiff = 0;
|
||||
|
@@ -147,7 +147,7 @@ static int32_t seek_target_flag = 0;
|
||||
/* ***************************** */
|
||||
static int32_t container_ffmpeg_seek_bytes(off_t pos);
|
||||
static int32_t container_ffmpeg_seek(Context_t *context, int64_t sec, uint8_t absolute);
|
||||
static int32_t container_ffmpeg_seek_rel(Context_t *context, off_t pos, int64_t pts, int64_t sec);
|
||||
//static int32_t container_ffmpeg_seek_rel(Context_t *context, off_t pos, int64_t pts, int64_t sec);
|
||||
static int32_t container_ffmpeg_get_length(Context_t *context, int64_t *length);
|
||||
static int64_t calcPts(uint32_t avContextIdx, AVStream *stream, int64_t pts);
|
||||
|
||||
@@ -204,7 +204,7 @@ static int32_t flv2mpeg4_converter = 0;
|
||||
/* MISC Functions */
|
||||
/* ***************************** */
|
||||
|
||||
static void ffmpeg_silen_callback(void *avcl, int level, const char *fmt, va_list vl)
|
||||
static void ffmpeg_silen_callback(void *avcl __attribute__((unused)), int level __attribute__((unused)), const char *fmt __attribute__((unused)), va_list vl __attribute__((unused)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -287,7 +287,7 @@ static void initMutex(void)
|
||||
mutexInitialized = 1;
|
||||
}
|
||||
|
||||
static void getMutex(const char *filename __attribute__((unused)), const char *function __attribute__((unused)), int32_t line)
|
||||
static void getMutex(const char *filename __attribute__((unused)), const char *function __attribute__((unused)), int32_t line __attribute__((unused)))
|
||||
{
|
||||
ffmpeg_printf(100, "::%d requesting mutex\n", line);
|
||||
if (!mutexInitialized)
|
||||
@@ -298,13 +298,13 @@ static void getMutex(const char *filename __attribute__((unused)), const char *f
|
||||
ffmpeg_printf(100, "::%d received mutex\n", line);
|
||||
}
|
||||
|
||||
static void releaseMutex(const char *filename __attribute__((unused)), const const char *function __attribute__((unused)), int32_t line)
|
||||
static void releaseMutex(const char *filename __attribute__((unused)), const const char *function __attribute__((unused)), int32_t line __attribute__((unused)))
|
||||
{
|
||||
pthread_mutex_unlock(&mutex);
|
||||
ffmpeg_printf(100, "::%d released mutex\n", line);
|
||||
}
|
||||
|
||||
static char *Codec2Encoding(int32_t codec_id, int32_t media_type, uint8_t *extradata, int extradata_size, int profile, int32_t *version)
|
||||
static char *Codec2Encoding(int32_t codec_id, int32_t media_type, uint8_t *extradata, int extradata_size, int profile __attribute__((unused)), int32_t *version)
|
||||
{
|
||||
ffmpeg_printf(10, "Codec ID: %d (%.8lx)\n", codec_id, codec_id);
|
||||
switch (codec_id)
|
||||
@@ -524,8 +524,8 @@ static void FFMPEGThread(Context_t *context)
|
||||
threadname[16] = 0;
|
||||
prctl(PR_SET_NAME, (unsigned long)&threadname);
|
||||
AVPacket packet;
|
||||
off_t lastSeek = -1;
|
||||
int64_t lastPts = -1;
|
||||
//off_t lastSeek = -1;
|
||||
//int64_t lastPts = -1;
|
||||
int64_t currentVideoPts = -1;
|
||||
int64_t currentAudioPts = -1;
|
||||
/* lastVideoDts and lastAudioDts
|
||||
@@ -535,7 +535,7 @@ static void FFMPEGThread(Context_t *context)
|
||||
int64_t lastAudioDts = -1;
|
||||
int64_t showtime = 0;
|
||||
int64_t bofcount = 0;
|
||||
int32_t err = 0;
|
||||
//int32_t err = 0;
|
||||
AudioVideoOut_t avOut;
|
||||
g_context = context;
|
||||
SwrContext *swr = NULL;
|
||||
@@ -696,7 +696,7 @@ static void FFMPEGThread(Context_t *context)
|
||||
ffmpeg_err("error getting subtitle track\n");
|
||||
}
|
||||
ffmpeg_printf(200, "packet.size %d - index %d\n", packet.size, pid);
|
||||
if (videoTrack && (videoTrack->AVIdx == cAVIdx) && (videoTrack->Id == pid))
|
||||
if (videoTrack && (videoTrack->AVIdx == (int)cAVIdx) && (videoTrack->Id == pid))
|
||||
{
|
||||
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(56, 34, 100)
|
||||
AVCodecContext *codec_context = videoTrack->avCodecCtx;
|
||||
@@ -785,7 +785,7 @@ static void FFMPEGThread(Context_t *context)
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (audioTrack && (audioTrack->AVIdx == cAVIdx) && (audioTrack->Id == pid))
|
||||
else if (audioTrack && (audioTrack->AVIdx == (int)cAVIdx) && (audioTrack->Id == pid))
|
||||
{
|
||||
uint8_t skipPacket = 0;
|
||||
currentAudioPts = audioTrack->pts = pts = calcPts(cAVIdx, audioTrack->stream, packet.pts);
|
||||
@@ -1070,7 +1070,7 @@ static void FFMPEGThread(Context_t *context)
|
||||
else if (subtitleTrack && (subtitleTrack->Id == pid))
|
||||
{
|
||||
int64_t duration = -1;
|
||||
int64_t pts = calcPts(cAVIdx, subtitleTrack->stream, packet.pts);
|
||||
pts = calcPts(cAVIdx, subtitleTrack->stream, packet.pts);
|
||||
AVStream *stream = subtitleTrack->stream;
|
||||
if (packet.duration != 0)
|
||||
{
|
||||
@@ -1563,7 +1563,7 @@ int32_t container_ffmpeg_init_av_context(Context_t *context, char *filename, int
|
||||
|
||||
int32_t container_ffmpeg_init(Context_t *context, PlayFiles_t *playFilesNames)
|
||||
{
|
||||
int32_t err = 0;
|
||||
//int32_t err = 0;
|
||||
ffmpeg_printf(10, ">\n");
|
||||
if (playFilesNames == NULL)
|
||||
{
|
||||
@@ -1700,7 +1700,7 @@ int32_t container_ffmpeg_update_tracks(Context_t *context, char *filename, int32
|
||||
}
|
||||
}
|
||||
}
|
||||
int32_t n = 0;
|
||||
uint32_t n = 0;
|
||||
for (n = 0; n < avContext->nb_streams; n++)
|
||||
{
|
||||
Track_t track;
|
||||
@@ -2281,7 +2281,7 @@ static int32_t container_ffmpeg_seek_bytes(off_t pos)
|
||||
ffmpeg_printf(30, "current_pos after seek %lld\n", avio_tell(avContextTab[0]->pb));
|
||||
return cERR_CONTAINER_FFMPEG_NO_ERROR;
|
||||
}
|
||||
|
||||
#if 0 //unused
|
||||
/* seeking relative to a given byteposition N seconds ->for reverse playback needed */
|
||||
static int32_t container_ffmpeg_seek_rel(Context_t *context, off_t pos, int64_t pts, int64_t sec)
|
||||
{
|
||||
@@ -2357,12 +2357,12 @@ static int32_t container_ffmpeg_seek_rel(Context_t *context, off_t pos, int64_t
|
||||
releaseMutex(__FILE__, __FUNCTION__, __LINE__);
|
||||
return cERR_CONTAINER_FFMPEG_NO_ERROR;
|
||||
}
|
||||
|
||||
#endif
|
||||
static int32_t container_ffmpeg_seek(Context_t *context, int64_t sec, uint8_t absolute)
|
||||
{
|
||||
Track_t *videoTrack = NULL;
|
||||
Track_t *audioTrack = NULL;
|
||||
Track_t *current = NULL;
|
||||
// Track_t *current = NULL;
|
||||
seek_target_flag = 0;
|
||||
if (!absolute)
|
||||
{
|
||||
@@ -2391,6 +2391,13 @@ static int32_t container_ffmpeg_seek(Context_t *context, int64_t sec, uint8_t ab
|
||||
}
|
||||
context->manager->video->Command(context, MANAGER_GET_TRACK, &videoTrack);
|
||||
context->manager->audio->Command(context, MANAGER_GET_TRACK, &audioTrack);
|
||||
if (!videoTrack && !audioTrack)
|
||||
{
|
||||
ffmpeg_err("no track available to seek\n");
|
||||
return cERR_CONTAINER_FFMPEG_ERR;
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (videoTrack != NULL)
|
||||
{
|
||||
current = videoTrack;
|
||||
@@ -2404,6 +2411,8 @@ static int32_t container_ffmpeg_seek(Context_t *context, int64_t sec, uint8_t ab
|
||||
ffmpeg_err("no track available to seek\n");
|
||||
return cERR_CONTAINER_FFMPEG_ERR;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (sec < 0)
|
||||
{
|
||||
seek_target_flag |= AVSEEK_FLAG_BACKWARD;
|
||||
@@ -2502,7 +2511,7 @@ static int32_t container_ffmpeg_get_length(Context_t *context, int64_t *length)
|
||||
return cERR_CONTAINER_FFMPEG_NO_ERROR;
|
||||
}
|
||||
|
||||
static int32_t container_ffmpeg_switch_audio(Context_t *context, int32_t *arg)
|
||||
static int32_t container_ffmpeg_switch_audio(Context_t *context, int32_t *arg __attribute__((unused)))
|
||||
{
|
||||
ffmpeg_printf(10, "track %d\n", *arg);
|
||||
/* Hellmaster1024: nothing to do here! */
|
||||
@@ -2511,7 +2520,7 @@ static int32_t container_ffmpeg_switch_audio(Context_t *context, int32_t *arg)
|
||||
return cERR_CONTAINER_FFMPEG_NO_ERROR;
|
||||
}
|
||||
|
||||
static int32_t container_ffmpeg_switch_subtitle(Context_t *context, int32_t *arg)
|
||||
static int32_t container_ffmpeg_switch_subtitle(Context_t *context, int32_t *arg __attribute__((unused)))
|
||||
{
|
||||
ffmpeg_printf(10, "track %d\n", *arg);
|
||||
/* This is made to flush inside the buffer because
|
||||
|
@@ -87,12 +87,12 @@ static void mpeg4p2_context_reset(Mpeg4P2Context *context)
|
||||
context->packet_duration = 0;
|
||||
}
|
||||
|
||||
static void mpeg4p2_write(Context_t *ctx, Track_t *track, int avContextIdx, int64_t *currentVideoPts, int64_t *latestPts, AVPacket *pkt)
|
||||
static void mpeg4p2_write(Context_t *ctx, Track_t *track, int avContextIdx, int64_t *pts_current, int64_t *pts_latest, AVPacket *pkt)
|
||||
{
|
||||
*currentVideoPts = track->pts = calcPts(avContextIdx, track->stream, pkt->pts);
|
||||
if ((*currentVideoPts > *latestPts) && (*currentVideoPts != INVALID_PTS_VALUE))
|
||||
*pts_current = track->pts = calcPts(avContextIdx, track->stream, pkt->pts);
|
||||
if ((*pts_current > *pts_latest) && (*pts_current != INVALID_PTS_VALUE))
|
||||
{
|
||||
*latestPts = *currentVideoPts;
|
||||
*pts_latest = *pts_current;
|
||||
}
|
||||
track->dts = calcPts(avContextIdx, track->stream, pkt->dts);
|
||||
AudioVideoOut_t avOut;
|
||||
|
@@ -39,7 +39,7 @@ static void wrapped_packet_unref(void *param)
|
||||
#endif
|
||||
}
|
||||
|
||||
static void wrapped_set_max_analyze_duration(void *param, int val)
|
||||
static void wrapped_set_max_analyze_duration(void *param, int val __attribute__((unused)))
|
||||
{
|
||||
#if (LIBAVFORMAT_VERSION_MAJOR > 55) && (LIBAVFORMAT_VERSION_MAJOR < 56)
|
||||
((AVFormatContext *)param)->max_analyze_duration2 = val;
|
||||
@@ -114,7 +114,7 @@ void free_all_stored_avcodec_context()
|
||||
}
|
||||
}
|
||||
|
||||
int store_avcodec_context(AVCodecContext *avCodecCtx, uint32_t cAVIdx, int id)
|
||||
int store_avcodec_context(AVCodecContext *avCodecCtx __attribute__((unused)), uint32_t cAVIdx __attribute__((unused)), int id __attribute__((unused)))
|
||||
{
|
||||
CodecCtxStoreItem_t *ptr = malloc(sizeof(CodecCtxStoreItem_t));
|
||||
if (!ptr)
|
||||
@@ -152,8 +152,8 @@ static AVCodecContext *wrapped_avcodec_get_context(uint32_t cAVIdx, AVStream *st
|
||||
}
|
||||
av_codec_set_pkt_timebase(avCodecCtx, stream->time_base);
|
||||
store_avcodec_context(avCodecCtx, cAVIdx, stream->id);
|
||||
return avCodecCtx;
|
||||
}
|
||||
return avCodecCtx;
|
||||
#else
|
||||
return stream->codec;
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user