Merge pull request #81 from BtbN/wfixes

Fix all warnings
master
Jim 2014-05-09 22:51:41 -07:00
commit a9158555b4
6 changed files with 30 additions and 26 deletions

View File

@ -18,28 +18,31 @@
#include "../util/c99defs.h"
#include "video-io.h"
#define MAKE_FOURCC(a, b, c, d) \
((uint32_t)(((d) << 24) | ((c) << 16) | ((b) << 8) | (a)))
enum video_format video_format_from_fourcc(uint32_t fourcc)
{
switch (fourcc) {
case 'UYVY':
case 'HDYC':
case 'UYNV':
case 'UYNY':
case 'uyv1':
case '2vuy':
case '2Vuy':
case MAKE_FOURCC('U','Y','V','Y'):
case MAKE_FOURCC('H','D','Y','C'):
case MAKE_FOURCC('U','Y','N','V'):
case MAKE_FOURCC('U','Y','N','Y'):
case MAKE_FOURCC('u','y','v','1'):
case MAKE_FOURCC('2','v','u','y'):
case MAKE_FOURCC('2','V','u','y'):
return VIDEO_FORMAT_UYVY;
case 'YUY2':
case 'Y422':
case 'V422':
case 'VYUY':
case 'YUNV':
case 'yuv2':
case 'yuvs':
case MAKE_FOURCC('Y','U','Y','2'):
case MAKE_FOURCC('Y','4','2','2'):
case MAKE_FOURCC('V','4','2','2'):
case MAKE_FOURCC('V','Y','U','Y'):
case MAKE_FOURCC('Y','U','N','V'):
case MAKE_FOURCC('y','u','v','2'):
case MAKE_FOURCC('y','u','v','s'):
return VIDEO_FORMAT_YUY2;
case 'YVYU':
case MAKE_FOURCC('Y','V','Y','U'):
return VIDEO_FORMAT_YVYU;
}

View File

@ -24,7 +24,7 @@
#include "../graphics/matrix3.h"
#endif
struct {
static struct {
enum video_colorspace const color_space;
float const Kb, Kr;
int const range_min[3];
@ -35,7 +35,7 @@ struct {
float float_range_max[3];
float matrix[2][16];
} static format_info[] = {
} format_info[] = {
{VIDEO_CS_601,
0.114f, 0.299f, {16, 16, 16}, {235, 240, 240},
{{16, 128, 128}, {0, 128, 128}},

View File

@ -865,7 +865,7 @@ void obs_data_item_setint(obs_data_item_t *item, long long val)
struct obs_data_number num;
num.type = OBS_DATA_NUM_INT;
num.int_val = val;
obs_data_item_setdata(item, &val, sizeof(struct obs_data_number),
obs_data_item_setdata(item, &num, sizeof(struct obs_data_number),
OBS_DATA_NUMBER);
}
@ -874,7 +874,7 @@ void obs_data_item_setdouble(obs_data_item_t *item, double val)
struct obs_data_number num;
num.type = OBS_DATA_NUM_DOUBLE;
num.double_val = val;
obs_data_item_setdata(item, &val, sizeof(struct obs_data_number),
obs_data_item_setdata(item, &num, sizeof(struct obs_data_number),
OBS_DATA_NUMBER);
}

View File

@ -198,7 +198,7 @@ parsehost:
int RTMP_ParseURL2(const char *url, int *protocol, AVal *host, unsigned int *port,
AVal *app)
{
char *p, *end, *col, *ques, *slash;
char *p, *end, *col, /* *ques, */ *slash;
RTMP_Log(RTMP_LOGDEBUG, "Parsing...");
@ -255,7 +255,7 @@ parsehost:
end = p + strlen(p);
col = strchr(p, ':');
ques = strchr(p, '?');
// ques = strchr(p, '?');
slash = strchr(p, '/');
{

View File

@ -3923,7 +3923,7 @@ RTMP_ReadPacket(RTMP *r, RTMPPacket *packet)
uint8_t hbuf[RTMP_MAX_HEADER_SIZE] = { 0 };
char *header = (char *)hbuf;
int nSize, hSize, nToRead, nChunk;
int didAlloc = FALSE;
// int didAlloc = FALSE;
RTMP_Log(RTMP_LOGDEBUG2, "%s: fd=%d", __FUNCTION__, r->m_sb.sb_socket);
@ -4050,7 +4050,7 @@ RTMP_ReadPacket(RTMP *r, RTMPPacket *packet)
RTMP_Log(RTMP_LOGDEBUG, "%s, failed to allocate packet", __FUNCTION__);
return FALSE;
}
didAlloc = TRUE;
// didAlloc = TRUE;
packet->m_headerType = (hbuf[0] & 0xc0) >> 6;
}
@ -5339,8 +5339,8 @@ stopKeyframeSearch:
if (recopy)
{
len = (unsigned int)(ret) > buflen ? buflen : ret;
memcpy(buf, r->m_read.buf, len);
len = (unsigned int)(ret) > buflen ? buflen : (unsigned int)ret;
memcpy(buf, r->m_read.buf, len);
r->m_read.bufpos = r->m_read.buf + len;
r->m_read.buflen = ret - len;
}

View File

@ -21,6 +21,7 @@
#include <util/circlebuf.h>
#include <util/dstr.h>
#include <util/threading.h>
#include <inttypes.h>
#include "librtmp/rtmp.h"
#include "librtmp/log.h"
#include "flv-mux.h"
@ -505,7 +506,7 @@ static void check_to_drop_frames(struct rtmp_stream *stream)
buffer_duration_usec = stream->last_dts_usec - first.dts_usec;
if (buffer_duration_usec > stream->drop_threshold_usec) {
drop_frames(stream);
blog(LOG_INFO, "dropping %lld worth of frames",
blog(LOG_INFO, "dropping %" PRId64 " worth of frames",
buffer_duration_usec);
}
}