[Mplayer-cvslog] CVS: main/libvo vo_mpegpes.c,1.34,1.35
Arpi of Ize
arpi at mplayerhq.hu
Wed Oct 9 01:11:51 CEST 2002
Update of /cvsroot/mplayer/main/libvo
In directory mail:/var/tmp.root/cvs-serv15565
Modified Files:
vo_mpegpes.c
Log Message:
- fixed a 10l bug: setting PTS flag even if no PTS stored
- support for file-writing even if --enable-dvb: -vo mpegpes:filename.mpg
Index: vo_mpegpes.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_mpegpes.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- vo_mpegpes.c 28 Aug 2002 21:32:32 -0000 1.34
+++ vo_mpegpes.c 8 Oct 2002 23:11:49 -0000 1.35
@@ -84,6 +84,7 @@
static uint32_t preinit(const char *arg){
#ifdef HAVE_DVB
+ if(!arg){
//|O_NONBLOCK
if((vo_mpegpes_fd = open("/dev/ost/video",O_RDWR)) < 0){
perror("DVB VIDEO DEVICE: ");
@@ -120,22 +121,24 @@
perror("DVB VIDEO PLAY: ");
return -1;
}
- if ( (ioctl(vo_mpegpes_fd2,AUDIO_SET_AV_SYNC, true) < 0)){
+ if ( (ioctl(vo_mpegpes_fd2,AUDIO_SET_AV_SYNC, false) < 0)){
perror("DVB AUDIO SET AV SYNC: ");
return -1;
}
- if ( (ioctl(vo_mpegpes_fd2,AUDIO_SET_MUTE, false) < 0)){
+// if ( (ioctl(vo_mpegpes_fd2,AUDIO_SET_MUTE, false) < 0)){
+ if ( (ioctl(vo_mpegpes_fd2,AUDIO_SET_MUTE, true) < 0)){
perror("DVB AUDIO SET MUTE: ");
return -1;
}
-
-#else
- vo_mpegpes_fd=open("grab.mpg",O_WRONLY|O_CREAT,0666);
+ return 0;
+ }
+#endif
+ vo_mpegpes_fd=open(arg ? arg : "grab.mpg",O_WRONLY|O_CREAT,0666);
if(vo_mpegpes_fd<0){
perror("vo_mpegpes");
return -1;
}
-#endif
+ vo_mpegpes_fd2=vo_mpegpes_fd;
return 0;
}
@@ -248,8 +251,11 @@
pes_header[5]=(payload_size+3+ptslen+7)&255;
// stuffing:
+ // TTCCxxxx CC=css TT=type: 1=STD 0=mpeg1 2=vob
pes_header[6]=0x81;
- pes_header[7]=0x80;
+
+ // FFxxxxxx FF=pts flags=2 vs 0
+ pes_header[7]=ptslen ? 0x80 : 0;
// hdrlen:
pes_header[8]=ptslen;
@@ -332,8 +338,9 @@
static void
uninit(void)
{
+ if(vo_mpegpes_fd2>=0 && vo_mpegpes_fd2!=vo_mpegpes_fd) close(vo_mpegpes_fd2);
+ vo_mpegpes_fd2=-1;
if(vo_mpegpes_fd>=0){ close(vo_mpegpes_fd);vo_mpegpes_fd=-1;}
- if(vo_mpegpes_fd2>=0){ close(vo_mpegpes_fd2);vo_mpegpes_fd2=-1;}
}
More information about the MPlayer-cvslog
mailing list