libeplayer3: get rid of compiler warnings

This commit is contained in:
martii
2013-06-10 15:06:00 +02:00
committed by Stefan Seyfried
parent dd618fc883
commit c3bbda3e9c
32 changed files with 148 additions and 157 deletions

View File

@@ -21,9 +21,9 @@ AM_CFLAGS = -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOUR
# get rid of many warnings. This is not my project, so fixing them is not
# top priority
AM_CFLAGS += \
-Wno-unused -Wno-unused-parameter -Wno-unused-function -Wno-unused-variable \
-Wno-sign-compare -Wno-missing-field-initializers
#AM_CFLAGS += \
# -Wno-unused -Wno-unused-parameter -Wno-unused-function -Wno-unused-variable \
# -Wno-sign-compare -Wno-missing-field-initializers
# silence ffmpeg deprecation warnings
#AM_CPPFLAGS = -Dattribute_deprecated=''

View File

@@ -44,6 +44,11 @@ if (debug_level >= level) printf(x); } while (0)
static const char FILENAME[] = "container.c";
static Container_t * AvailableContainer[] = {
&FFMPEGContainer,
NULL
};
static void printContainerCapabilities() {
int i, j;

View File

@@ -140,7 +140,7 @@ static region_t* firstRegion = NULL;
/* MISC Functions */
/* ***************************** */
void ass_msg_callback(int level, const char *format, va_list va, void *ctx)
void ass_msg_callback(int level __attribute__((unused)), const char *format, va_list va, void *ctx __attribute__((unused)))
{
int n;
char *str;
@@ -614,7 +614,7 @@ int container_ass_init(Context_t *context)
return cERR_CONTAINER_ASS_NO_ERROR;
}
int container_ass_process_data(Context_t *context, SubtitleData_t* data)
int container_ass_process_data(Context_t *context __attribute__((unused)), SubtitleData_t* data)
{
int first_kiss;
@@ -657,7 +657,7 @@ int container_ass_process_data(Context_t *context, SubtitleData_t* data)
return cERR_CONTAINER_ASS_NO_ERROR;
}
static int container_ass_stop(Context_t *context) {
static int container_ass_stop(Context_t *context __attribute__((unused))) {
int ret = cERR_CONTAINER_ASS_NO_ERROR;
int wait_time = 20;
Writer_t* writer;
@@ -716,7 +716,7 @@ static int container_ass_stop(Context_t *context) {
return ret;
}
static int container_ass_switch_subtitle(Context_t* context, int* arg)
static int container_ass_switch_subtitle(Context_t* context, int* arg __attribute__((unused)))
{
int error;
int ret = cERR_CONTAINER_ASS_NO_ERROR;

View File

@@ -64,7 +64,7 @@
#ifdef FFMPEG_DEBUG
static short debug_level = 0;
static short debug_level = 10;
#define ffmpeg_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, FILENAME, __FUNCTION__, ## x); } while (0)
@@ -118,13 +118,15 @@ long long int latestPts = 0;
static int container_ffmpeg_seek_bytes(off_t pos);
static int container_ffmpeg_seek(Context_t *context, float sec, int absolute);
static int container_ffmpeg_seek_rel(Context_t *context, off_t pos, long long int pts, float sec);
#if defined(use_sec_to_seek)
static int container_ffmpeg_seek_bytes_rel(off_t start, off_t bytes);
#endif
/* ***************************** */
/* MISC Functions */
/* ***************************** */
void getMutex(const char *filename, const char *function, int line) {
void getMutex(const char *filename __attribute__((unused)), const char *function __attribute__((unused)), int line) {
ffmpeg_printf(100, "::%d requesting mutex\n", line);
pthread_mutex_lock(&mutex);
@@ -132,7 +134,7 @@ void getMutex(const char *filename, const char *function, int line) {
ffmpeg_printf(100, "::%d received mutex\n", line);
}
void releaseMutex(const char *filename, const const char *function, int line) {
void releaseMutex(const char *filename __attribute__((unused)), const const char *function __attribute__((unused)), int line) {
pthread_mutex_unlock(&mutex);
ffmpeg_printf(100, "::%d released mutex\n", line);
@@ -325,13 +327,13 @@ static void FFMPEGThread(Context_t *context) {
threadname[16] = 0;
prctl (PR_SET_NAME, (unsigned long)&threadname);
AVPacket packet;
off_t lastReverseSeek = 0; /* max address to read before seek again in reverse play */
off_t lastSeek = -1;
long long int lastPts = -1, currentVideoPts = -1, currentAudioPts = -1, showtime = 0, bofcount = 0;
#ifdef MARTII
long long int currentDvbsubtitlePts = -1, currentTeletextPts = -1;
int err = 0, audioMute = 0;
#ifdef reverse_playback_2
int gotlastPts = 0;
off_t lastReverseSeek = 0; /* max address to read before seek again in reverse play */
#endif
int err = 0, gotlastPts = 0, audioMute = 0;
AudioVideoOut_t avOut;
#ifdef USE_LIBSWRESAMPLE
@@ -479,12 +481,7 @@ static void FFMPEGThread(Context_t *context) {
#endif
getMutex(FILENAME, __FUNCTION__,__LINE__);
#define use_read_frame
#ifdef use_read_frame
if (av_read_frame(avContext, &packet) == 0 )
#else
if (av_read_packet(avContext, &packet) == 0 )
#endif
{
long long int pts;
Track_t * videoTrack = NULL;
@@ -828,7 +825,7 @@ static void FFMPEGThread(Context_t *context) {
ffmpeg_err("error decoding subtitle\n");
} else
{
int i;
unsigned int i;
ffmpeg_printf(0, "format %d\n", sub.format);
ffmpeg_printf(0, "start_display_time %d\n", sub.start_display_time);
@@ -1063,7 +1060,7 @@ int container_ffmpeg_update_tracks(Context_t *context, char *filename)
if (terminating)
return cERR_CONTAINER_FFMPEG_NO_ERROR;
int n;
unsigned int n;
if (context->manager->audio)
context->manager->audio->Command(context, MANAGER_DEL, NULL);
@@ -1555,6 +1552,7 @@ static int container_ffmpeg_seek_bytes(off_t pos) {
return cERR_CONTAINER_FFMPEG_NO_ERROR;
}
#if defined(use_sec_to_seek)
/* seeking relative to a given byteposition N bytes ->for reverse playback needed */
static int container_ffmpeg_seek_bytes_rel(off_t start, off_t bytes) {
int flag = AVSEEK_FLAG_BYTE;
@@ -1592,6 +1590,7 @@ static int container_ffmpeg_seek_bytes_rel(off_t start, off_t bytes) {
return cERR_CONTAINER_FFMPEG_NO_ERROR;
}
#endif
/* seeking relative to a given byteposition N seconds ->for reverse playback needed */
static int container_ffmpeg_seek_rel(Context_t *context, off_t pos, long long int pts, float sec) {
@@ -1839,18 +1838,18 @@ static int container_ffmpeg_swich_audio(Context_t* context, int* arg)
return cERR_CONTAINER_FFMPEG_NO_ERROR;
}
static int container_ffmpeg_swich_subtitle(Context_t* context, int* arg)
static int container_ffmpeg_swich_subtitle(Context_t* context __attribute__((unused)), int* arg __attribute__((unused)))
{
/* Hellmaster1024: nothing to do here!*/
return cERR_CONTAINER_FFMPEG_NO_ERROR;
}
static int container_ffmpeg_switch_dvbsubtitle(Context_t* context, int* arg)
static int container_ffmpeg_switch_dvbsubtitle(Context_t* context __attribute__((unused)), int* arg __attribute__((unused)))
{
return cERR_CONTAINER_FFMPEG_NO_ERROR;
}
static int container_ffmpeg_switch_teletext(Context_t* context, int* arg)
static int container_ffmpeg_switch_teletext(Context_t* context __attribute__((unused)), int* arg __attribute__((unused)))
{
return cERR_CONTAINER_FFMPEG_NO_ERROR;
}

View File

@@ -212,7 +212,7 @@ static void* SrtSubtitleThread(void *data) {
/* Functions */
/* ***************************** */
static void SrtManagerAdd(Context_t *context, SrtTrack_t track) {
static void SrtManagerAdd(Context_t *context __attribute__((unused)), SrtTrack_t track) {
srt_printf(10, "%s %d\n",track.File, track.Id);
if (Tracks == NULL) {
@@ -226,7 +226,8 @@ static void SrtManagerAdd(Context_t *context, SrtTrack_t track) {
}
}
static char ** SrtManagerList(Context_t *context) {
#if 0
static char ** SrtManagerList(Context_t *context __attribute__((unused))) {
char ** tracklist = NULL;
srt_printf(10, "\n");
@@ -248,8 +249,9 @@ static char ** SrtManagerList(Context_t *context) {
return tracklist;
}
#endif
static void SrtManagerDel(Context_t * context) {
static void SrtManagerDel(Context_t * context __attribute__((unused))) {
int i = 0;
srt_printf(10, "\n");
@@ -362,11 +364,11 @@ static int SrtGetSubtitle(Context_t *context, char * Filename) {
SrtManagerAdd(context, SrtSubtitle);
Track_t Subtitle = {
subtitleExtension,
"S_TEXT/SRT",
i++,
};
Track_t Subtitle;
memset(&Subtitle, 0, sizeof(Subtitle));
Subtitle.Name = subtitleExtension;
Subtitle.Encoding = "S_TEXT/SRT";
Subtitle.Id = i++,
context->manager->subtitle->Command(context, MANAGER_ADD, &Subtitle);
}
@@ -382,7 +384,7 @@ static int SrtGetSubtitle(Context_t *context, char * Filename) {
return cERR_SRT_NO_ERROR;
}
static int SrtOpenSubtitle(Context_t *context, int trackid) {
static int SrtOpenSubtitle(Context_t *context __attribute__((unused)), int trackid) {
srt_printf(10, "\n");
if(trackid < TEXTSRTOFFSET || (trackid % TEXTSRTOFFSET) >= TrackCount) {
@@ -406,7 +408,7 @@ static int SrtOpenSubtitle(Context_t *context, int trackid) {
return cERR_SRT_NO_ERROR;
}
static int SrtCloseSubtitle(Context_t *context) {
static int SrtCloseSubtitle(Context_t *context __attribute__((unused))) {
srt_printf(10, "\n");
if(fsub)

View File

@@ -217,7 +217,7 @@ static void* SsaSubtitleThread(void *Data) {
/* Functions */
/* ***************************** */
static void SsaManagerAdd(Context_t *context, SsaTrack_t track) {
static void SsaManagerAdd(Context_t *context __attribute__((unused)), SsaTrack_t track) {
ssa_printf(10, "%s %d\n", track.File, track.Id);
if (Tracks == NULL) {
@@ -231,7 +231,8 @@ static void SsaManagerAdd(Context_t *context, SsaTrack_t track) {
}
}
static char ** SsaManagerList(Context_t *context) {
#if 0
static char ** SsaManagerList(Context_t *context __attribute__((unused))) {
char ** tracklist = NULL;
ssa_printf(10, "\n");
@@ -251,8 +252,9 @@ static char ** SsaManagerList(Context_t *context) {
return tracklist;
}
#endif
static void SsaManagerDel(Context_t * context) {
static void SsaManagerDel(Context_t * context __attribute__((unused))) {
int i = 0;
ssa_printf(10, "\n");
@@ -364,11 +366,11 @@ static int SsaGetSubtitle(Context_t *context, char * Filename) {
SsaManagerAdd(context, SsaSubtitle);
Track_t Subtitle = {
subtitleExtension,
"S_TEXT/SSA",
i++,
};
Track_t Subtitle;
memset(&Subtitle, 0, sizeof(Subtitle));
Subtitle.Name = subtitleExtension;
Subtitle.Encoding = "S_TEXT/SSA";
Subtitle.Id = i++;
context->manager->subtitle->Command(context, MANAGER_ADD, &Subtitle);
}
@@ -384,7 +386,7 @@ static int SsaGetSubtitle(Context_t *context, char * Filename) {
return cERR_SSA_NO_ERROR;
}
static int SsaOpenSubtitle(Context_t *context, int trackid) {
static int SsaOpenSubtitle(Context_t *context __attribute__((unused)), int trackid) {
ssa_printf(10, "\n");
if(trackid < TEXTSSAOFFSET || (trackid % TEXTSSAOFFSET) >= TrackCount ) {
@@ -408,7 +410,7 @@ static int SsaOpenSubtitle(Context_t *context, int trackid) {
return cERR_SSA_NO_ERROR;
}
static int SsaCloseSubtitle(Context_t *context) {
static int SsaCloseSubtitle(Context_t *context __attribute__((unused))) {
ssa_printf(10, "\n");
if(fssa)

View File

@@ -33,11 +33,6 @@ typedef struct Container_s {
extern Container_t FFMPEGContainer;
static Container_t * AvailableContainer[] = {
&FFMPEGContainer,
NULL
};
typedef struct ContainerHandler_s {
char * Name;
Container_t * selectedContainer;

View File

@@ -116,7 +116,7 @@ static inline char * basename(char * name)
static inline char * dirname(char * name)
{
static char path[100];
int i = 0;
unsigned int i = 0;
int pos = 0;
while((name[i] != 0) && (i < sizeof(path)))

View File

@@ -63,13 +63,6 @@ extern Output_t LinuxDvbOutput;
extern Output_t SubtitleOutput;
extern Output_t PipeOutput;
static Output_t * AvailableOutput[] = {
&LinuxDvbOutput,
&SubtitleOutput,
&PipeOutput,
NULL
};
typedef struct OutputHandler_s {
char * Name;
Output_t * audio;

View File

@@ -77,32 +77,6 @@ extern Writer_t WriterFramebuffer;
extern Writer_t WriterPipe;
extern Writer_t WriterDVBSubtitle;
static Writer_t * AvailableWriter[] = {
&WriterAudioIPCM,
&WriterAudioPCM,
&WriterAudioMP3,
&WriterAudioMPEGL3,
&WriterAudioAC3,
&WriterAudioAAC,
&WriterAudioDTS,
&WriterAudioWMA,
&WriterAudioFLAC,
&WriterAudioVORBIS,
&WriterVideoMPEG2,
&WriterVideoMPEGH264,
&WriterVideoH264,
&WriterVideoDIVX,
&WriterVideoFOURCC,
&WriterVideoMSCOMP,
&WriterVideoWMV,
&WriterVideoH263,
&WriterVideoFLV,
&WriterVideoVC1,
&WriterFramebuffer,
NULL
};
Writer_t* getWriter(char* encoding);
Writer_t* getDefaultVideoWriter();

View File

@@ -107,7 +107,7 @@ static int ManagerAdd(Context_t *context, Track_t track) {
return cERR_AUDIO_MGR_NO_ERROR;
}
static char ** ManagerList(Context_t *context) {
static char ** ManagerList(Context_t *context __attribute__((unused))) {
int i = 0, j = 0;
char ** tracklist = NULL;

View File

@@ -107,7 +107,7 @@ static int ManagerAdd(Context_t *context, Track_t track) {
return cERR_DVBSUBTITLE_MGR_NO_ERROR;
}
static char ** ManagerList(Context_t *context) {
static char ** ManagerList(Context_t *context __attribute__((unused))) {
int i = 0, j = 0;
char ** tracklist = NULL;

View File

@@ -107,7 +107,7 @@ static int ManagerAdd(Context_t *context, Track_t track) {
return cERR_SUBTITLE_MGR_NO_ERROR;
}
static char ** ManagerList(Context_t *context) {
static char ** ManagerList(Context_t *context __attribute__((unused))) {
char ** tracklist = NULL;
int i = 0, j = 0;

View File

@@ -107,14 +107,13 @@ static int ManagerAdd(Context_t *context, Track_t track) {
return cERR_TELETEXT_MGR_NO_ERROR;
}
static char ** ManagerList(Context_t *context) {
static char ** ManagerList(Context_t *context __attribute__((unused))) {
int i = 0, j = 0;
char ** tracklist = NULL;
teletext_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__);
if (Tracks != NULL) {
char tmp[30];
tracklist = malloc(sizeof(char *) * ((TrackCount*2) + 1));
if (tracklist == NULL)

View File

@@ -106,7 +106,7 @@ static int ManagerAdd(Context_t *context, Track_t track) {
return cERR_VIDEO_MGR_NO_ERROR;
}
static char ** ManagerList(Context_t *context) {
static char ** ManagerList(Context_t *context __attribute__((unused))) {
int i = 0, j = 0;
char ** tracklist = NULL;

View File

@@ -88,7 +88,7 @@ int LinuxDvbStop(Context_t *context, char * type);
/* MISC Functions */
/* ***************************** */
void getLinuxDVBMutex(const char *filename, const char *function, int line) {
void getLinuxDVBMutex(const char *filename __attribute__((unused)), const char *function __attribute__((unused)), int line __attribute__((unused))) {
linuxdvb_printf(250, "requesting mutex\n");
@@ -97,14 +97,14 @@ void getLinuxDVBMutex(const char *filename, const char *function, int line) {
linuxdvb_printf(250, "received mutex\n");
}
void releaseLinuxDVBMutex(const char *filename, const char *function, int line) {
void releaseLinuxDVBMutex(const char *filename __attribute__((unused)), const char *function __attribute__((unused)), int line __attribute__((unused))) {
pthread_mutex_unlock(&LinuxDVBmutex);
linuxdvb_printf(250, "released mutex\n");
}
int LinuxDvbOpen(Context_t *context, char * type) {
int LinuxDvbOpen(Context_t *context __attribute__((unused)), char * type) {
unsigned char video = !strcmp("video", type);
unsigned char audio = !strcmp("audio", type);
@@ -292,7 +292,7 @@ int LinuxDvbPlay(Context_t *context, char * type) {
return ret;
}
int LinuxDvbStop(Context_t *context, char * type) {
int LinuxDvbStop(Context_t *context __attribute__((unused)), char * type) {
int ret = cERR_LINUXDVB_NO_ERROR;
unsigned char video = !strcmp("video", type);
unsigned char audio = !strcmp("audio", type);
@@ -349,7 +349,7 @@ int LinuxDvbStop(Context_t *context, char * type) {
return ret;
}
int LinuxDvbPause(Context_t *context, char * type) {
int LinuxDvbPause(Context_t *context __attribute__((unused)), char * type) {
int ret = cERR_LINUXDVB_NO_ERROR;
unsigned char video = !strcmp("video", type);
unsigned char audio = !strcmp("audio", type);
@@ -380,7 +380,7 @@ int LinuxDvbPause(Context_t *context, char * type) {
return ret;
}
int LinuxDvbContinue(Context_t *context, char * type) {
int LinuxDvbContinue(Context_t *context __attribute__((unused)), char * type) {
int ret = cERR_LINUXDVB_NO_ERROR;
unsigned char video = !strcmp("video", type);
unsigned char audio = !strcmp("audio", type);
@@ -410,7 +410,7 @@ int LinuxDvbContinue(Context_t *context, char * type) {
return ret;
}
int LinuxDvbReverseDiscontinuity(Context_t *context, int* surplus) {
int LinuxDvbReverseDiscontinuity(Context_t *context __attribute__((unused)), int* surplus) {
int ret = cERR_LINUXDVB_NO_ERROR;
int dis_type = VIDEO_DISCONTINUITY_CONTINUOUS_REVERSE | *surplus;
@@ -427,7 +427,7 @@ int LinuxDvbReverseDiscontinuity(Context_t *context, int* surplus) {
return ret;
}
int LinuxDvbAudioMute(Context_t *context, char *flag) {
int LinuxDvbAudioMute(Context_t *context __attribute__((unused)), char *flag) {
int ret = cERR_LINUXDVB_NO_ERROR;
linuxdvb_printf(10, "\n");
@@ -465,7 +465,7 @@ int LinuxDvbAudioMute(Context_t *context, char *flag) {
}
int LinuxDvbFlush(Context_t *context, char * type) {
int LinuxDvbFlush(Context_t *context __attribute__((unused)), char * type) {
unsigned char video = !strcmp("video", type);
unsigned char audio = !strcmp("audio", type);
@@ -600,7 +600,7 @@ int LinuxDvbFastForward(Context_t *context, char * type) {
#endif
int LinuxDvbReverse(Context_t *context, char * type) {
int LinuxDvbReverse(Context_t *context __attribute__((unused)), char * type __attribute__((unused))) {
int ret = cERR_LINUXDVB_NO_ERROR;
#ifdef reverse_playback_2
int speed;
@@ -686,7 +686,7 @@ int LinuxDvbSlowMotion(Context_t *context, char * type) {
return ret;
}
int LinuxDvbAVSync(Context_t *context, char * type) {
int LinuxDvbAVSync(Context_t *context, char * type __attribute__((unused))) {
int ret = cERR_LINUXDVB_NO_ERROR;
/* konfetti: this one is dedicated to audiofd so we
* are ignoring what is given by type! I think we should
@@ -710,7 +710,7 @@ int LinuxDvbAVSync(Context_t *context, char * type) {
return ret;
}
int LinuxDvbClear(Context_t *context, char * type) {
int LinuxDvbClear(Context_t *context __attribute__((unused)), char * type) {
int ret = cERR_LINUXDVB_NO_ERROR;
unsigned char video = !strcmp("video", type);
unsigned char audio = !strcmp("audio", type);
@@ -745,7 +745,7 @@ int LinuxDvbClear(Context_t *context, char * type) {
return ret;
}
int LinuxDvbPts(Context_t *context, unsigned long long int* pts) {
int LinuxDvbPts(Context_t *context __attribute__((unused)), unsigned long long int* pts) {
int ret = cERR_LINUXDVB_NO_ERROR;
linuxdvb_printf(50, "\n");
@@ -783,7 +783,7 @@ int LinuxDvbPts(Context_t *context, unsigned long long int* pts) {
return ret;
}
int LinuxDvbGetFrameCount(Context_t *context, unsigned long long int* frameCount) {
int LinuxDvbGetFrameCount(Context_t *context __attribute__((unused)), unsigned long long int* frameCount) {
int ret = cERR_LINUXDVB_NO_ERROR;
dvb_play_info_t playInfo;

View File

@@ -63,6 +63,13 @@ static const char* FILENAME = "output.c";
/* Varaibles */
/* ***************************** */
static Output_t * AvailableOutput[] = {
&LinuxDvbOutput,
&SubtitleOutput,
&PipeOutput,
NULL
};
/* ***************************** */
/* Prototypes */
/* ***************************** */

View File

@@ -88,7 +88,7 @@ int PipeStop(Context_t *context, char * type);
/* MISC Functions */
/* ***************************** */
void getPipeMutex(const char *filename, const char *function, int line) {
void getPipeMutex(const char *filename __attribute__((unused)), const char *function __attribute__((unused)), int line __attribute__((unused))) {
pipe_printf(250, "requesting mutex\n");
@@ -97,14 +97,14 @@ void getPipeMutex(const char *filename, const char *function, int line) {
pipe_printf(250, "received mutex\n");
}
void releasePipeMutex(const char *filename, const char *function, int line) {
void releasePipeMutex(const char *filename __attribute__((unused)), const char *function __attribute__((unused)), int line __attribute__((unused))) {
pthread_mutex_unlock(&Pipemutex);
pipe_printf(250, "released mutex\n");
}
int PipeOpen(Context_t *context, char * type) {
int PipeOpen(Context_t *context __attribute__((unused)), char * type) {
unsigned char teletext = !strcmp("teletext", type);
unsigned char dvbsubtitle = !strcmp("dvbsubtitle", type);
@@ -163,10 +163,10 @@ int PipeClose(Context_t *context, char * type) {
return cERR_PIPE_NO_ERROR;
}
int PipePlay(Context_t *context, char * type) {
int PipePlay(Context_t *context __attribute__((unused)), char * type __attribute__((unused))) {
int ret = cERR_PIPE_NO_ERROR;
Writer_t* writer;
#if 0
unsigned char dvbsubtitle = !strcmp("dvbsubtitle", type);
unsigned char teletext = !strcmp("teletext", type);
@@ -176,12 +176,14 @@ int PipePlay(Context_t *context, char * type) {
}
if (teletext && teletextfd != -1) {
}
#endif
return ret;
}
int PipeStop(Context_t *context, char * type) {
int PipeStop(Context_t *context __attribute__((unused)), char * type __attribute__((unused))) {
int ret = cERR_PIPE_NO_ERROR;
#if 0
unsigned char dvbsubtitle = !strcmp("dvbsubtitle", type);
unsigned char teletext = !strcmp("teletext", type);
@@ -195,11 +197,12 @@ int PipeStop(Context_t *context, char * type) {
}
releasePipeMutex(FILENAME, __FUNCTION__,__LINE__);
#endif
return ret;
}
int PipeFlush(Context_t *context, char * type) {
int PipeFlush(Context_t *context __attribute__((unused)), char * type) {
unsigned char dvbsubtitle = !strcmp("dvbsubtitle", type);
unsigned char teletext = !strcmp("teletext", type);
@@ -225,7 +228,7 @@ int PipeFlush(Context_t *context, char * type) {
return cERR_PIPE_NO_ERROR;
}
int PipeClear(Context_t *context, char * type) {
int PipeClear(Context_t *context __attribute__((unused)), char * type) {
int ret = cERR_PIPE_NO_ERROR;
unsigned char dvbsubtitle = !strcmp("dvbsubtitle", type);
unsigned char teletext = !strcmp("teletext", type);
@@ -252,10 +255,10 @@ int PipeClear(Context_t *context, char * type) {
return ret;
}
int PipeSwitch(Context_t *context, char * type) {
int PipeSwitch(Context_t *context __attribute__((unused)), char * type __attribute__((unused))) {
#if 0
unsigned char dvbsubtitle = !strcmp("dvbsubtitle", type);
unsigned char teletext = !strcmp("teletext", type);
Writer_t* writer;
pipe_printf(10, "v%d a%d\n", dvbsubtitle, teletext);
@@ -273,13 +276,13 @@ int PipeSwitch(Context_t *context, char * type) {
}
pipe_printf(10, "exiting\n");
#endif
return cERR_PIPE_NO_ERROR;
}
static int writePESDataTeletext(int fd, unsigned char *data, size_t data_len)
{
int len = 0;
unsigned int len = 0;
if (data_len > 0) {
len = data_len + 39;
char header[45];
@@ -335,7 +338,7 @@ static int writePESDataDvbsubtitle(int fd, unsigned char *data, size_t data_len,
iov[1].iov_base = data;
iov[1].iov_len = data_len;
len = writev(fd, iov, 2);
if (len != iov[0].iov_len + iov[1].iov_len) {
if (len != (int)(iov[0].iov_len + iov[1].iov_len)) {
// writing to pipe failed, clear it.
char buf[65536];
while(0 < read(fd, buf, sizeof(buf)));
@@ -344,16 +347,13 @@ static int writePESDataDvbsubtitle(int fd, unsigned char *data, size_t data_len,
return len;
}
static int Write(void *_context, void* _out)
static int Write(void *_context __attribute__((unused)), void* _out)
{
Context_t *context = (Context_t *) _context;
AudioVideoOut_t *out = (AudioVideoOut_t*) _out;
int ret = cERR_PIPE_NO_ERROR;
int res = 0;
unsigned char dvbsubtitle;
unsigned char teletext;
Writer_t* writer;
WriterAVCallData_t call;
if (out == NULL)
{
@@ -387,7 +387,7 @@ static int Write(void *_context, void* _out)
return ret;
}
static int reset(Context_t *context)
static int reset(Context_t *context __attribute__((unused)))
{
int ret = cERR_PIPE_NO_ERROR;

View File

@@ -597,7 +597,7 @@ static int Write(void* _context, void *data) {
return cERR_SUBTITLE_NO_ERROR;
}
static int subtitle_Open(Context_t* context) {
static int subtitle_Open(Context_t* context __attribute__((unused))) {
int i;
subtitle_printf(10, "\n");
@@ -629,7 +629,7 @@ static int subtitle_Open(Context_t* context) {
return cERR_SUBTITLE_NO_ERROR;
}
static int subtitle_Close(Context_t* context) {
static int subtitle_Close(Context_t* context __attribute__((unused))) {
int i;
subtitle_printf(10, "\n");
@@ -690,7 +690,7 @@ static int subtitle_Play(Context_t* context) {
return cERR_SUBTITLE_NO_ERROR;
}
static int subtitle_Stop(Context_t* context) {
static int subtitle_Stop(Context_t* context __attribute__((unused))) {
int wait_time = 20;
int i;

View File

@@ -101,7 +101,6 @@ static int writeData(void* _call)
unsigned int FakeHeaderLength;
unsigned char Version = 5;
unsigned int FakeStartCode = (Version << 8) | PES_VERSION_FAKE_START_CODE;
unsigned int HeaderLength = 0;
unsigned int usecPerFrame = 41708; /* Hellmaster1024: default value */
BitPacker_t ld = {FakeHeaders, 0, 32};

View File

@@ -98,7 +98,6 @@ static int writeData(void* _call)
{
WriterAVCallData_t* call = (WriterAVCallData_t*) _call;
int i = 0;
unsigned char PesHeader[PES_AUDIO_HEADER_SIZE];
dts_printf(10, "\n");

View File

@@ -129,7 +129,7 @@ static int writeData(void* _call)
int src_stride = call->Stride;
int dst_stride = call->destStride;
int dst_delta = dst_stride - call->Width*4;
int x,y;
unsigned int x,y;
const unsigned char *src = call->data;
unsigned char *dst = call->destination + (call->y * dst_stride + call->x * 4);
unsigned int k,ck,t;
@@ -176,7 +176,7 @@ static int writeData(void* _call)
}
} else
{
int y;
unsigned int y;
for (y = 0; y < call->Height; y++)
memset(call->destination + ((call->y + y) * call->destStride) + call->x * 4, 0, call->Width * 4);
}

View File

@@ -54,9 +54,9 @@
#define H264_DEBUG
#ifdef H264_DEBUG
static const char *FILENAME = "h264.c";
static short debug_level = 0;
static short debug_level = 10;
#define h264_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, FILENAME, __FUNCTION__, ## x); } while (0)
@@ -113,16 +113,14 @@ static int writeData(void* _call)
{
WriterAVCallData_t* call = (WriterAVCallData_t*) _call;
unsigned char* PacketStart = NULL;
unsigned int PacketStartSIZE = 0;
unsigned char PesHeader[PES_MAX_HEADER_SIZE];
unsigned long long int VideoPts;
unsigned int TimeDelta;
unsigned int TimeScale;
int len = 0;
static int NoOtherBeginningFound = 1;
int ic = 0;
struct iovec iov[128];
int ic = 0;
struct iovec iov[128];
h264_printf(10, "\n");
if (call == NULL)
@@ -178,10 +176,10 @@ static int writeData(void* _call)
if (initialHeader)
{
avcC_t* avcCHeader = (avcC_t*)call->private_data;
int i;
unsigned int i;
unsigned int ParamSets;
unsigned int ParamOffset;
unsigned int InitialHeaderLength = 0;
unsigned int InitialHeaderLength = 0;
unsigned int ParametersLength;
if (avcCHeader == NULL) {
@@ -320,8 +318,6 @@ static int writeData(void* _call)
NalStart += NalLength;
while (NalLength > 0) {
unsigned int PacketLength = (NalLength < BUFFER_SIZE) ? NalLength : BUFFER_SIZE;
int ExtraLength = 0;
NalLength -= PacketLength;
ic = 0;

View File

@@ -65,7 +65,7 @@
void PutBits(BitPacker_t * ld, unsigned int code, unsigned int length)
{
unsigned int bit_buf;
int bit_left;
unsigned int bit_left;
bit_buf = ld->BitBuffer;
bit_left = ld->Remaining;

View File

@@ -97,7 +97,7 @@ static int writeData(void* _call)
unsigned char PesHeader[PES_MAX_HEADER_SIZE];
int len = 0;
int Position = 0;
unsigned int Position = 0;
mpeg2_printf(10, "\n");

View File

@@ -117,7 +117,7 @@ static unsigned int breakBufferFillSize = 0;
/* MISC Functions */
/* ***************************** */
static int prepareClipPlay(int uNoOfChannels, int uSampleRate, int uBitsPerSample, int bLittleEndian)
static int prepareClipPlay(int uNoOfChannels, int uSampleRate, int uBitsPerSample, int bLittleEndian __attribute__((unused)))
{
printf("rate: %d ch: %d bits: %d (%d bps)\n",
uSampleRate/*Format->dwSamplesPerSec*/,
@@ -190,8 +190,6 @@ static int writeData(void* _call)
{
WriterAVCallData_t* call = (WriterAVCallData_t*) _call;
unsigned char PesHeader[PES_MAX_HEADER_SIZE];
pcm_printf(10, "\n");
if (call == NULL)
@@ -224,15 +222,14 @@ static int writeData(void* _call)
}
unsigned char * buffer = call->data;
int size = call->len;
unsigned int size = call->len;
//printf("PCM %d size SubFrameLen=%d\n", size, SubFrameLen);
unsigned int qty;
unsigned int n;
unsigned int injectBufferSize = sizeof(lpcm_pes) + sizeof(lpcm_prv) + SubFrameLen;
unsigned char * injectBuffer = (unsigned char *)malloc(sizeof(unsigned char)*injectBufferSize);
unsigned char * injectBufferDataPointer = &injectBuffer[sizeof(lpcm_pes)+sizeof(lpcm_prv)];
int pos;
unsigned int pos;
for(pos = 0; pos < size; )
{

View File

@@ -201,7 +201,7 @@ static int writeData(void* _call)
}
{
int i;
unsigned int i;
/* For VC1 the codec private data is a standard vc1 sequence header so we just copy it to the output */
memcpy (&PesPacket[PES_MIN_HEADER_SIZE], call->private_data, call->private_size);
@@ -218,7 +218,7 @@ static int writeData(void* _call)
}
if(call->len > 0 && call->data) {
int Position = 0;
unsigned int Position = 0;
unsigned char insertSampleHeader = 1;
while(Position < call->len) {
@@ -233,7 +233,6 @@ static int writeData(void* _call)
unsigned char PesHeader[PES_MAX_HEADER_SIZE];
memset (PesHeader, '0', PES_MAX_HEADER_SIZE);
int HeaderLength = InsertPesHeader (PesHeader, PacketLength, VC1_VIDEO_PES_START_CODE, call->Pts, 0);
unsigned char* PacketStart;
if(insertSampleHeader) {
const unsigned char Vc1FrameStartCode[] = {0, 0, 1, VC1_FRAME_START_CODE};

View File

@@ -125,7 +125,6 @@ static int writeData(void* _call)
if (initialHeader) {
unsigned char PesHeader[PES_MAX_HEADER_SIZE];
int HeaderLength;
if ((call->private_size <= 0) || (call->private_data == NULL))
{

View File

@@ -204,7 +204,7 @@ static int writeData(void* _call)
}
if(call->len > 0 && call->data) {
int Position = 0;
unsigned int Position = 0;
unsigned char insertSampleHeader = 1;
while(Position < call->len) {
@@ -218,7 +218,6 @@ static int writeData(void* _call)
unsigned char PesHeader[PES_MAX_HEADER_SIZE];
memset (PesHeader, '0', PES_MAX_HEADER_SIZE);
int HeaderLength = InsertPesHeader (PesHeader, PacketLength, VC1_VIDEO_PES_START_CODE, call->Pts, 0);
unsigned char* PacketStart;
if(insertSampleHeader) {
unsigned int PesLength;

View File

@@ -58,6 +58,32 @@ if (debug_level >= level) printf(x); } while (0)
/* Varaibles */
/* ***************************** */
static Writer_t * AvailableWriter[] = {
&WriterAudioIPCM,
&WriterAudioPCM,
&WriterAudioMP3,
&WriterAudioMPEGL3,
&WriterAudioAC3,
&WriterAudioAAC,
&WriterAudioDTS,
&WriterAudioWMA,
&WriterAudioFLAC,
&WriterAudioVORBIS,
&WriterVideoMPEG2,
&WriterVideoMPEGH264,
&WriterVideoH264,
&WriterVideoDIVX,
&WriterVideoFOURCC,
&WriterVideoMSCOMP,
&WriterVideoWMV,
&WriterVideoH263,
&WriterVideoFLV,
&WriterVideoVC1,
&WriterFramebuffer,
NULL
};
/* ***************************** */
/* Prototypes */
/* ***************************** */

View File

@@ -25,7 +25,8 @@ void dump_metadata()
int main(int argc,char* argv[])
{
char file[255] = {""};
int err, i;
unsigned int i;
int err;
if (argc < 2)
{
@@ -52,9 +53,9 @@ int main(int argc,char* argv[])
return -1;
}
if (av_find_stream_info(avContext) < 0)
if (avformat_find_stream_info(avContext, NULL) < 0)
{
printf("Error av_find_stream_info\n");
printf("Error avformat_find_stream_info\n");
}
printf("\n***\n");

View File

@@ -16,7 +16,7 @@ extern GLFramebuffer *glfb;
#define fb_pixel_t uint32_t
#endif
int main(int argc, char ** argv)
int main(int argc __attribute__((unused)), char ** argv __attribute__((unused)))
{
init_td_api();
#if HAVE_GENERIC_HARDWARE