Commit 8d162954 authored by Jan Gerber's avatar Jan Gerber
Browse files

work on compiler warnings

parent f26b6c8f
......@@ -29,6 +29,7 @@
#include "libavformat/avformat.h"
#include "libavdevice/avdevice.h"
#include "libavformat/framehook.h"
#include "libswscale/swscale.h"
#include "libpostproc/postprocess.h"
......@@ -183,8 +184,6 @@ static ff2theora ff2theora_init (){
this->y_lut_used = 0;
this->uv_lut_used = 0;
this->y_lut[256];
this->uv_lut[256];
}
return this;
}
......@@ -296,7 +295,7 @@ void ff2theora_output(ff2theora this) {
AVCodec *vcodec = NULL;
pp_mode_t *ppMode = NULL;
pp_context_t *ppContext = NULL;
float frame_aspect;
float frame_aspect = 0;
double fps = 0.0;
if(this->audiostream >= 0 && this->context->nb_streams > this->audiostream) {
......@@ -604,10 +603,10 @@ void ff2theora_output(ff2theora this) {
uint8_t *ptr;
int16_t *audio_buf=av_malloc(4*AVCODEC_MAX_AUDIO_FRAME_SIZE);
int16_t *resampled=av_malloc(4*AVCODEC_MAX_AUDIO_FRAME_SIZE);
int16_t *audio_p;
int16_t *audio_p=NULL;
int no_frames;
double framerate_add;
double framerate_add = 0;
double framerate_tmpcount = 0;
if(this->video_index >= 0)
......@@ -760,7 +759,7 @@ void ff2theora_output(ff2theora this) {
ptr = pkt.data;
len = pkt.size;
if (e_o_s && !info.audio_only || (ret >= 0 && pkt.stream_index == this->video_index)){
if ((e_o_s && !info.audio_only) || (ret >= 0 && pkt.stream_index == this->video_index)){
if(len == 0 && !first && !e_o_s){
fprintf (stderr, "no frame available\n");
}
......@@ -832,6 +831,7 @@ void ff2theora_output(ff2theora this) {
output=output_tmp;
}
// now output
if(ppMode)
pp_postprocess(output->data, output->linesize,
output->data, output->linesize,
......@@ -839,7 +839,7 @@ void ff2theora_output(ff2theora this) {
output->qscale_table, output->qstride,
ppMode, ppContext, this->pix_fmt);
if(this->vhook)
frame_hook_process((AVPicture *)output, this->pix_fmt, venc->width,venc->height);
frame_hook_process((AVPicture *)output, this->pix_fmt, venc->width,venc->height, 0);
if (this->frame_topBand || this->frame_leftBand) {
if (av_picture_crop((AVPicture *)output_tmp, (AVPicture *)output,
......@@ -882,7 +882,7 @@ void ff2theora_output(ff2theora this) {
}
}
if(e_o_s && !info.video_only
if((e_o_s && !info.video_only)
|| (ret >= 0 && pkt.stream_index == this->audio_index)){
this->pts_offset = (double) pkt.pts / AV_TIME_BASE -
(double) this->sample_count / this->sample_rate;
......@@ -1735,7 +1735,7 @@ int main (int argc, char **argv){
info.outfile = fopen(outputfile_name,"wb");
#endif
if(info.frontend) {
fprintf(stderr, "\nf2t ;duration: %d;\n", convert->context->duration / AV_TIME_BASE);
fprintf(stderr, "\nf2t ;duration: %d;\n", (int)(convert->context->duration / AV_TIME_BASE));
}
else {
dump_format (convert->context, 0,inputfile_name, 0);
......
......@@ -40,7 +40,7 @@
/**
* adds a new kate stream structure
*/
static void add_kate_stream(ff2theora this){
void add_kate_stream(ff2theora this){
ff2theora_kate_stream *ks;
this->kate_streams=(ff2theora_kate_stream*)realloc(this->kate_streams,(this->n_kate_streams+1)*sizeof(ff2theora_kate_stream));
ks=&this->kate_streams[this->n_kate_streams++];
......@@ -111,7 +111,7 @@ void report_unknown_subtitle_encoding(const char *name)
fprintf(stderr, " " SUPPORTED_ENCODINGS "\n");
}
static char *fgets2(char *s,size_t sz,FILE *f)
char *fgets2(char *s,size_t sz,FILE *f)
{
char *ret = fgets(s, sz, f);
/* fixup DOS newline character */
......@@ -120,13 +120,13 @@ static char *fgets2(char *s,size_t sz,FILE *f)
return ret;
}
static double hmsms2s(int h,int m,int s,int ms)
double hmsms2s(int h,int m,int s,int ms)
{
return h*3600+m*60+s+ms/1000.0;
}
/* very simple implementation when no iconv */
static void convert_subtitle_to_utf8(F2T_ENCODING encoding,unsigned char *text)
void convert_subtitle_to_utf8(F2T_ENCODING encoding,unsigned char *text)
{
size_t nbytes;
unsigned char *ptr,*newtext;
......@@ -183,7 +183,8 @@ int load_subtitles(ff2theora_kate_stream *this)
int id;
static char text[4096];
int h0,m0,s0,ms0,h1,m1,s1,ms1;
double t0,t1;
double t0=0.0;
double t1=0.0;
static char str[4096];
int warned=0;
......
......@@ -15,7 +15,7 @@
#define SUPPORTED_ENCODINGS "utf-8, utf8, iso-8859-1, latin1"
static void add_kate_stream(ff2theora this);
extern void add_kate_stream(ff2theora this);
extern int load_subtitles(ff2theora_kate_stream *this);
extern void free_subtitles(ff2theora this);
......@@ -25,8 +25,8 @@ extern void set_subtitles_category(ff2theora this,const char *category);
extern void set_subtitles_encoding(ff2theora this,F2T_ENCODING encoding);
extern void report_unknown_subtitle_encoding(const char *name);
static char *fgets2(char *s,size_t sz,FILE *f);
static double hmsms2s(int h,int m,int s,int ms);
static void convert_subtitle_to_utf8(F2T_ENCODING encoding,unsigned char *text);
extern char *fgets2(char *s,size_t sz,FILE *f);
extern double hmsms2s(int h,int m,int s,int ms);
extern void convert_subtitle_to_utf8(F2T_ENCODING encoding,unsigned char *text);
#endif
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment