mirror of https://github.com/mpv-player/mpv
small code cleanup, removed unused variables
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@110 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
891f664f7d
commit
d9f5084243
|
@ -87,7 +87,6 @@ char* asf_chunk_type(unsigned char* guid){
|
|||
|
||||
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");
|
||||
|
|
|
@ -136,7 +136,6 @@ void mpeg_codec_controller(vo_functions_t *video_out){
|
|||
//printf("codec: connection synced\n");
|
||||
|
||||
while(1){
|
||||
int num_frames;
|
||||
int len=0;
|
||||
int len2;
|
||||
send_cmd(control_fifo2,0x3030303);
|
||||
|
|
10
demux_asf.c
10
demux_asf.c
|
@ -17,11 +17,6 @@ typedef struct __attribute__((packed)) {
|
|||
|
||||
|
||||
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 @@ static int demux_asf_read_packet(demuxer_t *demux,unsigned char *data,int len,in
|
|||
// 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){
|
||||
|
|
|
@ -27,11 +27,8 @@ static inline demux_stream_t* demux_avi_select_stream(demuxer_t *demux,unsigned
|
|||
}
|
||||
|
||||
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 @@ static int demux_avi_read_packet(demuxer_t *demux,unsigned int id,unsigned int l
|
|||
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 @@ do{
|
|||
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 @@ do{
|
|||
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;
|
||||
|
||||
|
|
16
mplayer.c
16
mplayer.c
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
|
@ -588,7 +589,7 @@ switch(file_format){
|
|||
} 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==4){
|
|||
}
|
||||
|
||||
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 @@ if(has_audio){
|
|||
|
||||
//==================== 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 @@ switch(has_video){
|
|||
#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(has_video){
|
|||
|
||||
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 @@ switch(file_format){
|
|||
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 @@ switch(file_format){
|
|||
|
||||
//printf("\nEnd of file.\n");
|
||||
exit_player("End of file");
|
||||
}}
|
||||
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue