summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbiocrasher <biocrasher@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2006-07-16 03:51:19 +0000
committerbiocrasher <biocrasher@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2006-07-16 03:51:19 +0000
commitddf178ed4cc5944637c876a85b4353427c62ad96 (patch)
tree2153d578b8bd8a6a9af1c6b92cd31453ee441e30
parent8a98bbf655c19998505a55f4b505d5d4c0a3ccda (diff)
moved avd global into pdata struct
git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@15 f606c939-3180-4ac9-a4b8-4b8779d57d0a
-rw-r--r--recordmydesktop/include/recordmydesktop.h3
-rw-r--r--recordmydesktop/src/encode_image_buffer.c2
-rw-r--r--recordmydesktop/src/encode_sound_buffer.c4
-rw-r--r--recordmydesktop/src/recordmydesktop.c2
4 files changed, 6 insertions, 5 deletions
diff --git a/recordmydesktop/include/recordmydesktop.h b/recordmydesktop/include/recordmydesktop.h
index 2e8a113..9f1be8d 100644
--- a/recordmydesktop/include/recordmydesktop.h
+++ b/recordmydesktop/include/recordmydesktop.h
@@ -176,6 +176,7 @@ typedef struct _ProgData{
EncData *enc_data;
int hard_pause;//if sound device doesn't support pause
//we have to close and reopen
+ int avd;//syncronization among audio and video
unsigned int periodtime,
frametime;
pthread_mutex_t list_mutex[2],//mutexes for concurrency protection of the lists
@@ -195,7 +196,7 @@ typedef struct _ProgData{
int Paused,*Running,Aborted;
pthread_cond_t *time_cond,*pause_cond;
-int avd;
+
/**Macros*/
diff --git a/recordmydesktop/src/encode_image_buffer.c b/recordmydesktop/src/encode_image_buffer.c
index 76c4126..bc80abe 100644
--- a/recordmydesktop/src/encode_image_buffer.c
+++ b/recordmydesktop/src/encode_image_buffer.c
@@ -17,7 +17,7 @@ void *EncodeImageBuffer(void *pdata){
pthread_mutex_unlock(&((ProgData *)pdata)->yuv_mutex);
theora_encode_packetout(&((ProgData *)pdata)->enc_data->m_th_st,0,&((ProgData *)pdata)->enc_data->m_ogg_pckt1);
ogg_stream_packetin(&((ProgData *)pdata)->enc_data->m_ogg_ts,&((ProgData *)pdata)->enc_data->m_ogg_pckt1);
- avd+=((ProgData *)pdata)->frametime*2*((ProgData *)pdata)->args.channels;
+ ((ProgData *)pdata)->avd+=((ProgData *)pdata)->frametime*2*((ProgData *)pdata)->args.channels;
}
//last packet
if(theora_encode_YUVin(&((ProgData *)pdata)->enc_data->m_th_st,&((ProgData *)pdata)->enc_data->yuv)){
diff --git a/recordmydesktop/src/encode_sound_buffer.c b/recordmydesktop/src/encode_sound_buffer.c
index 1c42ae8..03b4043 100644
--- a/recordmydesktop/src/encode_sound_buffer.c
+++ b/recordmydesktop/src/encode_sound_buffer.c
@@ -25,7 +25,7 @@ void *EncodeSoundBuffer(void *pdata){
((ProgData *)pdata)->sound_buffer=((ProgData *)pdata)->sound_buffer->next;
pthread_mutex_unlock(&((ProgData *)pdata)->sound_buffer_mutex);
- if (avd>0){
+ if (((ProgData *)pdata)->avd>0){
vorbis_buffer=vorbis_analysis_buffer(&((ProgData *)pdata)->enc_data->m_vo_dsp,sampread);
for(i=0;i<sampread;i++){
@@ -45,7 +45,7 @@ void *EncodeSoundBuffer(void *pdata){
while(vorbis_bitrate_flushpacket(&((ProgData *)pdata)->enc_data->m_vo_dsp,&((ProgData *)pdata)->enc_data->m_ogg_pckt2))
ogg_stream_packetin(&((ProgData *)pdata)->enc_data->m_ogg_vs,&((ProgData *)pdata)->enc_data->m_ogg_pckt2);
}
- avd-=((ProgData *)pdata)->periodtime;
+ ((ProgData *)pdata)->avd-=((ProgData *)pdata)->periodtime;
}
free(buff);
}
diff --git a/recordmydesktop/src/recordmydesktop.c b/recordmydesktop/src/recordmydesktop.c
index e438f7f..89f9892 100644
--- a/recordmydesktop/src/recordmydesktop.c
+++ b/recordmydesktop/src/recordmydesktop.c
@@ -91,7 +91,7 @@ int main(int argc,char **argv){
pthread_cond_init(&pdata.image_buffer_ready,NULL);
pthread_cond_init(&pdata.sound_buffer_ready,NULL);
pthread_cond_init(&pdata.sound_data_read,NULL);
- pdata.list_selector=Paused=Aborted=avd=0;
+ pdata.list_selector=Paused=Aborted=pdata.avd=0;
pdata.running=1;
time_cond=&pdata.time_cond;
pause_cond=&pdata.pause_cond;
© All Rights Reserved