Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix all warnings #81

Merged
merged 4 commits into from
May 10, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 18 additions & 15 deletions libobs/media-io/video-fourcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    case MAKE_FOURCC('U', 'Y', 'V', 'Y'):

i.e. space after ,

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;

}
Expand Down
4 changes: 2 additions & 2 deletions libobs/media-io/video-matrices.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "../graphics/matrix3.h"
#endif

struct {
static struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make this a separate commit (and include a reference to the C99 standard 6.11.5 Storage-class specifiers in the commit message)

enum video_colorspace const color_space;
float const Kb, Kr;
int const range_min[3];
Expand All @@ -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}},
Expand Down
4 changes: 2 additions & 2 deletions libobs/obs-data.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions plugins/obs-outputs/librtmp/parseurl.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ int RTMP_ParseURL(const char *url, int *protocol, AVal *host, unsigned int *port
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...");

Expand Down Expand Up @@ -255,7 +255,7 @@ int RTMP_ParseURL2(const char *url, int *protocol, AVal *host, unsigned int *por

end = p + strlen(p);
col = strchr(p, ':');
ques = strchr(p, '?');
// ques = strchr(p, '?');
slash = strchr(p, '/');

{
Expand Down
8 changes: 4 additions & 4 deletions plugins/obs-outputs/librtmp/rtmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -5339,8 +5339,8 @@ Read_1_Packet(RTMP *r, char *buf, unsigned int buflen)

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about

len = (unsigned int)(ret) > buflen ? buflen : (unsigned int)ret;

to keep differences minimal?

memcpy(buf, r->m_read.buf, len);
r->m_read.bufpos = r->m_read.buf + len;
r->m_read.buflen = ret - len;
}
Expand Down
3 changes: 2 additions & 1 deletion plugins/obs-outputs/rtmp-stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
}
}
Expand Down