[Mplayer-cvslog] CVS: main mplayer.c,1.142,1.143 demux_asf.c,1.8,1.9 demux_avi.c,1.6,1.7 demuxer.h,1.4,1.5 demuxer.c,1.9,1.10
GEREOFFY
arpi_esp at users.sourceforge.net
Mon Jun 4 01:35:01 CEST 2001
Update of /cvsroot/mplayer/main
In directory usw-pr-cvs1:/tmp/cvs-serv14034
Modified Files:
mplayer.c demux_asf.c demux_avi.c demuxer.h demuxer.c
Log Message:
keyframe flag added
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.142
retrieving revision 1.143
diff -C2 -r1.142 -r1.143
*** mplayer.c 2001/06/03 19:46:22 1.142
--- mplayer.c 2001/06/03 23:34:59 1.143
***************
*** 1612,1615 ****
--- 1612,1617 ----
if(in_size>max_framesize) max_framesize=in_size;
+ if(d_video->flags) if(verbose) printf("***keyframe***\n");
+
if(drop_frame<2) DS_VideoDecoder_DecodeFrame(start, in_size, 0, !drop_frame);
current_module="draw_frame";
***************
*** 1641,1644 ****
--- 1643,1648 ----
if(in_size<0){ eof=1;break;}
if(in_size>max_framesize) max_framesize=in_size;
+
+ if(d_video->flags) if(verbose) printf("***keyframe***\n");
if(in_size){
Index: demux_asf.c
===================================================================
RCS file: /cvsroot/mplayer/main/demux_asf.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** demux_asf.c 2001/05/21 13:04:34 1.8
--- demux_asf.c 2001/06/03 23:34:59 1.9
***************
*** 59,63 ****
! static int demux_asf_read_packet(demuxer_t *demux,unsigned char *data,int len,int id,int seq,unsigned long time,unsigned short dur,int offs){
demux_stream_t *ds=NULL;
--- 59,63 ----
! static int demux_asf_read_packet(demuxer_t *demux,unsigned char *data,int len,int id,int seq,unsigned long time,unsigned short dur,int offs,int keyframe){
demux_stream_t *ds=NULL;
***************
*** 119,122 ****
--- 119,123 ----
memcpy(dp->buffer,data,len);
dp->pts=time*0.001f;
+ dp->flags=keyframe;
// if(ds==demux->video) printf("ASF time: %8d dur: %5d \n",time,dur);
dp->pos=demux->filepos;
***************
*** 208,211 ****
--- 209,213 ----
unsigned char type;
unsigned long time2;
+ int keyframe=0;
if(p>=p_end) printf("Warning! invalid packet 1, sig11 coming soon...\n");
***************
*** 219,222 ****
--- 221,225 ----
streamno=p[0]&0x7F;
+ if(p[0]&0x80) keyframe=1;
seq=p[1];
p+=2;
***************
*** 280,284 ****
p++;
//printf(" group part: %d bytes\n",len2);
! demux_asf_read_packet(demux,p,len2,streamno,seq,x,duration,-1);
p+=len2;
len-=len2+1;
--- 283,287 ----
p++;
//printf(" group part: %d bytes\n",len2);
! demux_asf_read_packet(demux,p,len2,streamno,seq,x,duration,-1,keyframe);
p+=len2;
len-=len2+1;
***************
*** 291,295 ****
// NO GROUPING:
//printf("fragment offset: %d \n",sh->x);
! demux_asf_read_packet(demux,p,len,streamno,seq,time2,duration,x);
p+=len;
break;
--- 294,298 ----
// NO GROUPING:
//printf("fragment offset: %d \n",sh->x);
! demux_asf_read_packet(demux,p,len,streamno,seq,time2,duration,x,keyframe);
p+=len;
break;
Index: demux_avi.c
===================================================================
RCS file: /cvsroot/mplayer/main/demux_avi.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** demux_avi.c 2001/04/23 22:33:06 1.6
--- demux_avi.c 2001/06/03 23:34:59 1.7
***************
*** 58,62 ****
}
! static int demux_avi_read_packet(demuxer_t *demux,unsigned int id,unsigned int len,int idxpos){
int skip;
float pts=0;
--- 58,62 ----
}
! static int demux_avi_read_packet(demuxer_t *demux,unsigned int id,unsigned int len,int idxpos,int flags){
int skip;
float pts=0;
***************
*** 93,97 ****
if(ds){
if(verbose>=2) printf("DEMUX_AVI: Read %d data bytes from packet %04X\n",len,id);
! ds_read_packet(ds,demux->stream,len,pts,idxpos);
skip-=len;
}
--- 93,97 ----
if(ds){
if(verbose>=2) printf("DEMUX_AVI: Read %d data bytes from packet %04X\n",len,id);
! ds_read_packet(ds,demux->stream,len,pts,idxpos,flags);
skip-=len;
}
***************
*** 116,119 ****
--- 116,120 ----
do{
+ int flags=0;
AVIINDEXENTRY *idx=NULL;
demux->filepos=stream_tell(demux->stream);
***************
*** 167,170 ****
--- 168,172 ----
continue;
}
+ if(idx->dwFlags&AVIIF_KEYFRAME) flags=1;
} else {
id=stream_read_dword_le(demux->stream);
***************
*** 175,179 ****
}
}
! ret=demux_avi_read_packet(demux,id,len,demux->idx_pos-1);
if(!ret && skip_video_frames<=0)
if(--max_packs==0){
--- 177,181 ----
}
}
! ret=demux_avi_read_packet(demux,id,len,demux->idx_pos-1,flags);
if(!ret && skip_video_frames<=0)
if(--max_packs==0){
***************
*** 197,200 ****
--- 199,203 ----
do{
+ int flags=0;
AVIINDEXENTRY *idx=NULL;
int idx_pos=0;
***************
*** 246,251 ****
continue;
}
} else return 0;
! ret=demux_avi_read_packet(demux,id,len,idx_pos);
if(!ret && skip_video_frames<=0)
if(--max_packs==0){
--- 249,255 ----
continue;
}
+ if(idx->dwFlags&AVIIF_KEYFRAME) flags=1;
} else return 0;
! ret=demux_avi_read_packet(demux,id,len,idx_pos,flags);
if(!ret && skip_video_frames<=0)
if(--max_packs==0){
***************
*** 292,296 ****
if(ds==demux_avi_select_stream(demux,id)){
// read it!
! ret=demux_avi_read_packet(demux,id,len,demux->idx_pos-1);
} else {
// skip it!
--- 296,300 ----
if(ds==demux_avi_select_stream(demux,id)){
// read it!
! ret=demux_avi_read_packet(demux,id,len,demux->idx_pos-1,0);
} else {
// skip it!
Index: demuxer.h
===================================================================
RCS file: /cvsroot/mplayer/main/demuxer.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** demuxer.h 2001/05/27 00:02:12 1.4
--- demuxer.h 2001/06/03 23:34:59 1.5
***************
*** 22,25 ****
--- 22,26 ----
int pos; // pozicio indexben (AVI) ill. fileban (MPG)
unsigned char* buffer;
+ int flags; // keyframe, etc
struct demux_packet_st* next;
} demux_packet_t;
***************
*** 35,38 ****
--- 36,40 ----
int dpos; // position in the demuxed stream
int pack_no; // serial number of packet
+ int flags; // flags of current packet (keyframe etc)
//---------------
int packs; // number of packets in buffer
***************
*** 88,91 ****
--- 90,94 ----
dp->pts=0;
dp->pos=0;
+ dp->flags=0;
return dp;
}
***************
*** 100,104 ****
void ds_add_packet(demux_stream_t *ds,demux_packet_t* dp);
! void ds_read_packet(demux_stream_t *ds,stream_t *stream,int len,float pts,int pos);
int demux_fill_buffer(demuxer_t *demux,demux_stream_t *ds);
--- 103,107 ----
void ds_add_packet(demux_stream_t *ds,demux_packet_t* dp);
! void ds_read_packet(demux_stream_t *ds,stream_t *stream,int len,float pts,int pos,int flags);
int demux_fill_buffer(demuxer_t *demux,demux_stream_t *ds);
Index: demuxer.c
===================================================================
RCS file: /cvsroot/mplayer/main/demuxer.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** demuxer.c 2001/05/27 00:02:12 1.9
--- demuxer.c 2001/06/03 23:34:59 1.10
***************
*** 71,79 ****
}
! void ds_read_packet(demux_stream_t *ds,stream_t *stream,int len,float pts,int pos){
demux_packet_t* dp=new_demux_packet(len);
stream_read(stream,dp->buffer,len);
dp->pts=pts; //(float)pts/90000.0f;
dp->pos=pos;
// append packet to DS stream:
ds_add_packet(ds,dp);
--- 71,80 ----
}
! void ds_read_packet(demux_stream_t *ds,stream_t *stream,int len,float pts,int pos,int flags){
demux_packet_t* dp=new_demux_packet(len);
stream_read(stream,dp->buffer,len);
dp->pts=pts; //(float)pts/90000.0f;
dp->pos=pos;
+ dp->flags=flags;
// append packet to DS stream:
ds_add_packet(ds,dp);
***************
*** 129,132 ****
--- 130,134 ----
}
ds->pts_bytes+=p->len; // !!!
+ ds->flags=p->flags;
// free packet:
ds->bytes-=p->len;
_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog
More information about the MPlayer-cvslog
mailing list