mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 23:13:16 +02:00
libeplayer3-arm: reduce compiler warnings
This commit is contained in:
@@ -87,7 +87,7 @@ bool cPlayback::Start(std::string filename, std::string headers)
|
||||
return Start((char *) filename.c_str(), 0, 0, 0, 0, 0, headers);
|
||||
}
|
||||
|
||||
bool cPlayback::Start(char *filename, int vpid, int vtype, int apid, int ac3, int, std::string headers)
|
||||
bool cPlayback::Start(char *filename, int vpid, int vtype, int apid, int ac3, int, std::string headers __attribute__((unused)))
|
||||
{
|
||||
bool ret = false;
|
||||
bool isHTTP = false;
|
||||
@@ -247,7 +247,7 @@ bool cPlayback::SetAPid(int pid, bool /* ac3 */)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cPlayback::SetVPid(int pid)
|
||||
bool cPlayback::SetVPid(int /*pid*/)
|
||||
{
|
||||
lt_info("%s\n", __func__);
|
||||
return true;
|
||||
@@ -269,7 +269,7 @@ bool cPlayback::SetSubtitlePid(int pid)
|
||||
bool cPlayback::SetTeletextPid(int pid)
|
||||
{
|
||||
lt_info("%s\n", __func__);
|
||||
int i = pid;
|
||||
//int i = pid;
|
||||
if (pid != mTeletextStream)
|
||||
{
|
||||
//if(player && player->playback)
|
||||
@@ -534,10 +534,10 @@ void cPlayback::FindAllSubtitlePids(int *pids, unsigned int *numpids, std::strin
|
||||
}
|
||||
}
|
||||
|
||||
void cPlayback::FindAllTeletextsubtitlePids(int *pids, unsigned int *numpids, std::string *language, int *mags, int *pages)
|
||||
void cPlayback::FindAllTeletextsubtitlePids(int */*pids*/, unsigned int *numpids, std::string */*language*/, int */*mags*/, int */*pages*/)
|
||||
{
|
||||
lt_info("%s\n", __func__);
|
||||
int max_numpids = *numpids;
|
||||
//int max_numpids = *numpids;
|
||||
*numpids = 0;
|
||||
/*
|
||||
if (player && player->manager && player->manager->teletext)
|
||||
|
@@ -40,7 +40,7 @@ class cPlayback
|
||||
bool Start(char *filename, int vpid, int vtype, int apid, int ac3, int duration, std::string headers = "");
|
||||
bool Start(std::string filename, std::string headers = "");
|
||||
bool SetAPid(int pid, bool ac3 = false);
|
||||
bool SetVPid(int pid);
|
||||
bool SetVPid(int /*pid*/);
|
||||
bool SetSubtitlePid(int pid);
|
||||
bool SetTeletextPid(int pid);
|
||||
int GetAPid(void) { return mAudioStream; }
|
||||
@@ -58,7 +58,7 @@ class cPlayback
|
||||
void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *numpida, std::string *language) { FindAllSubs((int*) pids, (unsigned int*) supported, (unsigned int*) numpida, language); };
|
||||
bool SelectSubtitles(int pid, std::string charset = "");
|
||||
void FindAllSubtitlePids(int *pids, unsigned int *numpids, std::string *language);
|
||||
void FindAllTeletextsubtitlePids(int *pids, unsigned int *numpidt, std::string *tlanguage, int *mags, int *pages);
|
||||
void FindAllTeletextsubtitlePids(int */*pids*/, unsigned int *numpidt, std::string */*tlanguage*/, int */*mags*/, int */*pages*/);
|
||||
void RequestAbort(void);
|
||||
bool IsPlaying(void);
|
||||
uint64_t GetReadCount(void);
|
||||
|
@@ -290,7 +290,7 @@ int image_to_mpeg2(const char *image_name, int fd)
|
||||
uint8_t endcode[] = { 0, 0, 1, 0xb7 };
|
||||
write_all(fd,endcode, sizeof(endcode));
|
||||
}
|
||||
av_free_packet(&packet);
|
||||
av_packet_unref(&packet);
|
||||
}
|
||||
avcodec_close(codecContext);
|
||||
}
|
||||
|
@@ -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
|
||||
|
2
libeplayer3-arm/external/ffmpeg/get_bits.h
vendored
2
libeplayer3-arm/external/ffmpeg/get_bits.h
vendored
@@ -368,7 +368,7 @@ static inline unsigned int show_bits_long(GetBitContext *s, int n)
|
||||
}
|
||||
}
|
||||
|
||||
static inline int check_marker(void *logctx, GetBitContext *s, const char *msg)
|
||||
static inline int check_marker(void *logctx __attribute__((unused)), GetBitContext *s, const char *msg __attribute__((unused)))
|
||||
{
|
||||
int bit = get_bits1(s);
|
||||
return bit;
|
||||
|
@@ -71,8 +71,7 @@ static inline int get_object_type(GetBitContext *gb)
|
||||
static inline int get_sample_rate(GetBitContext *gb, int *index)
|
||||
{
|
||||
*index = get_bits(gb, 4);
|
||||
return *index == 0x0f ? get_bits(gb, 24) :
|
||||
avpriv_mpeg4audio_sample_rates[*index];
|
||||
return *index == 0x0f ? (int)get_bits(gb, 24) : avpriv_mpeg4audio_sample_rates[*index];
|
||||
}
|
||||
|
||||
int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf,
|
||||
@@ -88,7 +87,7 @@ int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf,
|
||||
c->object_type = get_object_type(&gb);
|
||||
c->sample_rate = get_sample_rate(&gb, &c->sampling_index);
|
||||
c->chan_config = get_bits(&gb, 4);
|
||||
if (c->chan_config < FF_ARRAY_ELEMS(ff_mpeg4audio_channels))
|
||||
if (c->chan_config < (int)FF_ARRAY_ELEMS(ff_mpeg4audio_channels))
|
||||
c->channels = ff_mpeg4audio_channels[c->chan_config];
|
||||
c->sbr = -1;
|
||||
c->ps = -1;
|
||||
|
@@ -24,7 +24,7 @@
|
||||
|
||||
static inline int HasADTSHeader(uint8_t *data, int size)
|
||||
{
|
||||
if (size >= AAC_HEADER_LENGTH && 0xFF == data[0] && 0xF0 == 0xF0 & data[1] &&
|
||||
if (size >= AAC_HEADER_LENGTH && 0xFF == data[0] && 0xF0 == (0xF0 & data[1]) &&
|
||||
size == ((data[3] & 0x3) << 11 | data[4] << 3 | data[5] >> 5))
|
||||
{
|
||||
return 1;
|
||||
|
@@ -88,7 +88,7 @@ static int g_pfd[2] = {-1, -1}; /* Used to wake terminate thread */
|
||||
static int isPlaybackStarted = 0;
|
||||
static pthread_mutex_t playbackStartMtx;
|
||||
|
||||
static void *TermThreadFun(void *arg)
|
||||
static void *TermThreadFun(void *arg __attribute__((unused)))
|
||||
{
|
||||
const char *socket_path = "/tmp/iptvplayer_extplayer_term_fd";
|
||||
struct sockaddr_un addr;
|
||||
@@ -211,7 +211,7 @@ static void SetNice(int prio)
|
||||
};
|
||||
sched_setscheduler(0, SCHED_RR, ¶m);
|
||||
#else
|
||||
int prevPrio = getpriority(PRIO_PROCESS, 0);
|
||||
//int prevPrio = getpriority(PRIO_PROCESS, 0);
|
||||
if (-1 == setpriority(PRIO_PROCESS, 0, prio))
|
||||
{
|
||||
printf("setpriority - failed\n");
|
||||
@@ -484,9 +484,9 @@ static int ParseParams(int argc, char *argv[], char *file, char *audioFile, int
|
||||
{
|
||||
int ret = 0;
|
||||
int c;
|
||||
int digit_optind = 0;
|
||||
int aopt = 0, bopt = 0;
|
||||
char *copt = 0, *dopt = 0;
|
||||
//int digit_optind = 0;
|
||||
//int aopt = 0, bopt = 0;
|
||||
//char *copt = 0, *dopt = 0;
|
||||
while ((c = getopt(argc, argv, "we3dlsrimva:n:x:u:c:h:o:p:P:t:9:0:1:4:f:")) != -1)
|
||||
{
|
||||
switch (c)
|
||||
@@ -877,7 +877,7 @@ int main(int argc, char *argv[])
|
||||
CurrentSec = (int32_t)(pts / 90000);
|
||||
if (0 == commandRetVal)
|
||||
{
|
||||
fprintf(stderr, "{\"J\":{\"ms\":%lld}}\n", pts / 90, commandRetVal);
|
||||
fprintf(stderr, "{\"J\":{\"ms\":%lld}}\n", pts / 90);
|
||||
}
|
||||
if (0 == commandRetVal || force)
|
||||
{
|
||||
@@ -922,7 +922,7 @@ int main(int argc, char *argv[])
|
||||
commandRetVal = g_player->playback->Command(g_player, PLAYBACK_PTS, &pts);
|
||||
if (0 == commandRetVal)
|
||||
{
|
||||
fprintf(stderr, "{\"J\":{\"ms\":%lld}}\n", pts / 90, commandRetVal);
|
||||
fprintf(stderr, "{\"J\":{\"ms\":%lld}}\n", pts / 90);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -941,7 +941,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
case 'n':
|
||||
{
|
||||
uint8_t loop = 0;
|
||||
//uint8_t loop = 0;
|
||||
if ('1' == argvBuff[1] || '0' == argvBuff[1])
|
||||
{
|
||||
PlaybackHandler_t *ptrP = g_player->playback;
|
||||
|
@@ -54,12 +54,11 @@
|
||||
|
||||
#ifdef SAM_WITH_DEBUG
|
||||
#define LINUXDVB_DEBUG
|
||||
static unsigned short debug_level = 20;
|
||||
#else
|
||||
#define LINUXDVB_SILENT
|
||||
#endif
|
||||
|
||||
static unsigned short debug_level = 20;
|
||||
|
||||
static const char FILENAME[] = __FILE__;
|
||||
|
||||
#ifdef LINUXDVB_DEBUG
|
||||
@@ -311,8 +310,9 @@ int LinuxDvbPlay(Context_t *context, char *type)
|
||||
}
|
||||
free(Encoding);
|
||||
}
|
||||
//return ret;
|
||||
return 0;
|
||||
ret = cERR_LINUXDVB_NO_ERROR;
|
||||
return ret;
|
||||
//return 0;
|
||||
}
|
||||
|
||||
int LinuxDvbStop(Context_t *context __attribute__((unused)), char *type)
|
||||
@@ -425,7 +425,7 @@ int LinuxDvbContinue(Context_t *context __attribute__((unused)), char *type)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int LinuxDvbReverseDiscontinuity(Context_t *context __attribute__((unused)), int *surplus)
|
||||
int LinuxDvbReverseDiscontinuity(Context_t *context __attribute__((unused)), int *surplus __attribute__((unused)))
|
||||
{
|
||||
int ret = cERR_LINUXDVB_NO_ERROR;
|
||||
// int dis_type = VIDEO_DISCONTINUITY_CONTINUOUS_REVERSE | *surplus;
|
||||
@@ -474,7 +474,7 @@ int LinuxDvbAudioMute(Context_t *context __attribute__((unused)), char *flag)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int LinuxDvbFlush(Context_t *context __attribute__((unused)), char *type)
|
||||
int LinuxDvbFlush(Context_t *context __attribute__((unused)), char *type __attribute__((unused)))
|
||||
{
|
||||
// unsigned char video = !strcmp("video", type);
|
||||
// unsigned char audio = !strcmp("audio", type);
|
||||
@@ -507,6 +507,7 @@ int LinuxDvbFastForward(Context_t *context, char *type)
|
||||
int ret = cERR_LINUXDVB_NO_ERROR;
|
||||
unsigned char video = !strcmp("video", type);
|
||||
unsigned char audio = !strcmp("audio", type);
|
||||
if (audio) {}
|
||||
linuxdvb_printf(10, "v%d a%d speed %d\n", video, audio, context->playback->Speed);
|
||||
if (video && videofd != -1)
|
||||
{
|
||||
@@ -601,7 +602,7 @@ int LinuxDvbSlowMotion(Context_t *context, char *type)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int LinuxDvbAVSync(Context_t *context, char *type __attribute__((unused)))
|
||||
int LinuxDvbAVSync(Context_t *context __attribute__((unused)), char *type __attribute__((unused)))
|
||||
{
|
||||
int ret = cERR_LINUXDVB_NO_ERROR;
|
||||
/* konfetti: this one is dedicated to audiofd so we
|
||||
@@ -691,7 +692,7 @@ int LinuxDvbPts(Context_t *context __attribute__((unused)), unsigned long long i
|
||||
return ret;
|
||||
}
|
||||
|
||||
int LinuxDvbGetFrameCount(Context_t *context __attribute__((unused)), unsigned long long int *frameCount)
|
||||
int LinuxDvbGetFrameCount(Context_t *context __attribute__((unused)), unsigned long long int *frameCount __attribute__((unused)))
|
||||
{
|
||||
int ret = cERR_LINUXDVB_NO_ERROR;
|
||||
return ret;
|
||||
|
@@ -97,14 +97,14 @@ static int isSubtitleOpened = 0;
|
||||
/* Functions */
|
||||
/* ***************************** */
|
||||
|
||||
static void getMutex(int line)
|
||||
static void getMutex(int line __attribute__((unused)))
|
||||
{
|
||||
subtitle_printf(100, "%d requesting mutex\n", line);
|
||||
pthread_mutex_lock(&mutex);
|
||||
subtitle_printf(100, "%d received mutex\n", line);
|
||||
}
|
||||
|
||||
static void releaseMutex(int line)
|
||||
static void releaseMutex(int line __attribute__((unused)))
|
||||
{
|
||||
pthread_mutex_unlock(&mutex);
|
||||
subtitle_printf(100, "%d released mutex\n", line);
|
||||
@@ -202,7 +202,7 @@ static int Write(void *_context, void *data)
|
||||
}
|
||||
out = (SubtitleOut_t *) data;
|
||||
context->manager->subtitle->Command(context, MANAGER_GET, &curtrackid);
|
||||
if (curtrackid != out->trackId)
|
||||
if (curtrackid != (int32_t)out->trackId)
|
||||
{
|
||||
Flush();
|
||||
}
|
||||
@@ -232,7 +232,7 @@ static int Write(void *_context, void *data)
|
||||
|
||||
static int32_t subtitle_Open(Context_t *context __attribute__((unused)))
|
||||
{
|
||||
uint32_t i = 0 ;
|
||||
//uint32_t i = 0 ;
|
||||
subtitle_printf(10, "\n");
|
||||
if (isSubtitleOpened == 1)
|
||||
{
|
||||
@@ -248,7 +248,7 @@ static int32_t subtitle_Open(Context_t *context __attribute__((unused)))
|
||||
|
||||
static int32_t subtitle_Close(Context_t *context __attribute__((unused)))
|
||||
{
|
||||
uint32_t i = 0 ;
|
||||
//uint32_t i = 0 ;
|
||||
subtitle_printf(10, "\n");
|
||||
getMutex(__LINE__);
|
||||
isSubtitleOpened = 0;
|
||||
@@ -257,7 +257,7 @@ static int32_t subtitle_Close(Context_t *context __attribute__((unused)))
|
||||
return cERR_SUBTITLE_NO_ERROR;
|
||||
}
|
||||
|
||||
static int Command(void *_context, OutputCmd_t command, void *argument)
|
||||
static int Command(void *_context, OutputCmd_t command, void *argument __attribute__((unused)))
|
||||
{
|
||||
Context_t *context = (Context_t *) _context;
|
||||
int ret = cERR_SUBTITLE_NO_ERROR;
|
||||
|
@@ -182,7 +182,7 @@ static int _writeData(void *_call, int type)
|
||||
else // check LOAS header
|
||||
{
|
||||
if (!(call->len > 2 && call->data[0] == 0x56 && (call->data[1] >> 4) == 0xe &&
|
||||
(AV_RB16(call->data + 1) & 0x1FFF) + 3 == call->len))
|
||||
((uint32_t)(AV_RB16(call->data + 1) & 0x1FFF) + 3) == call->len))
|
||||
{
|
||||
aac_err("parsing Data with wrong latm header. ignoring...\n");
|
||||
return 0;
|
||||
@@ -218,7 +218,7 @@ static int writeDataADTS(void *_call)
|
||||
aac_err("file pointer < 0. ignoring ...\n");
|
||||
return 0;
|
||||
}
|
||||
if ((call->private_data && 0 == strncmp("ADTS", call->private_data, call->private_size)) ||
|
||||
if ((call->private_data && 0 == strncmp("ADTS", (const char *)call->private_data, call->private_size)) ||
|
||||
HasADTSHeader(call->data, call->len))
|
||||
{
|
||||
return _writeData(_call, 0);
|
||||
@@ -272,7 +272,7 @@ static int writeDataLATM(void *_call)
|
||||
aac_err("parsing NULL Data. ignoring...\n");
|
||||
return 0;
|
||||
}
|
||||
if (call->private_data && 0 == strncmp("LATM", call->private_data, call->private_size))
|
||||
if (call->private_data && 0 == strncmp("LATM", (const char *)call->private_data, call->private_size))
|
||||
{
|
||||
return _writeData(_call, 1);
|
||||
}
|
||||
|
@@ -117,7 +117,7 @@ static int writeData(void *_call)
|
||||
{
|
||||
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
|
||||
unsigned char PesHeader[PES_MAX_HEADER_SIZE + 4];
|
||||
unsigned char Version = 5;
|
||||
// unsigned char Version = 5;
|
||||
// unsigned int FakeStartCode = (Version << 8) | PES_VERSION_FAKE_START_CODE;
|
||||
divx_printf(10, "\n");
|
||||
if (call == NULL)
|
||||
|
@@ -195,12 +195,14 @@ static int32_t PreparCodecData(unsigned char *data, unsigned int cd_len, unsigne
|
||||
if (cd_len > 7 && data[0] == 1)
|
||||
{
|
||||
unsigned short len = (data[6] << 8) | data[7];
|
||||
if (cd_len >= (len + 8))
|
||||
if (cd_len >= (uint32_t)(len + 8))
|
||||
{
|
||||
unsigned int i = 0;
|
||||
uint8_t profile_num[] = { 66, 77, 88, 100 };
|
||||
uint8_t profile_cmp[2] = { 0x67, 0x00 };
|
||||
const char *profile_str[] = { "baseline", "main", "extended", "high" };
|
||||
/* avoid compiler warning */
|
||||
if (*profile_str) {}
|
||||
memcpy(tmp, Head, sizeof(Head));
|
||||
tmp_len += 4;
|
||||
memcpy(tmp + tmp_len, data + 8, len);
|
||||
@@ -289,7 +291,7 @@ static int writeData(void *_call)
|
||||
unsigned long long int VideoPts;
|
||||
unsigned int TimeDelta;
|
||||
unsigned int TimeScale;
|
||||
int len = 0;
|
||||
unsigned int len = 0;
|
||||
int ic = 0;
|
||||
struct iovec iov[IOVEC_SIZE];
|
||||
h264_printf(20, "\n");
|
||||
@@ -300,6 +302,9 @@ static int writeData(void *_call)
|
||||
}
|
||||
TimeDelta = call->FrameRate;
|
||||
TimeScale = call->FrameScale;
|
||||
/* avoid compiler warnings */
|
||||
if (TimeDelta) {}
|
||||
if (TimeScale) {}
|
||||
VideoPts = call->Pts;
|
||||
h264_printf(20, "VideoPts %lld - %d %d\n", call->Pts, TimeDelta, TimeScale);
|
||||
if ((call->data == NULL) || (call->len <= 0))
|
||||
@@ -314,8 +319,8 @@ static int writeData(void *_call)
|
||||
}
|
||||
/* AnnexA */
|
||||
if (!avc3 && ((1 < call->private_size && 0 == call->private_data[0]) ||
|
||||
(call->len > 3) && ((call->data[0] == 0x00 && call->data[1] == 0x00 && call->data[2] == 0x00 && call->data[3] == 0x01) ||
|
||||
(call->data[0] == 0xff && call->data[1] == 0xff && call->data[2] == 0xff && call->data[3] == 0xff))))
|
||||
((call->len > 3) && ((call->data[0] == 0x00 && call->data[1] == 0x00 && call->data[2] == 0x00 && call->data[3] == 0x01) ||
|
||||
(call->data[0] == 0xff && call->data[1] == 0xff && call->data[2] == 0xff && call->data[3] == 0xff)))))
|
||||
{
|
||||
uint32_t PacketLength = 0;
|
||||
uint32_t FakeStartCode = (call->Version << 8) | PES_VERSION_FAKE_START_CODE;
|
||||
|
@@ -116,7 +116,7 @@ static int32_t PreparCodecData(unsigned char *data, unsigned int cd_len, unsigne
|
||||
}
|
||||
*NalLength = (data[21] & 3) + 1;
|
||||
int num_param_sets = data[22];
|
||||
int pos = 23;
|
||||
uint32_t pos = 23;
|
||||
for (i = 0; i < num_param_sets; i++)
|
||||
{
|
||||
int j;
|
||||
@@ -175,7 +175,7 @@ static int writeData(void *_call)
|
||||
unsigned long long int VideoPts;
|
||||
unsigned int TimeDelta;
|
||||
unsigned int TimeScale;
|
||||
int len = 0;
|
||||
unsigned int len = 0;
|
||||
int ic = 0;
|
||||
struct iovec iov[IOVEC_SIZE];
|
||||
h264_printf(20, "\n");
|
||||
@@ -186,6 +186,9 @@ static int writeData(void *_call)
|
||||
}
|
||||
TimeDelta = call->FrameRate;
|
||||
TimeScale = call->FrameScale;
|
||||
/* avoid compiler warnings */
|
||||
if (TimeDelta) {}
|
||||
if (TimeScale) {}
|
||||
VideoPts = call->Pts;
|
||||
h264_printf(20, "VideoPts %lld - %d %d\n", call->Pts, TimeDelta, TimeScale);
|
||||
if ((call->data == NULL) || (call->len <= 0))
|
||||
|
@@ -152,7 +152,7 @@ static int32_t writeData(void *_call)
|
||||
int32_t block_align = 0;
|
||||
int32_t byterate = 0;
|
||||
uint32_t codecID = (uint32_t)pcmPrivateData->ffmpeg_codec_id;
|
||||
uint8_t dataPrecision = 0;
|
||||
//uint8_t dataPrecision = 0;
|
||||
uint8_t LE = 0;
|
||||
switch (codecID)
|
||||
{
|
||||
@@ -224,6 +224,8 @@ static int32_t writeData(void *_call)
|
||||
fixed_buffer = malloc(fixed_buffersize);
|
||||
}
|
||||
fixed_bufferfilled = 0;
|
||||
/* avoid compiler warning */
|
||||
if (LE) {}
|
||||
//printf("PCM fixed_buffersize [%u] [%s]\n", fixed_buffersize, LE ? "LE":"BE");
|
||||
}
|
||||
while (size > 0)
|
||||
|
@@ -110,7 +110,7 @@ static int reset()
|
||||
static int writeData(void *_call)
|
||||
{
|
||||
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
|
||||
int len = 0;
|
||||
//int len = 0;
|
||||
vc1_printf(10, "\n");
|
||||
if (call == NULL)
|
||||
{
|
||||
|
@@ -106,7 +106,7 @@ static int reset()
|
||||
static int writeData(void *_call)
|
||||
{
|
||||
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
|
||||
int len = 0;
|
||||
//int len = 0;
|
||||
wma_printf(10, "\n");
|
||||
if (call == NULL)
|
||||
{
|
||||
|
@@ -145,7 +145,7 @@ ssize_t write_with_retry(int fd, const void *buf, size_t size)
|
||||
ssize_t writev_with_retry(int fd, const struct iovec *iov, size_t ic)
|
||||
{
|
||||
ssize_t len = 0;
|
||||
int i = 0;
|
||||
uint32_t i = 0;
|
||||
for (i = 0; i < ic; ++i)
|
||||
{
|
||||
write_with_retry(fd, iov[i].iov_base, iov[i].iov_len);
|
||||
|
@@ -32,12 +32,11 @@
|
||||
|
||||
#ifdef SAM_WITH_DEBUG
|
||||
#define PLAYBACK_DEBUG
|
||||
static short debug_level = 20;
|
||||
#else
|
||||
#define PLAYBACK_SILENT
|
||||
#endif
|
||||
|
||||
static short debug_level = 20;
|
||||
|
||||
#ifdef PLAYBACK_DEBUG
|
||||
#define playback_printf(level, fmt, x...) do { \
|
||||
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
|
||||
@@ -560,7 +559,7 @@ static int32_t PlaybackPts(Context_t *context, int64_t *pts)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int32_t PlaybackGetFrameCount(Context_t *context, int64_t *frameCount)
|
||||
static int32_t PlaybackGetFrameCount(Context_t *context, uint64_t *frameCount)
|
||||
{
|
||||
int ret = cERR_PLAYBACK_NO_ERROR;
|
||||
playback_printf(20, "\n");
|
||||
|
Reference in New Issue
Block a user