[MPlayer-cvslog] r32154 - in trunk: libao2/ao_mpegpes.c libvo/vo_mpegpes.c

diego subversion at mplayerhq.hu
Sat Sep 11 16:13:21 CEST 2010


Author: diego
Date: Sat Sep 11 16:13:21 2010
New Revision: 32154

Log:
Rename vo_mpegpes_fd2 variable to ao_mpegpes_fd.

Modified:
   trunk/libao2/ao_mpegpes.c
   trunk/libvo/vo_mpegpes.c

Modified: trunk/libao2/ao_mpegpes.c
==============================================================================
--- trunk/libao2/ao_mpegpes.c	Sat Sep 11 14:32:38 2010	(r32153)
+++ trunk/libao2/ao_mpegpes.c	Sat Sep 11 16:13:21 2010	(r32154)
@@ -52,7 +52,7 @@ audio_mixer_t dvb_mixer={255,255};
 #define false 0
 
 extern int vo_mpegpes_fd;
-int vo_mpegpes_fd2 = -1;
+int ao_mpegpes_fd = -1;
 
 #include <errno.h>
 
@@ -76,20 +76,20 @@ static int control(int cmd,void *arg){
 #ifdef CONFIG_DVB
     switch(cmd){
 	case AOCONTROL_GET_VOLUME:
-	  if(vo_mpegpes_fd2>=0){
+	  if(ao_mpegpes_fd >= 0){
 	    ((ao_control_vol_t*)(arg))->left=dvb_mixer.volume_left/2.56;
 	    ((ao_control_vol_t*)(arg))->right=dvb_mixer.volume_right/2.56;
 	    return CONTROL_OK;
 	  }
 	  return CONTROL_ERROR;
 	case AOCONTROL_SET_VOLUME:
-	  if(vo_mpegpes_fd2>=0){
+	  if(ao_mpegpes_fd >= 0){
 	    dvb_mixer.volume_left=((ao_control_vol_t*)(arg))->left*2.56;
 	    dvb_mixer.volume_right=((ao_control_vol_t*)(arg))->right*2.56;
 	    if(dvb_mixer.volume_left>255) dvb_mixer.volume_left=255;
 	    if(dvb_mixer.volume_right>255) dvb_mixer.volume_right=255;
 	    //	 printf("Setting DVB volume: %d ; %d  \n",dvb_mixer.volume_left,dvb_mixer.volume_right);
-	    if ( (ioctl(vo_mpegpes_fd2,AUDIO_SET_MIXER, &dvb_mixer) < 0)){
+	    if ( (ioctl(ao_mpegpes_fd, AUDIO_SET_MIXER, &dvb_mixer) < 0)){
 		mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_MPEGPES_CantSetMixer,
 		    strerror(errno));
 	      return CONTROL_ERROR;
@@ -111,36 +111,36 @@ static int init_device(int card)
 	char ao_file[30];
 	sprintf(ao_file, "/dev/dvb/adapter%d/audio0", card);
 	mp_msg(MSGT_VO,MSGL_INFO, "Opening %s\n", ao_file);
-	if((vo_mpegpes_fd2 = open(ao_file,O_RDWR|O_NONBLOCK)) < 0)
+	if((ao_mpegpes_fd = open(ao_file,O_RDWR|O_NONBLOCK)) < 0)
 	{
         	mp_msg(MSGT_VO, MSGL_ERR, "DVB AUDIO DEVICE: %s\n", strerror(errno));
         	return -1;
 	}
-	if( (ioctl(vo_mpegpes_fd2,AUDIO_SELECT_SOURCE, AUDIO_SOURCE_MEMORY) < 0))
+	if( (ioctl(ao_mpegpes_fd, AUDIO_SELECT_SOURCE, AUDIO_SOURCE_MEMORY) < 0))
 	{
 		mp_msg(MSGT_VO, MSGL_ERR, "DVB AUDIO SELECT SOURCE: %s\n", strerror(errno));
 		goto fail;
 	}
-	if((ioctl(vo_mpegpes_fd2,AUDIO_PLAY) < 0))
+	if((ioctl(ao_mpegpes_fd, AUDIO_PLAY) < 0))
 	{
 		mp_msg(MSGT_VO, MSGL_ERR, "DVB AUDIO PLAY: %s\n", strerror(errno));
 		goto fail;
 	}
-	if((ioctl(vo_mpegpes_fd2,AUDIO_SET_AV_SYNC, true) < 0))
+	if((ioctl(ao_mpegpes_fd, AUDIO_SET_AV_SYNC, true) < 0))
 	{
 		mp_msg(MSGT_VO, MSGL_ERR, "DVB AUDIO SET AV SYNC: %s\n", strerror(errno));
 		goto fail;
 	}
 	//FIXME: in vo_mpegpes audio was initialized as MUTEd
-	if((ioctl(vo_mpegpes_fd2,AUDIO_SET_MUTE, false) < 0))
+	if((ioctl(ao_mpegpes_fd, AUDIO_SET_MUTE, false) < 0))
 	{
 		mp_msg(MSGT_VO, MSGL_ERR, "DVB AUDIO SET MUTE: %s\n", strerror(errno));
 		goto fail;
 	}
-	return vo_mpegpes_fd2;
+	return ao_mpegpes_fd;
 fail:
-	close(vo_mpegpes_fd2);
-	vo_mpegpes_fd2 = -1;
+	close(ao_mpegpes_fd);
+	ao_mpegpes_fd = -1;
 	return -1;
 }
 #endif
@@ -191,13 +191,13 @@ static int preinit(const char *arg)
 		return vo_mpegpes_fd;	//video fd
 #endif
 
-	vo_mpegpes_fd2=open(ao_file,O_WRONLY|O_CREAT,0666);
-	if(vo_mpegpes_fd2<0)
+	ao_mpegpes_fd = open(ao_file, O_WRONLY | O_CREAT, 0666);
+	if(ao_mpegpes_fd < 0)
 	{
 		mp_msg(MSGT_VO, MSGL_ERR, "ao_mpegpes: %s\n", strerror(errno));
 		return -1;
 	}
-	return vo_mpegpes_fd2;
+	return ao_mpegpes_fd;
 }
 
 static int my_ao_write(const unsigned char* data,int len){
@@ -206,13 +206,13 @@ static int my_ao_write(const unsigned ch
 #define NFD   1
     struct pollfd pfd[NFD];
 
-    pfd[0].fd = vo_mpegpes_fd2;
+    pfd[0].fd     = ao_mpegpes_fd;
     pfd[0].events = POLLOUT;
 
     while(len>0){
         if(poll(pfd,NFD,1)){
             if(pfd[0].revents & POLLOUT){
-                int ret=write(vo_mpegpes_fd2,data,len);
+                int ret = write(ao_mpegpes_fd, data, len);
                 if(ret<=0){
                     mp_msg(MSGT_VO, MSGL_ERR, "ao_mpegpes write: %s\n", strerror(errno));
                     usleep(0);
@@ -225,8 +225,8 @@ static int my_ao_write(const unsigned ch
     }
 
 #else
-    if(vo_mpegpes_fd2<0) return 0; // no file
-    write(vo_mpegpes_fd2,data,len); // write to file
+    if(ao_mpegpes_fd < 0) return 0; // no file
+    write(ao_mpegpes_fd, data, len); // write to file
 #endif
     return orig_len;
 }
@@ -278,9 +278,9 @@ static int init(int rate,int channels,in
 
 // close audio device
 static void uninit(int immed){
-	if (vo_mpegpes_fd2 >= 0)
-		close(vo_mpegpes_fd2);
-	vo_mpegpes_fd2 = -1;
+	if (ao_mpegpes_fd >= 0)
+		close(ao_mpegpes_fd);
+	ao_mpegpes_fd = -1;
 }
 
 // stop playing and empty buffers (for seeking/pause)

Modified: trunk/libvo/vo_mpegpes.c
==============================================================================
--- trunk/libvo/vo_mpegpes.c	Sat Sep 11 14:32:38 2010	(r32153)
+++ trunk/libvo/vo_mpegpes.c	Sat Sep 11 16:13:21 2010	(r32154)
@@ -58,7 +58,7 @@
 #include "libmpdemux/mpeg_packetizer.h"
 
 int vo_mpegpes_fd=-1;
-extern int vo_mpegpes_fd2;
+extern int ao_mpegpes_fd;
 
 static const vo_info_t info =
 {
@@ -175,7 +175,7 @@ static int my_write(const unsigned char*
 	pfd[0].fd = vo_mpegpes_fd;
 	pfd[0].events = POLLOUT;
 
-	pfd[1].fd = vo_mpegpes_fd2;
+	pfd[1].fd = ao_mpegpes_fd;
 	pfd[1].events = POLLOUT;
 
     while(len>0){
@@ -231,8 +231,8 @@ query_format(uint32_t format)
 static void
 uninit(void)
 {
-    if(vo_mpegpes_fd2>=0 && vo_mpegpes_fd2!=vo_mpegpes_fd) close(vo_mpegpes_fd2);
-    vo_mpegpes_fd2=-1;
+    if(ao_mpegpes_fd >= 0 && ao_mpegpes_fd != vo_mpegpes_fd) close(ao_mpegpes_fd);
+    ao_mpegpes_fd =- 1;
     if(vo_mpegpes_fd>=0){ close(vo_mpegpes_fd);vo_mpegpes_fd=-1;}
 }
 


More information about the MPlayer-cvslog mailing list