changeset 109:ed4178146cc5

small code cleanup, removed unused variables
author arpi_esp
date Thu, 15 Mar 2001 19:38:34 +0000
parents 796f840a45db
children 96c5071626a0
files asfheader.c codecctrl.c demux_asf.c demux_avi.c mplayer.c
diffstat 5 files changed, 8 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/asfheader.c	Thu Mar 15 19:25:08 2001 +0000
+++ b/asfheader.c	Thu Mar 15 19:38:34 2001 +0000
@@ -87,7 +87,6 @@
 
 int asf_check_header(){
   unsigned char asfhdrguid[16]={0x30,0x26,0xB2,0x75,0x8E,0x66,0xCF,0x11,0xA6,0xD9,0x00,0xAA,0x00,0x62,0xCE,0x6C};
-  int i;
   stream_read(demuxer->stream,(char*) &asfh,sizeof(asfh)); // header obj
 //  for(i=0;i<16;i++) printf(" %02X",temp[i]);printf("\n");
 //  for(i=0;i<16;i++) printf(" %02X",asfhdrguid[i]);printf("\n");
--- a/codecctrl.c	Thu Mar 15 19:25:08 2001 +0000
+++ b/codecctrl.c	Thu Mar 15 19:38:34 2001 +0000
@@ -136,7 +136,6 @@
         //printf("codec: connection synced\n");
         
         while(1){
-          int num_frames;
           int len=0;
           int len2;
           send_cmd(control_fifo2,0x3030303);
--- a/demux_asf.c	Thu Mar 15 19:25:08 2001 +0000
+++ b/demux_asf.c	Thu Mar 15 19:38:34 2001 +0000
@@ -17,11 +17,6 @@
 
 
 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 d;
-//  int len;
-  int skip;
-  float pts=0;
-  unsigned char c=0;
   demux_stream_t *ds=NULL;
   
   if(verbose>=4) printf("demux_asf.read_packet: id=%d seq=%d len=%d\n",id,seq,len);
@@ -96,11 +91,6 @@
 //     0 = EOF or no stream found
 //     1 = successfully read a packet
 int demux_asf_fill_buffer(demuxer_t *demux){
-unsigned int id=0;
-unsigned int len;
-int skipped=0;
-int max_packs=128;
-int ret=0;
 
   demux->filepos=stream_tell(demux->stream);
   if(demux->filepos>=demux->endpos){
--- a/demux_avi.c	Thu Mar 15 19:25:08 2001 +0000
+++ b/demux_avi.c	Thu Mar 15 19:38:34 2001 +0000
@@ -27,11 +27,8 @@
 }
 
 static int demux_avi_read_packet(demuxer_t *demux,unsigned int id,unsigned int len,int idxpos){
-  int d;
-//  int len;
   int skip;
   float pts=0;
-  unsigned char c=0;
   demux_stream_t *ds=demux_avi_select_stream(demux,id);
   
   if(verbose>=3) printf("demux_avi.read_packet: %X\n",id);
@@ -79,7 +76,6 @@
 int demux_avi_fill_buffer(demuxer_t *demux){
 unsigned int id=0;
 unsigned int len;
-int skipped=0;
 int max_packs=128;
 int ret=0;
 
@@ -161,7 +157,6 @@
 int demux_avi_fill_buffer_ni(demuxer_t *demux,demux_stream_t* ds){
 unsigned int id=0;
 unsigned int len;
-int skipped=0;
 int max_packs=128;
 int ret=0;
 
@@ -233,7 +228,6 @@
 int demux_avi_fill_buffer_nini(demuxer_t *demux,demux_stream_t* ds){
 unsigned int id=0;
 unsigned int len;
-int skipped=0;
 int ret=0;
 int *fpos=NULL;
 
--- a/mplayer.c	Thu Mar 15 19:25:08 2001 +0000
+++ b/mplayer.c	Thu Mar 15 19:38:34 2001 +0000
@@ -11,6 +11,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 
 #include <signal.h>
 
@@ -588,7 +589,7 @@
       } else {
         if(force_ni || abs(a_pos-v_pos)>0x100000){  // distance > 1MB
           printf("Detected NON-INTERLEAVED AVI file-format!\n");
-          file_format=DEMUXER_TYPE_AVI_NI; // HACK!!!!
+//          file_format=DEMUXER_TYPE_AVI_NI; // HACK!!!!
           demuxer->type=DEMUXER_TYPE_AVI_NI; // HACK!!!!
 	  pts_from_bps=1; // force BPS sync!
         }
@@ -1084,7 +1085,7 @@
 }
 
 if(has_audio==2){
-  if(file_format==DEMUXER_TYPE_AVI || file_format==DEMUXER_TYPE_AVI_NI){
+  if(file_format==DEMUXER_TYPE_AVI){
     // AVI PCM Audio:
     WAVEFORMATEX *h=(WAVEFORMATEX*)&avi_header.wf_ext;
     MP3_channels=h->nChannels;
@@ -1233,7 +1234,7 @@
 
 //==================== START PLAYING =======================
 
-if(file_format==DEMUXER_TYPE_AVI || file_format==DEMUXER_TYPE_AVI_NI){
+if(file_format==DEMUXER_TYPE_AVI){
   a_pts=d_audio->pts-(buffer_delay+audio_delay);
   audio_delay-=(float)(avi_header.audio.dwInitialFrames-avi_header.video.dwInitialFrames)/default_fps;
 //  audio_delay-=(float)(avi_header.audio.dwInitialFrames-avi_header.video.dwInitialFrames)/default_fps;
@@ -1581,7 +1582,7 @@
 #if 1
 /*================ A-V TIMESTAMP CORRECTION: =========================*/
   if(has_audio){
-    if(pts_from_bps && (file_format==DEMUXER_TYPE_AVI || file_format==DEMUXER_TYPE_AVI_NI)){
+    if(pts_from_bps && (file_format==DEMUXER_TYPE_AVI)){
 //      a_pts=(float)ds_tell(d_audio)/((WAVEFORMATEX*)avi_header.wf_ext)->nAvgBytesPerSec-(buffer_delay+audio_delay);
       a_pts=(float)ds_tell(d_audio)/((WAVEFORMATEX*)avi_header.wf_ext)->nAvgBytesPerSec-(buffer_delay);
       delay_corrected=1; // hack
@@ -1728,7 +1729,6 @@
 
 switch(file_format){
 
-  case DEMUXER_TYPE_AVI_NI:
   case DEMUXER_TYPE_AVI: {
   //================= seek in AVI ==========================
     int rel_seek_frames=rel_seek_secs*default_fps;
@@ -1796,7 +1796,6 @@
         int i;
         int apos=0;
         int last=0;
-        int temp;
         int len=0;
 
         // calc new audio position in audio stream: (using avg.bps value)
@@ -1990,5 +1989,6 @@
 
 //printf("\nEnd of file.\n");
 exit_player("End of file");
-}}
-
+}
+return 1;
+}