summaryrefslogtreecommitdiff
path: root/recordmydesktop
diff options
context:
space:
mode:
Diffstat (limited to 'recordmydesktop')
-rw-r--r--recordmydesktop/src/rmd.c16
-rw-r--r--recordmydesktop/src/rmd_cache_frame.c6
-rw-r--r--recordmydesktop/src/rmd_capture_sound.c6
-rw-r--r--recordmydesktop/src/rmd_encode_cache.c4
-rw-r--r--recordmydesktop/src/rmd_encode_image_buffer.c6
-rw-r--r--recordmydesktop/src/rmd_encode_sound_buffer.c9
-rw-r--r--recordmydesktop/src/rmd_error.c8
-rw-r--r--recordmydesktop/src/rmd_flush_to_ogg.c14
-rw-r--r--recordmydesktop/src/rmd_frame.c50
-rw-r--r--recordmydesktop/src/rmd_init_encoder.c56
-rw-r--r--recordmydesktop/src/rmd_initialize_data.c98
-rw-r--r--recordmydesktop/src/rmd_jack.c69
-rw-r--r--recordmydesktop/src/rmd_load_cache.c6
-rw-r--r--recordmydesktop/src/rmd_math.c2
-rw-r--r--recordmydesktop/src/rmd_opendev.c66
-rw-r--r--recordmydesktop/src/rmd_parseargs.c8
-rw-r--r--recordmydesktop/src/rmd_poll_events.c10
-rw-r--r--recordmydesktop/src/rmd_queryextensions.c42
18 files changed, 237 insertions, 239 deletions
diff --git a/recordmydesktop/src/rmd.c b/recordmydesktop/src/rmd.c
index 479a757..5a93e79 100644
--- a/recordmydesktop/src/rmd.c
+++ b/recordmydesktop/src/rmd.c
@@ -112,8 +112,8 @@ int main(int argc, char **argv){
"To disable this check run with --no-wm-check\n"
"(though that is not advised, since it will "
"probably produce faulty results).\n\n");
- pdata.args.full_shots=1;
- pdata.args.noshared=0;
+ pdata.args.full_shots = 1;
+ pdata.args.noshared = 0;
}
rmdQueryExtensions( pdata.dpy,
@@ -159,11 +159,11 @@ int main(int argc, char **argv){
if (!pdata.aborted)
rmdEncodeCache(&pdata);
- fprintf(stderr,"Cleanning up cache...\n");
- if (rmdPurgeCache(pdata.cache_data,!pdata.args.nosound))
- fprintf(stderr,"Some error occured while cleaning up cache!\n");
+ fprintf(stderr, "Cleanning up cache...\n");
+ if (rmdPurgeCache(pdata.cache_data, !pdata.args.nosound))
+ fprintf(stderr, "Some error occured while cleaning up cache!\n");
- fprintf(stderr,"Done!!!\n");
+ fprintf(stderr, "Done!!!\n");
}
if (pdata.aborted && pdata.args.encOnTheFly) {
@@ -171,12 +171,12 @@ int main(int argc, char **argv){
perror("Error while removing file:\n");
return 1;
} else {
- fprintf(stderr, "SIGABRT received,file %s removed\n",
+ fprintf(stderr, "SIGABRT received, file %s removed\n",
pdata.args.filename);
return 0;
}
} else
- fprintf(stderr,"Goodbye!\n");
+ fprintf(stderr, "Goodbye!\n");
rmdCleanUp();
diff --git a/recordmydesktop/src/rmd_cache_frame.c b/recordmydesktop/src/rmd_cache_frame.c
index 6014aa0..7b8a2f3 100644
--- a/recordmydesktop/src/rmd_cache_frame.c
+++ b/recordmydesktop/src/rmd_cache_frame.c
@@ -65,7 +65,7 @@ static int rmdFlushBlock(
if (ucfp == NULL)
gzwrite(fp, (void *)out_buffer, out_buffer_bytes);
else
- fwrite((void *)out_buffer, 1, out_buffer_bytes,ucfp);
+ fwrite((void *)out_buffer, 1, out_buffer_bytes, ucfp);
bytes_written = out_buffer_bytes;
out_buffer_bytes = 0;
@@ -256,8 +256,8 @@ void *rmdCacheImageBuffer(ProgData *pdata) {
if (nbytes > CACHE_FILE_SIZE_LIMIT) {
if (rmdSwapCacheFilesWrite(pdata->cache_data->imgdata, nth_cache, &fp, &ucfp)) {
- fprintf(stderr,"New cache file could not be created.\n"
- "Ending recording...\n");
+ fprintf(stderr, "New cache file could not be created.\n"
+ "Ending recording...\n");
fflush(stderr);
raise(SIGINT); //if for some reason we cannot make a new file
//we have to stop. If we are out of space,
diff --git a/recordmydesktop/src/rmd_capture_sound.c b/recordmydesktop/src/rmd_capture_sound.c
index 63c46f3..2719c60 100644
--- a/recordmydesktop/src/rmd_capture_sound.c
+++ b/recordmydesktop/src/rmd_capture_sound.c
@@ -55,11 +55,11 @@ void *rmdCaptureSound(ProgData *pdata) {
if (pdata->paused) {
#ifdef HAVE_LIBASOUND
if (!pdata->hard_pause) {
- snd_pcm_pause(pdata->sound_handle,1);
+ snd_pcm_pause(pdata->sound_handle, 1);
pthread_mutex_lock(&pdata->pause_mutex);
pthread_cond_wait(&pdata->pause_cond, &pdata->pause_mutex);
pthread_mutex_unlock(&pdata->pause_mutex);
- snd_pcm_pause(pdata->sound_handle,0);
+ snd_pcm_pause(pdata->sound_handle, 0);
} else {//device doesn't support pause(is this the norm?mine doesn't)
snd_pcm_close(pdata->sound_handle);
pthread_mutex_lock(&pdata->pause_mutex);
@@ -91,7 +91,7 @@ void *rmdCaptureSound(ProgData *pdata) {
pdata->args.channels,
pdata->args.frequency);
if (pdata->sound_handle < 0) {
- fprintf(stderr,"Couldn't reopen sound device. Exiting\n");
+ fprintf(stderr, "Couldn't reopen sound device. Exiting\n");
pdata->running = FALSE;
errno = 3;
pthread_exit(&errno);
diff --git a/recordmydesktop/src/rmd_encode_cache.c b/recordmydesktop/src/rmd_encode_cache.c
index e363480..1e0727c 100644
--- a/recordmydesktop/src/rmd_encode_cache.c
+++ b/recordmydesktop/src/rmd_encode_cache.c
@@ -42,7 +42,7 @@
void rmdEncodeCache(ProgData *pdata){
pthread_t flush_to_ogg_t, load_cache_t;
- fprintf(stderr,"STATE:ENCODING\n");
+ fprintf(stderr, "STATE:ENCODING\n");
fprintf(stderr, "Encoding started!\nThis may take several minutes.\n"
"Pressing Ctrl-C will cancel the procedure"
" (resuming will not be possible, but\n"
@@ -67,6 +67,6 @@ void rmdEncodeCache(ProgData *pdata){
//join and finish
pthread_join(load_cache_t, NULL);
- fprintf(stderr,"Encoding finished!\nWait a moment please...\n");
+ fprintf(stderr, "Encoding finished!\nWait a moment please...\n");
pthread_join(flush_to_ogg_t, NULL);
}
diff --git a/recordmydesktop/src/rmd_encode_image_buffer.c b/recordmydesktop/src/rmd_encode_image_buffer.c
index 14dd983..c234aa4 100644
--- a/recordmydesktop/src/rmd_encode_image_buffer.c
+++ b/recordmydesktop/src/rmd_encode_image_buffer.c
@@ -53,7 +53,7 @@ void *rmdEncodeImageBuffer(ProgData *pdata) {
pthread_mutex_lock(&pdata->yuv_mutex);
if (theora_encode_YUVin(&enc_data->m_th_st, &enc_data->yuv)) {
- fprintf(stderr,"Encoder not ready!\n");
+ fprintf(stderr, "Encoder not ready!\n");
pthread_mutex_unlock(&pdata->yuv_mutex);
} else {
pthread_mutex_unlock(&pdata->yuv_mutex);
@@ -82,7 +82,7 @@ void rmdSyncEncodeImageBuffer(ProgData *pdata) {
EncData *enc_data = pdata->enc_data;
if (theora_encode_YUVin(&enc_data->m_th_st, &enc_data->yuv)) {
- fprintf(stderr,"Encoder not ready!\n");
+ fprintf(stderr, "Encoder not ready!\n");
return;
}
@@ -91,7 +91,7 @@ void rmdSyncEncodeImageBuffer(ProgData *pdata) {
ogg_stream_packetin(&enc_data->m_ogg_ts, &enc_data->m_ogg_pckt1);
if (!pdata->running)
- enc_data->m_ogg_ts.e_o_s=1;
+ enc_data->m_ogg_ts.e_o_s = 1;
pdata->avd += pdata->frametime;
pthread_mutex_unlock(&pdata->libogg_mutex);
diff --git a/recordmydesktop/src/rmd_encode_sound_buffer.c b/recordmydesktop/src/rmd_encode_sound_buffer.c
index bd4ec43..d9afee7 100644
--- a/recordmydesktop/src/rmd_encode_sound_buffer.c
+++ b/recordmydesktop/src/rmd_encode_sound_buffer.c
@@ -41,9 +41,8 @@ void *rmdEncodeSoundBuffer(ProgData *pdata) {
#ifdef HAVE_LIBJACK
void *jackbuf = NULL;
- if (pdata->args.use_jack) {
+ if (pdata->args.use_jack)
jackbuf = malloc(pdata->sound_framesize * pdata->jdata->buffersize);
- }
#endif
pdata->v_encoding_clean = 0;
@@ -161,9 +160,9 @@ void rmdSyncEncodeSoundBuffer(ProgData *pdata, signed char *buff) {
vorbis_analysis_wrote(&pdata->enc_data->m_vo_dsp, sampread);
pthread_mutex_lock(&pdata->libogg_mutex);
- while (vorbis_analysis_blockout(&pdata->enc_data->m_vo_dsp, &pdata->enc_data->m_vo_block)==1) {
+ while (vorbis_analysis_blockout(&pdata->enc_data->m_vo_dsp, &pdata->enc_data->m_vo_block) == 1) {
- vorbis_analysis(&pdata->enc_data->m_vo_block,NULL);
+ vorbis_analysis(&pdata->enc_data->m_vo_block, NULL);
vorbis_bitrate_addblock(&pdata->enc_data->m_vo_block);
while (vorbis_bitrate_flushpacket(&pdata->enc_data->m_vo_dsp, &pdata->enc_data->m_ogg_pckt2))
@@ -172,7 +171,7 @@ void rmdSyncEncodeSoundBuffer(ProgData *pdata, signed char *buff) {
pthread_mutex_unlock(&pdata->libogg_mutex);
if (!pdata->running)
- pdata->enc_data->m_ogg_vs.e_o_s=1;
+ pdata->enc_data->m_ogg_vs.e_o_s = 1;
pdata->avd -= pdata->periodtime;
}
diff --git a/recordmydesktop/src/rmd_error.c b/recordmydesktop/src/rmd_error.c
index e9705cc..ba95198 100644
--- a/recordmydesktop/src/rmd_error.c
+++ b/recordmydesktop/src/rmd_error.c
@@ -39,18 +39,18 @@ int rmdErrorHandler(Display *dpy, XErrorEvent *e)
{
char error_desc[1024];
- XGetErrorText(dpy,e->error_code,error_desc,sizeof(error_desc));
- fprintf(stderr,"X Error: %s\n",error_desc);
+ XGetErrorText(dpy, e->error_code, error_desc, sizeof(error_desc));
+ fprintf(stderr, "X Error: %s\n", error_desc);
fflush(stderr);
if ((e->error_code==BadWindow)&&(e->request_code==X_GetWindowAttributes)) {
- fprintf(stderr,"BadWindow on XGetWindowAttributes.\nIgnoring...\n");
+ fprintf(stderr, "BadWindow on XGetWindowAttributes.\nIgnoring...\n");
fflush(stderr);
return 0;
}
if ((e->error_code==BadAccess)&&(e->request_code==X_GrabKey)) {
- fprintf(stderr,"Bad Access on XGrabKey.\n" "Shortcut already assigned.\n");
+ fprintf(stderr, "Bad Access on XGrabKey.\n" "Shortcut already assigned.\n");
fflush(stderr);
return 0;
}
diff --git a/recordmydesktop/src/rmd_flush_to_ogg.c b/recordmydesktop/src/rmd_flush_to_ogg.c
index 47abbca..87308a6 100644
--- a/recordmydesktop/src/rmd_flush_to_ogg.c
+++ b/recordmydesktop/src/rmd_flush_to_ogg.c
@@ -76,7 +76,7 @@ void *rmdFlushToOgg(ProgData *pdata) {
v_st_fin = (pdata->args.nosound);
while (!(th_st_fin && v_st_fin)) {
- int audio_or_video=0;
+ int audio_or_video = 0;
if (pdata->running) {
pthread_mutex_lock(&pdata->libogg_mutex);
@@ -164,14 +164,14 @@ void *rmdFlushToOgg(ProgData *pdata) {
}
if (!audioflag) {
- audio_or_video=1;
+ audio_or_video = 1;
} else if (!videoflag) {
- audio_or_video=0;
+ audio_or_video = 0;
} else {
if (audiotime < videotime)
- audio_or_video=0;
+ audio_or_video = 0;
else
- audio_or_video=1;
+ audio_or_video = 1;
}
if (audio_or_video == 1) {
@@ -228,8 +228,8 @@ void *rmdFlushToOgg(ProgData *pdata) {
fprintf(stderr, "\r \nDone.\nWritten %.0f bytes\n"
"(%.0f of which were video data and %.0f audio data)\n\n",
- video_bytesout+audio_bytesout,
- video_bytesout,audio_bytesout);
+ video_bytesout + audio_bytesout,
+ video_bytesout, audio_bytesout);
pthread_exit(&errno);
}
diff --git a/recordmydesktop/src/rmd_frame.c b/recordmydesktop/src/rmd_frame.c
index ce2e204..ee5c4d8 100644
--- a/recordmydesktop/src/rmd_frame.c
+++ b/recordmydesktop/src/rmd_frame.c
@@ -47,29 +47,29 @@ void rmdDrawFrame( Display *dpy,
GC gc;
XGCValues gcv;
XColor white, white_e, black, black_e;
- unsigned long gcmask=GCForeground;
+ unsigned long gcmask = GCForeground;
- XAllocNamedColor(dpy,DefaultColormap(dpy, screen),"white", &white, &white_e);
- XAllocNamedColor(dpy,DefaultColormap(dpy, screen),"black", &black, &black_e);
+ XAllocNamedColor(dpy, DefaultColormap(dpy, screen), "white", &white, &white_e);
+ XAllocNamedColor(dpy, DefaultColormap(dpy, screen), "black", &black, &black_e);
gcv.foreground = black.pixel;
- gc = XCreateGC(dpy,win, gcmask,&gcv);
+ gc = XCreateGC(dpy, win, gcmask, &gcv);
XFillRectangle( dpy,
win,
gc,
OUTLINE_WIDTH,
OUTLINE_WIDTH,
- width+(BORDER_WIDTH-OUTLINE_WIDTH)*2,
- height+(BORDER_WIDTH-OUTLINE_WIDTH)*2);
+ width + (BORDER_WIDTH-OUTLINE_WIDTH) * 2,
+ height + (BORDER_WIDTH-OUTLINE_WIDTH) * 2);
gcv.foreground = white.pixel;
- XChangeGC(dpy,gc,gcmask,&gcv);
+ XChangeGC(dpy, gc, gcmask, &gcv);
XFillRectangle( dpy,
win,
gc,
BORDER_WIDTH-OUTLINE_WIDTH,
BORDER_WIDTH-OUTLINE_WIDTH,
- width+OUTLINE_WIDTH*2,
- height+OUTLINE_WIDTH*2);
+ width + OUTLINE_WIDTH * 2,
+ height + OUTLINE_WIDTH * 2);
XFreeGC(dpy, gc);
@@ -81,7 +81,7 @@ void rmdMoveFrame( Display *dpy,
int y) {
XMoveWindow(dpy, win, x-BORDER_WIDTH, y-BORDER_WIDTH);
-// XSync(pdata->dpy,False);
+// XSync(pdata->dpy, False);
}
Window rmdFrameInit( Display *dpy,
@@ -95,23 +95,23 @@ Window rmdFrameInit( Display *dpy,
XSetWindowAttributes attribs;
XColor white, white_e;
Window win;
- unsigned long valuemask=CWBackPixmap|CWBackPixel|
+ unsigned long valuemask = CWBackPixmap|CWBackPixel|
CWSaveUnder|CWOverrideRedirect|CWColormap;
- XAllocNamedColor(dpy,DefaultColormap(dpy, screen),"white", &white, &white_e);
+ XAllocNamedColor(dpy, DefaultColormap(dpy, screen), "white", &white, &white_e);
- attribs.background_pixmap=None;
- attribs.background_pixel=white.pixel;
- attribs.save_under=True;
- attribs.override_redirect=True;
- attribs.colormap=DefaultColormap(dpy,screen);
+ attribs.background_pixmap = None;
+ attribs.background_pixel = white.pixel;
+ attribs.save_under = True;
+ attribs.override_redirect = True;
+ attribs.colormap = DefaultColormap(dpy, screen);
win = XCreateWindow( dpy,
root,
- x-BORDER_WIDTH,
- y-BORDER_WIDTH,
- width+BORDER_WIDTH*2,
- height+BORDER_WIDTH*2,
+ x - BORDER_WIDTH,
+ y - BORDER_WIDTH,
+ width + BORDER_WIDTH * 2,
+ height + BORDER_WIDTH * 2,
0,
CopyFromParent,
InputOutput,
@@ -120,9 +120,9 @@ Window rmdFrameInit( Display *dpy,
&attribs);
XRectangle rect;
- rect.x=rect.y=BORDER_WIDTH;
- rect.width=width;
- rect.height=height;
+ rect.x = rect.y = BORDER_WIDTH;
+ rect.width = width;
+ rect.height = height;
XShapeCombineRectangles( dpy,
win,
@@ -136,7 +136,7 @@ Window rmdFrameInit( Display *dpy,
XMapWindow(dpy, win);
- rmdDrawFrame(dpy,screen,win,width,height);
+ rmdDrawFrame(dpy, screen, win, width, height);
return win;
}
diff --git a/recordmydesktop/src/rmd_init_encoder.c b/recordmydesktop/src/rmd_init_encoder.c
index 55e1711..a0d81e6 100644
--- a/recordmydesktop/src/rmd_init_encoder.c
+++ b/recordmydesktop/src/rmd_init_encoder.c
@@ -41,41 +41,41 @@
static void m_add_fishead_packet(ogg_stream_state *m_ogg_state) {
fishead_packet skel_fp;
- skel_fp.ptime_n=skel_fp.btime_n=0;
- skel_fp.ptime_d=skel_fp.btime_d=1000;
+ skel_fp.ptime_n = skel_fp.btime_n = 0;
+ skel_fp.ptime_d = skel_fp.btime_d = 1000;
- add_fishead_to_stream(m_ogg_state,&skel_fp);
+ add_fishead_to_stream(m_ogg_state, &skel_fp);
}
static int rmdIncrementalNaming(char **name) {
struct stat buff;
char *base_name__;
- int i=0, fname_length=strlen(*name)-4;
+ int i = 0, fname_length = strlen(*name)-4;
- base_name__=malloc(fname_length+1);
- strncpy(base_name__,*name,fname_length);
- base_name__[fname_length]='\0';
+ base_name__ = malloc(fname_length+1);
+ strncpy(base_name__, *name, fname_length);
+ base_name__[fname_length] = '\0';
//this will go on an endless loop if you have 65536?
//files with the same name
//or it will crash and die.anyone interested in trying ?
- while (stat(*name,&buff)==0) {
+ while (stat(*name, &buff)==0) {
//create new name
- char *tname=malloc(strlen(*name)+10);
+ char *tname = malloc(strlen(*name)+10);
char numbuf[8];
- strcpy(tname,base_name__);
- strcat(tname,"-");
+ strcpy(tname, base_name__);
+ strcat(tname, "-");
i++;
snprintf( numbuf, 8, "%d", i );
- strcat(tname,numbuf);
- strcat(tname,".ogv");
+ strcat(tname, numbuf);
+ strcat(tname, ".ogv");
//save new name
free(*name);
- *name=malloc(strlen(tname)+1);
- strcpy(*name,tname);
+ *name = malloc(strlen(tname)+1);
+ strcpy(*name, tname);
free(tname);
}
@@ -98,11 +98,11 @@ void rmdInitEncoder(ProgData *pdata, EncData *enc_data_t, int buffer_ready) {
if (!(fname_length>4 && !strcasecmp(&fname[fname_length-3], "ogv"))) {
char *new_name = malloc(fname_length + 5);
- strcpy(new_name,fname);
- strcat(new_name,".ogv");
+ strcpy(new_name, fname);
+ strcat(new_name, ".ogv");
free(pdata->args.filename);
- pdata->args.filename=new_name;
+ pdata->args.filename = new_name;
}
if (!pdata->args.overwrite) {
@@ -110,9 +110,9 @@ void rmdInitEncoder(ProgData *pdata, EncData *enc_data_t, int buffer_ready) {
fprintf(stderr, "Output file: %s\n", pdata->args.filename);
}
- enc_data_t->fp = fopen((pdata)->args.filename,"w");
+ enc_data_t->fp = fopen((pdata)->args.filename, "w");
if (enc_data_t->fp == NULL) {
- fprintf(stderr,"Cannot open file %s for writting!\n", (pdata)->args.filename);
+ fprintf(stderr, "Cannot open file %s for writting!\n", (pdata)->args.filename);
exit(13);
}
@@ -176,7 +176,7 @@ void rmdInitEncoder(ProgData *pdata, EncData *enc_data_t, int buffer_ready) {
pdata->args.frequency,
(float)pdata->args.s_quality*0.1);
if (ret) {
- fprintf(stderr,"Error while setting up vorbis stream quality!\n");
+ fprintf(stderr, "Error while setting up vorbis stream quality!\n");
exit(2);
}
vorbis_comment_init(&enc_data_t->m_vo_cmmnt);
@@ -196,7 +196,7 @@ void rmdInitEncoder(ProgData *pdata, EncData *enc_data_t, int buffer_ready) {
ogg_stream_packetin(&enc_data_t->m_ogg_ts, &enc_data_t->m_ogg_pckt1);
if (ogg_stream_pageout(&enc_data_t->m_ogg_ts, &enc_data_t->m_ogg_pg) != 1) {
- fprintf(stderr,"Internal Ogg library error.\n");
+ fprintf(stderr, "Internal Ogg library error.\n");
exit(2);
}
fwrite(enc_data_t->m_ogg_pg.header, 1,
@@ -224,7 +224,7 @@ void rmdInitEncoder(ProgData *pdata, EncData *enc_data_t, int buffer_ready) {
&header_code);
ogg_stream_packetin(&enc_data_t->m_ogg_vs, &header);
if (ogg_stream_pageout(&enc_data_t->m_ogg_vs, &enc_data_t->m_ogg_pg) != 1) {
- fprintf(stderr,"Internal Ogg library error.\n");
+ fprintf(stderr, "Internal Ogg library error.\n");
exit(2);
}
@@ -251,7 +251,7 @@ void rmdInitEncoder(ProgData *pdata, EncData *enc_data_t, int buffer_ready) {
skel_fbv.granule_shift = theora_granule_shift(&enc_data_t->m_th_inf);
add_message_header_field(&skel_fbv, "Content-Type", "video/theora");
- add_fisbone_to_stream(&m_ogg_skel,&skel_fbv);
+ add_fisbone_to_stream(&m_ogg_skel, &skel_fbv);
if (!pdata->args.nosound) {
@@ -285,7 +285,7 @@ void rmdInitEncoder(ProgData *pdata, EncData *enc_data_t, int buffer_ready) {
while (1) {
int result = ogg_stream_flush(&enc_data_t->m_ogg_ts, &enc_data_t->m_ogg_pg);
if (result < 0) {
- fprintf(stderr,"Internal Ogg library error.\n");
+ fprintf(stderr, "Internal Ogg library error.\n");
exit(2);
}
@@ -304,7 +304,7 @@ void rmdInitEncoder(ProgData *pdata, EncData *enc_data_t, int buffer_ready) {
while (1) {
int result = ogg_stream_flush(&enc_data_t->m_ogg_vs, &enc_data_t->m_ogg_pg);
if (result < 0) {
- fprintf(stderr,"Internal Ogg library error.\n");
+ fprintf(stderr, "Internal Ogg library error.\n");
exit(2);
}
@@ -323,10 +323,10 @@ void rmdInitEncoder(ProgData *pdata, EncData *enc_data_t, int buffer_ready) {
//skeleton eos
add_eos_packet_to_stream(&m_ogg_skel);
if (ogg_stream_flush(&m_ogg_skel, &skel_og_pg) < 0) {
- fprintf(stderr,"Internal Ogg library error.\n");
+ fprintf(stderr, "Internal Ogg library error.\n");
exit(2);
}
- fwrite(skel_og_pg.header, 1, skel_og_pg.header_len,enc_data_t->fp);
+ fwrite(skel_og_pg.header, 1, skel_og_pg.header_len, enc_data_t->fp);
//theora buffer allocation, if any
if (!buffer_ready) {
diff --git a/recordmydesktop/src/rmd_initialize_data.c b/recordmydesktop/src/rmd_initialize_data.c
index 151267b..92e3e14 100644
--- a/recordmydesktop/src/rmd_initialize_data.c
+++ b/recordmydesktop/src/rmd_initialize_data.c
@@ -43,19 +43,19 @@
#ifdef HAVE_LIBASOUND
static void rmdFixBufferSize(snd_pcm_uframes_t *buffsize) {
- snd_pcm_uframes_t buffsize_t=*buffsize,
+ snd_pcm_uframes_t buffsize_t = *buffsize,
#else
static void rmdFixBufferSize(u_int32_t *buffsize) {
- u_int32_t buffsize_t=*buffsize,
+ u_int32_t buffsize_t = *buffsize,
#endif
- buffsize_ret=1;
+ buffsize_ret = 1;
- while (buffsize_t>1) {
- buffsize_t>>=1;
- buffsize_ret<<=1;
+ while (buffsize_t > 1) {
+ buffsize_t >>= 1;
+ buffsize_ret <<= 1;
}
- fprintf(stderr,"Buffer size adjusted to %d from %d frames.\n",
- (int)buffsize_ret,(int)*buffsize);
+ fprintf(stderr, "Buffer size adjusted to %d from %d frames.\n",
+ (int)buffsize_ret, (int)*buffsize);
}
int rmdInitializeData(ProgData *pdata, EncData *enc_data, CacheData *cache_data) {
@@ -106,59 +106,59 @@ int rmdInitializeData(ProgData *pdata, EncData *enc_data, CacheData *cache_data)
if (!pdata->args.use_jack) {
rmdFixBufferSize(&pdata->args.buffsize);
#ifdef HAVE_LIBASOUND
- pdata->sound_handle=rmdOpenDev(pdata->args.device,
- &pdata->args.channels,
- &pdata->args.frequency,
- &pdata->args.buffsize,
- &pdata->periodsize,
- &pdata->periodtime,
- &pdata->hard_pause);
- pdata->sound_framesize=((snd_pcm_format_width(
- SND_PCM_FORMAT_S16_LE))/8)*
- pdata->args.channels;
-
- if (pdata->sound_handle==NULL) {
+ pdata->sound_handle=rmdOpenDev( pdata->args.device,
+ &pdata->args.channels,
+ &pdata->args.frequency,
+ &pdata->args.buffsize,
+ &pdata->periodsize,
+ &pdata->periodtime,
+ &pdata->hard_pause);
+
+ pdata->sound_framesize=(snd_pcm_format_width(SND_PCM_FORMAT_S16_LE) / 8 *
+ pdata->args.channels);
+
+ if (pdata->sound_handle == NULL) {
#else
- pdata->sound_handle=rmdOpenDev( pdata->args.device,
- pdata->args.channels,
- pdata->args.frequency);
+ pdata->sound_handle = rmdOpenDev( pdata->args.device,
+ pdata->args.channels,
+ pdata->args.frequency);
- pdata->periodtime=(1000000*pdata->args.buffsize)/
- ((pdata->args.channels<<1)*pdata->args.frequency);
+ pdata->periodtime = (1000000 * pdata->args.buffsize) /
+ ((pdata->args.channels<<1) * pdata->args.frequency);
//when using OSS periodsize serves as an alias of buffsize
- pdata->periodsize=pdata->args.buffsize;
- pdata->sound_framesize=pdata->args.channels<<1;
+ pdata->periodsize = pdata->args.buffsize;
+ pdata->sound_framesize = pdata->args.channels<<1;
if (pdata->sound_handle<0) {
#endif
- fprintf(stderr,"Error while opening/configuring soundcard %s\n"
- "Try running with the --no-sound or specify a "
- "correct device.\n",
- pdata->args.device);
+ fprintf(stderr, "Error while opening/configuring soundcard %s\n"
+ "Try running with the --no-sound or specify a "
+ "correct device.\n",
+ pdata->args.device);
return 3;
}
} else {
#ifdef HAVE_LIBJACK
- int jack_error=0;
- pdata->jdata->port_names=pdata->args.jack_port_names;
- pdata->jdata->nports=pdata->args.jack_nports;
- pdata->jdata->ringbuffer_secs=pdata->args.jack_ringbuffer_secs;
- pdata->jdata->snd_buff_ready_mutex=&pdata->snd_buff_ready_mutex;
- pdata->jdata->sound_data_read=&pdata->sound_data_read;
- pdata->jdata->capture_started=0;
-
- if ((jack_error=rmdStartJackClient(pdata->jdata))!=0)
+ int jack_error = 0;
+ pdata->jdata->port_names = pdata->args.jack_port_names;
+ pdata->jdata->nports = pdata->args.jack_nports;
+ pdata->jdata->ringbuffer_secs = pdata->args.jack_ringbuffer_secs;
+ pdata->jdata->snd_buff_ready_mutex = &pdata->snd_buff_ready_mutex;
+ pdata->jdata->sound_data_read = &pdata->sound_data_read;
+ pdata->jdata->capture_started = 0;
+
+ if ((jack_error = rmdStartJackClient(pdata->jdata))!=0)
return jack_error;
- pdata->args.buffsize=pdata->jdata->buffersize;
- pdata->periodsize=pdata->args.buffsize;
- pdata->args.frequency=pdata->jdata->frequency;
- pdata->args.channels=pdata->jdata->nports;
- pdata->periodtime=(1000000*pdata->args.buffsize)/
- pdata->args.frequency;
- pdata->sound_framesize=sizeof(jack_default_audio_sample_t)*
- pdata->jdata->nports;
+ pdata->args.buffsize = pdata->jdata->buffersize;
+ pdata->periodsize = pdata->args.buffsize;
+ pdata->args.frequency = pdata->jdata->frequency;
+ pdata->args.channels = pdata->jdata->nports;
+ pdata->periodtime = 1000000 * pdata->args.buffsize /
+ pdata->args.frequency;
+ pdata->sound_framesize = sizeof(jack_default_audio_sample_t) *
+ pdata->jdata->nports;
#else
- fprintf(stderr,"Should not be here!\n");
+ fprintf(stderr, "Should not be here!\n");
exit(-1);
#endif
}
diff --git a/recordmydesktop/src/rmd_jack.c b/recordmydesktop/src/rmd_jack.c
index ada967e..ba37c8b 100644
--- a/recordmydesktop/src/rmd_jack.c
+++ b/recordmydesktop/src/rmd_jack.c
@@ -46,23 +46,22 @@
*
* \returns Zero always
*/
-static int rmdJackCapture(jack_nframes_t nframes,void *jdata_t) {
- int i=0;
- JackData *jdata=(JackData *)jdata_t;
+static int rmdJackCapture(jack_nframes_t nframes, void *jdata_t) {
+ JackData *jdata = (JackData *)jdata_t;
- if (!jdata->pdata->running || jdata->pdata->paused || !jdata->capture_started)
+ if (!jdata->pdata->running || jdata->pdata->paused || !jdata->capture_started)
return 0;
- for(i= 0;i<jdata->nports;i++)
- jdata->portbuf[i]=jack_port_get_buffer(jdata->ports[i],nframes);
+ for(int i = 0; i < jdata->nports; i++)
+ jdata->portbuf[i] = jack_port_get_buffer(jdata->ports[i], nframes);
//vorbis analysis buffer wants uninterleaved data
//so we are simply placing the buffers for every channel
//sequentially on the ringbuffer
- for(i=0;i<jdata->nports;i++)
+ for(int i = 0; i < jdata->nports; i++)
(*jack_ringbuffer_write)( jdata->sound_buffer,
(void *)(jdata->portbuf[i]),
- nframes*
+ nframes *
sizeof(jack_default_audio_sample_t));
/*FIXME */
//This is not safe.
@@ -88,18 +87,16 @@ static int rmdJackCapture(jack_nframes_t nframes,void *jdata_t) {
* \returns 0 on Success, 1 on failure
*/
static int rmdSetupPorts(JackData *jdata) {
- int i=0;
-
- jdata->ports=malloc(sizeof(jack_port_t *)* jdata->nports);
- jdata->portbuf=malloc(sizeof(jack_default_audio_sample_t*)* jdata->nports);
- memset(jdata->portbuf,0,sizeof(jack_default_audio_sample_t*)* jdata->nports);
+ jdata->ports = malloc(sizeof(jack_port_t *) * jdata->nports);
+ jdata->portbuf = malloc(sizeof(jack_default_audio_sample_t *) * jdata->nports);
+ memset(jdata->portbuf, 0, sizeof(jack_default_audio_sample_t *) * jdata->nports);
- for(i=0;i<jdata->nports;i++) {
+ for(int i = 0; i < jdata->nports; i++) {
char name[64];//recordMyDesktop:input_n<64 is enough for full name
char num[8];
- strcpy(name,"input_");
- snprintf( num, 8, "%d", i+1 );
- strcat(name,num);
+ strcpy(name, "input_");
+ snprintf(num, 8, "%d", i + 1);
+ strcat(name, num);
jdata->ports[i] = jack_port_register( jdata->client,
name,
@@ -108,13 +105,13 @@ static int rmdSetupPorts(JackData *jdata) {
0);
if (!jdata->ports[i]) {
- fprintf(stderr,"Cannot register input port \"%s\"!\n",name);
+ fprintf(stderr, "Cannot register input port \"%s\"!\n", name);
return 1;
}
if (jack_connect(jdata->client, jdata->port_names[i], jack_port_name(jdata->ports[i]))) {
- fprintf(stderr,"Cannot connect input port %s to %s\n",
+ fprintf(stderr, "Cannot connect input port %s to %s\n",
jack_port_name(jdata->ports[i]),
jdata->port_names[i]);
return 1;
@@ -136,7 +133,7 @@ static void rmdJackShutdown(void *jdata_t) {
}
int rmdStartJackClient(JackData *jdata) {
- float ring_buffer_size=0.0;
+ float ring_buffer_size = 0.0;
int pid;
char pidbuf[8];
char rmd_client_name[32];
@@ -146,12 +143,12 @@ int rmdStartJackClient(JackData *jdata) {
//in order to allow multiple
//instances of recordMyDesktop
//to connetc to a Jack Server
- strcpy(rmd_client_name,"recordMyDesktop-");
- pid=getpid();
+ strcpy(rmd_client_name, "recordMyDesktop-");
+ pid = getpid();
snprintf( pidbuf, 8, "%d", pid );
- strcat(rmd_client_name,pidbuf);
+ strcat(rmd_client_name, pidbuf);
- if ((jdata->client=(*jack_client_new)(rmd_client_name))==0) {
+ if ((jdata->client = (*jack_client_new)(rmd_client_name)) == 0) {
fprintf(stderr, "Could not create new client!\n"
"Make sure that Jack server is running!\n");
return 15;
@@ -169,18 +166,18 @@ int rmdStartJackClient(JackData *jdata) {
//(it might be in some cases, but it will certainly be the cause
//of unpredicted problems). A clean exit is preferable
//and any recording up to that point will be encoded and saved.
- jdata->frequency=jack_get_sample_rate(jdata->client);
- jdata->buffersize=jack_get_buffer_size(jdata->client);
- ring_buffer_size=( jdata->ringbuffer_secs*
+ jdata->frequency = jack_get_sample_rate(jdata->client);
+ jdata->buffersize = jack_get_buffer_size(jdata->client);
+ ring_buffer_size = ( jdata->ringbuffer_secs*
jdata->frequency*
sizeof(jack_default_audio_sample_t)*
jdata->nports);
- jdata->sound_buffer= (*jack_ringbuffer_create)((int)(ring_buffer_size+0.5));//round up
- jack_set_process_callback(jdata->client,rmdJackCapture,jdata);
- jack_on_shutdown(jdata->client,rmdJackShutdown,jdata);
+ jdata->sound_buffer = (*jack_ringbuffer_create)((int)(ring_buffer_size+0.5));//round up
+ jack_set_process_callback(jdata->client, rmdJackCapture, jdata);
+ jack_on_shutdown(jdata->client, rmdJackShutdown, jdata);
if (jack_activate(jdata->client)) {
- fprintf(stderr,"cannot activate client!\n");
+ fprintf(stderr, "cannot activate client!\n");
return 16;
}
@@ -193,12 +190,12 @@ int rmdStartJackClient(JackData *jdata) {
}
int rmdStopJackClient(JackData *jdata) {
- int ret=0;
+ int ret = 0;
(*jack_ringbuffer_free)(jdata->sound_buffer);
if (jack_client_close(jdata->client)) {
- fprintf(stderr,"Cannot close Jack client!\n");
- ret=1;
+ fprintf(stderr, "Cannot close Jack client!\n");
+ ret = 1;
}
/*TODO*/
@@ -207,10 +204,10 @@ int rmdStopJackClient(JackData *jdata) {
//because here it causes a segfault.
// if (dlclose(jdata->jack_lib_handle)) {
-// fprintf(stderr,"Cannot unload Jack library!\n");
+// fprintf(stderr, "Cannot unload Jack library!\n");
// ret=1;
// }
-// else fprintf(stderr,"Unloaded Jack library.\n");
+// else fprintf(stderr, "Unloaded Jack library.\n");
return ret;
}
diff --git a/recordmydesktop/src/rmd_load_cache.c b/recordmydesktop/src/rmd_load_cache.c
index 09e3138..8ca37f6 100644
--- a/recordmydesktop/src/rmd_load_cache.c
+++ b/recordmydesktop/src/rmd_load_cache.c
@@ -237,10 +237,10 @@ void *rmdLoadCache(ProgData *pdata) {
missing_frames += frame.header->current_total -
(extra_frames + frame.header->frameno);
if (pdata->frames_total) {
- fprintf(stdout, "\r[%d%%] ",
+ fprintf(stdout, "\r[%d%%] ",
((frame.header->frameno + extra_frames) * 100) / pdata->frames_total);
} else
- fprintf(stdout,"\r[%d frames rendered] ",
+ fprintf(stdout, "\r[%d frames rendered] ",
(frame.header->frameno + extra_frames));
fflush(stdout);
if ( (frame.header->Ynum <= blocknum_x * blocknum_y) &&
@@ -320,7 +320,7 @@ void *rmdLoadCache(ProgData *pdata) {
pdata->v_encoding_clean = 1;
pthread_cond_signal(&pdata->vorbis_lib_clean);
pthread_mutex_unlock(&pdata->vorbis_lib_mutex);
- fprintf(stdout,"\n");
+ fprintf(stdout, "\n");
// Clear frame
free(frame.YData);
diff --git a/recordmydesktop/src/rmd_math.c b/recordmydesktop/src/rmd_math.c
index 5a184e8..1cf3d29 100644
--- a/recordmydesktop/src/rmd_math.c
+++ b/recordmydesktop/src/rmd_math.c
@@ -29,5 +29,5 @@
#include <math.h>
double rmdRoundf(double val) {
- return val < 0.0 ? ceilf( val - 0.5 ) : floorf( val + 0.5 );
+ return val < 0.0 ? ceilf(val - .5) : floorf(val + 0.5);
}
diff --git a/recordmydesktop/src/rmd_opendev.c b/recordmydesktop/src/rmd_opendev.c
index c196c5a..37fb33c 100644
--- a/recordmydesktop/src/rmd_opendev.c
+++ b/recordmydesktop/src/rmd_opendev.c
@@ -52,35 +52,35 @@ snd_pcm_t *rmdOpenDev( const char *pcm_dev,
snd_pcm_t *mhandle;
snd_pcm_hw_params_t *hwparams;
- unsigned int periods=2;
+ unsigned int periods = 2;
unsigned int exactrate = *frequency;
// The compiler might warn us because the expansion starts with
// assert(&hwparams)
snd_pcm_hw_params_alloca(&hwparams);
- if (snd_pcm_open(&mhandle,pcm_dev,SND_PCM_STREAM_CAPTURE,SND_PCM_ASYNC)<0) {
+ if (snd_pcm_open(&mhandle, pcm_dev, SND_PCM_STREAM_CAPTURE, SND_PCM_ASYNC) < 0) {
fprintf(stderr, "Couldn't open PCM device %s\n", pcm_dev);
return NULL;
} else
fprintf(stderr, "Opened PCM device %s\n", pcm_dev);
- if (snd_pcm_hw_params_any(mhandle, hwparams)<0) {
+ if (snd_pcm_hw_params_any(mhandle, hwparams) < 0) {
fprintf(stderr, "Couldn't configure PCM device.\n");
return NULL;
}
- if (snd_pcm_hw_params_set_access(mhandle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED)<0) {
+ if (snd_pcm_hw_params_set_access(mhandle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED) < 0) {
fprintf(stderr, "Couldn't set access.\n");
return NULL;
}
- if (snd_pcm_hw_params_set_format(mhandle, hwparams, SND_PCM_FORMAT_S16_LE)<0) {
+ if (snd_pcm_hw_params_set_format(mhandle, hwparams, SND_PCM_FORMAT_S16_LE) < 0) {
fprintf(stderr, "Couldn't set format.\n");
return NULL;
}
- if (snd_pcm_hw_params_set_rate_near(mhandle, hwparams, &exactrate, 0)<0) {
+ if (snd_pcm_hw_params_set_rate_near(mhandle, hwparams, &exactrate, 0) < 0) {
fprintf(stderr, "Couldn't set frequency.\n");
return NULL;
}
@@ -90,48 +90,48 @@ snd_pcm_t *rmdOpenDev( const char *pcm_dev,
"Using %dHz instead.\n",
*frequency, exactrate);
- *frequency=exactrate;
+ *frequency = exactrate;
}
- if (snd_pcm_hw_params_set_channels_near(mhandle, hwparams, channels)<0) {
+ if (snd_pcm_hw_params_set_channels_near(mhandle, hwparams, channels) < 0) {
fprintf(stderr, "Couldn't set channels number.\n");
return NULL;
}
if (*channels>2) {
- fprintf(stderr,"Channels number should be 1(mono) or 2(stereo).\n");
+ fprintf(stderr, "Channels number should be 1(mono) or 2(stereo).\n");
return NULL;
}
- if (snd_pcm_hw_params_set_periods_near(mhandle,hwparams,&periods,0)<0) {
+ if (snd_pcm_hw_params_set_periods_near(mhandle, hwparams, &periods, 0) < 0) {
fprintf(stderr, "Couldn't set periods.\n");
return NULL;
}
- if (snd_pcm_hw_params_set_buffer_size_near(mhandle,hwparams,buffsize)<0) {
+ if (snd_pcm_hw_params_set_buffer_size_near(mhandle, hwparams, buffsize) < 0) {
fprintf(stderr, "Couldn't set buffer size.\n");
return NULL;
}
- if (snd_pcm_hw_params(mhandle,hwparams)<0) {
+ if (snd_pcm_hw_params(mhandle, hwparams) < 0) {
fprintf(stderr, "Couldn't set hardware parameters.\n");
return NULL;
}
- if (hard_pause!=NULL) {
+ if (hard_pause != NULL) {
if (!snd_pcm_hw_params_can_pause(hwparams))
- *hard_pause=1;
+ *hard_pause = 1;
}
- if (periodsize!=NULL)
- snd_pcm_hw_params_get_period_size(hwparams,periodsize,0);
+ if (periodsize != NULL)
+ snd_pcm_hw_params_get_period_size(hwparams, periodsize, 0);
- if (periodtime!=NULL)
- snd_pcm_hw_params_get_period_time(hwparams,periodtime,0);
+ if (periodtime != NULL)
+ snd_pcm_hw_params_get_period_time(hwparams, periodtime, 0);
fprintf(stderr,
"Recording on device %s is set to:\n%d channels at %dHz\n",
- pcm_dev,*channels,*frequency);
+ pcm_dev, *channels, *frequency);
snd_pcm_prepare(mhandle);
@@ -144,43 +144,43 @@ int rmdOpenDev(const char *pcm_dev, unsigned int channels, unsigned int frequenc
int fd ;
unsigned int value;
- fd=open(pcm_dev,O_RDONLY);
+ fd = open(pcm_dev, O_RDONLY);
if (fd < 0)
return -1;
- if (ioctl(fd,SNDCTL_DSP_GETFMTS,&value)<0) {
- fprintf(stderr,"Couldn't get audio format list\n");
+ if (ioctl(fd, SNDCTL_DSP_GETFMTS, &value) < 0) {
+ fprintf(stderr, "Couldn't get audio format list\n");
return -1;
}
if (value & AFMT_S16_LE) {
- value=AFMT_S16_LE;
+ value = AFMT_S16_LE;
} else if (value & AFMT_S16_BE) {
- value=AFMT_S16_BE;
+ value = AFMT_S16_BE;
} else {
- fprintf(stderr,"Soundcard doesn't support signed 16-bit-data\n");
+ fprintf(stderr, "Soundcard doesn't support signed 16-bit-data\n");
return -1;
}
- if (ioctl(fd,SNDCTL_DSP_SETFMT,&value)<0) {
- fprintf(stderr,"Couldn't set audio format\n" );
+ if (ioctl(fd, SNDCTL_DSP_SETFMT, &value) < 0) {
+ fprintf(stderr, "Couldn't set audio format\n" );
return -1;
}
value = channels;
- if (ioctl(fd,SNDCTL_DSP_CHANNELS,&value)<0) {
- fprintf(stderr,"Cannot set the number of channels\n" );
+ if (ioctl(fd, SNDCTL_DSP_CHANNELS, &value) < 0) {
+ fprintf(stderr, "Cannot set the number of channels\n" );
return -1;
}
value = frequency;
- if (ioctl(fd,SNDCTL_DSP_SPEED,&value)<0) {
- fprintf(stderr,"Couldn't set audio frequency\n" );
+ if (ioctl(fd, SNDCTL_DSP_SPEED, &value) < 0) {
+ fprintf(stderr, "Couldn't set audio frequency\n" );
return -1;
}
- if (fcntl(fd,F_SETFL,fcntl(fd,F_GETFL) & ~O_NONBLOCK)<0) {
- fprintf(stderr,"Couldn't set audio blocking mode\n" );
+ if (fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) & ~O_NONBLOCK) < 0) {
+ fprintf(stderr, "Couldn't set audio blocking mode\n" );
return -1;
}
diff --git a/recordmydesktop/src/rmd_parseargs.c b/recordmydesktop/src/rmd_parseargs.c
index 1cce025..12d2cd4 100644
--- a/recordmydesktop/src/rmd_parseargs.c
+++ b/recordmydesktop/src/rmd_parseargs.c
@@ -177,12 +177,12 @@ boolean rmdParseArgs(int argc, char **argv, ProgArgs *arg_return) {
{ "buffer-size", '\0',
POPT_ARG_INT, &arg_return->buffsize, 0,
- "A positive number denoting the desired sound buffer size (in frames,when using ALSA or OSS)",
+ "A positive number denoting the desired sound buffer size (in frames, when using ALSA or OSS)",
"N" },
{ "ring-buffer-size", '\0',
POPT_ARG_FLOAT, &arg_return->jack_ringbuffer_secs, 0,
- "A float number denoting the desired ring buffer size (in seconds,when using JACK only).",
+ "A float number denoting the desired ring buffer size (in seconds, when using JACK only).",
"N" },
{ "device", '\0',
@@ -268,7 +268,7 @@ boolean rmdParseArgs(int argc, char **argv, ProgArgs *arg_return) {
{ "delay", '\0',
POPT_ARG_STRING, &arg_return->delay, RMD_ARG_DELAY,
- "Number of secs(default),minutes or hours before capture starts(number can be float)",
+ "Number of secs(default), minutes or hours before capture starts(number can be float)",
"n[H|h|M|m]" },
{ "overwrite", '\0',
@@ -488,7 +488,7 @@ static void rmdPrintAndExit( poptContext con,
const void *data)
{
if (strcmp(opt->longName, "version") == 0) {
- fprintf(stderr,"recordMyDesktop v%s\n\n",VERSION);
+ fprintf(stderr, "recordMyDesktop v%s\n\n", VERSION);
} else if (strcmp(opt->longName, "help") == 0) {
poptPrintHelp(con, stdout, 0);
fprintf(stdout,
diff --git a/recordmydesktop/src/rmd_poll_events.c b/recordmydesktop/src/rmd_poll_events.c
index 96730fd..49f2478 100644
--- a/recordmydesktop/src/rmd_poll_events.c
+++ b/recordmydesktop/src/rmd_poll_events.c
@@ -141,7 +141,7 @@ void rmdInitEventsPolling(ProgData *pdata) {
unsigned int i,
nchildren;
- XSelectInput (pdata->dpy,pdata->specs.root, SubstructureNotifyMask);
+ XSelectInput (pdata->dpy, pdata->specs.root, SubstructureNotifyMask);
if (!pdata->args.full_shots) {
XQueryTree ( pdata->dpy,
@@ -153,8 +153,8 @@ void rmdInitEventsPolling(ProgData *pdata) {
for (i = 0; i < nchildren; i++) {
XWindowAttributes attribs;
- if (XGetWindowAttributes (pdata->dpy,children[i],&attribs)) {
- if (!attribs.override_redirect && attribs.depth==pdata->specs.depth)
+ if (XGetWindowAttributes (pdata->dpy, children[i], &attribs)) {
+ if (!attribs.override_redirect && attribs.depth == pdata->specs.depth)
XDamageCreate( pdata->dpy,
children[i],
XDamageReportRawRectangles);
@@ -174,13 +174,13 @@ void rmdEventLoop(ProgData *pdata) {
XEvent event;
while (XPending(pdata->dpy)) {
- XNextEvent(pdata->dpy,&event);
+ XNextEvent(pdata->dpy, &event);
if (event.type == KeyPress) {
XKeyEvent *e = (XKeyEvent *)(&event);
if (e->keycode == pdata->pause_key.key) {
int i = 0;
int found = 0;
- for (i=0; i < pdata->pause_key.modnum; i++) {
+ for (i = 0; i < pdata->pause_key.modnum; i++) {
if (pdata->pause_key.mask[i] == e->state) {
found = 1;
break;
diff --git a/recordmydesktop/src/rmd_queryextensions.c b/recordmydesktop/src/rmd_queryextensions.c
index 087f7d2..4484866 100644
--- a/recordmydesktop/src/rmd_queryextensions.c
+++ b/recordmydesktop/src/rmd_queryextensions.c
@@ -48,7 +48,9 @@ void rmdQueryExtensions( Display *dpy,
shape_event_base,
shape_error_base;
- if ((!(args->full_shots))&&(!XDamageQueryExtension( dpy, damage_event, damage_error))) {
+ if ( !args->full_shots &&
+ !XDamageQueryExtension(dpy, damage_event, damage_error)) {
+
fprintf(stderr, "XDamage extension not found!!!\n"
"Try again using the --full-shots option, though\n"
"enabling XDamage is highly recommended,\n"
@@ -56,31 +58,31 @@ void rmdQueryExtensions( Display *dpy,
exit(4);
}
- if ((!args->noshared)&&(!XQueryExtension( dpy,
- "MIT-SHM",
- shm_opcode,
- &shm_event_base,
- &shm_error_base))) {
- args->noshared=1;
- fprintf(stderr,"Shared Memory extension not present!\n"
- "Try again using the --no-shared option\n");
+ if ( !args->noshared &&
+ !XQueryExtension(dpy, "MIT-SHM", shm_opcode, &shm_event_base, &shm_error_base)) {
+
+ args->noshared = 1;
+ fprintf(stderr, "Shared Memory extension not present!\n"
+ "Try again using the --no-shared option\n");
exit(5);
}
- if ((args->xfixes_cursor)&&
- (XFixesQueryExtension(dpy,&xf_event_basep,&xf_error_basep)==False)) {
- args->xfixes_cursor=0;
- fprintf(stderr,"Xfixes extension not present!\n"
- "Please run with the -dummy-cursor or"
- " --no-cursor option.\n");
+ if ( args->xfixes_cursor &&
+ XFixesQueryExtension(dpy, &xf_event_basep, &xf_error_basep) == False) {
+
+ args->xfixes_cursor = 0;
+ fprintf(stderr, "Xfixes extension not present!\n"
+ "Please run with the -dummy-cursor or"
+ " --no-cursor option.\n");
exit(6);
}
- if ((!args->noframe)&&
- (!XShapeQueryExtension(dpy,&shape_event_base,&shape_error_base))) {
- fprintf(stderr,"XShape Not Found!!!\n"
- "Frame won't be available.\n");
+ if ( !args->noframe &&
+ !XShapeQueryExtension(dpy, &shape_event_base, &shape_error_base)) {
+
+ fprintf(stderr, "XShape Not Found!!!\n"
+ "Frame won't be available.\n");
- args->noframe=1;
+ args->noframe = 1;
}
}
© All Rights Reserved