MPlayer-cvslog
Threads by month
- ----- 2025 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- 37059 discussions
Update of /cvsroot/mplayer/main
In directory usw-pr-cvs1:/tmp/cvs-serv820
Modified Files:
codec-cfg.c
Removed Files:
codecs.conf
Log Message:
codecs.conf was already at DOCS...
Index: codec-cfg.c
===================================================================
RCS file: /cvsroot/mplayer/main/codec-cfg.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** codec-cfg.c 2001/04/06 23:20:46 1.1
--- codec-cfg.c 2001/04/06 23:28:18 1.2
***************
*** 445,449 ****
int i,j;
! codecs = parse_codec_cfg("codecs.conf");
printf("total %d codecs parsed\n",nr_codecs);
--- 445,449 ----
int i,j;
! codecs = parse_codec_cfg("DOCS/codecs.conf");
printf("total %d codecs parsed\n",nr_codecs);
--- codecs.conf DELETED ---
_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog(a)lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog
1
0
CVS: main codecs.conf,NONE,1.1 codec-cfg.c,NONE,1.1 codec-cfg.h,NONE,1.1 Makefile,1.10,1.11
by GEREOFFY 06 Apr '01
by GEREOFFY 06 Apr '01
06 Apr '01
Update of /cvsroot/mplayer/main
In directory usw-pr-cvs1:/tmp/cvs-serv31765
Modified Files:
Makefile
Added Files:
codecs.conf codec-cfg.c codec-cfg.h
Log Message:
imported codec-cfg, small fixes
--- NEW FILE ---
; Example codecs config file.
; It is not functional yet! until we finish config loader,
; mplayer will use codecs.c!!!
videocodec mpeg4
info "Microsoft MPEG-4 v1/v2"
comment "No postprocessing"
fourcc MPG4,mpg4
fourcc MP42,mp42
driver vfw
dll "mpg4c32.dll"
out YUY2 noflip,yuvhack
out RGB32,RGB24,RGB15
videocodec divx
info "DivX ;-) (MS MPEG-4 v3)"
comment "DivX rulez ;-)"
fourcc MP43,mp43 div3 ; fourcc mapping to div3
fourcc DIV5,div5 div3
fourcc DIV6,div6 div4
fourcc DIV3,div3,DIV4,div3
driver vfw
dll "divxc32.dll"
out YUY2 noflip,yuvhack
out RGB32,RGB24,RGB15
videocodec divxds
info "DivX ;-) (MS MPEG-4 v3)"
comment "DivX rulez ;-)"
fourcc MP43,mp43 div3 ; fourcc mapping to div3
fourcc DIV5,div5 div3
fourcc DIV6,div6 div4
fourcc DIV3,div3,DIV4,div3
driver dshow
dll "divx_c32.ax"
guid 0x82CCd3E0, 0xF71A, 0x11D0, 0x9f, 0xe5, 0x00, 0x60, 0x97, 0x78, 0xaa, 0xaa
out YUY2 noflip
out RGB32,RGB24,RGB16,RGB15 noflip
videocodec odivx
info "OpenDivX (MPEG-4 v2)"
fourcc DIVX,divx
fourcc DIV1,div1 divx
driver odivx
out YV12 noflip
videocodec indeo5
info "Intel Indeo 5"
fourcc IV50,iv50
driver vfw
dll "ir50_32.dll"
out YUY2 noflip
out RGB32,RGB24,RGB15 noflip
videocodec indeo4
info "Intel Indeo 4.1"
comment "upside-down"
fourcc IV41,iv41
driver vfw
dll "ir41_32.dll"
out RGB24,RGB15 flip
videocodec indeo3
info "Intel Indeo 3.1/3.2"
comment "upside-down"
fourcc IV31,iv31
fourcc IV32,iv32
driver vfw
dll "ir32_32.dll"
out RGB24,RGB15 flip
videocodec cvid
info "Cinepak Video"
fourcc cvid
driver vfw
dll "msvidc32.dll"
out YUY2 noflip
out RGB24,RGB15 noflip
videocodec cram
info "CRAM"
fourcc cram,CRAM
driver vfw
dll "msvidc32.dll"
out RGB24,RGB15 noflip
videocodec vcr2
info "ATI VCR-2"
fourcc VCR2
driver vfw
dll "ativcr2.dll"
out YUY2 noflip
out RGB32,RGB24,RGB15 noflip
videocodec i263
info "I263"
comment "not tested"
fourcc I263,i263
driver vfw
dll "i263_32.drv"
out RGB32,RGB24,RGB15 noflip
videocodec mjpeg
info "Motion JPEG"
fourcc MJPG
driver vfw
dll "mcmjpg32.dll"
; dll "m3jpeg32.dll"
out YUY2 noflip
out RGB32,RGB24,RGB15 noflip
videocodec wmv1
info "Windows Media Video 7"
fourcc WMV1
driver dshow
dll "wmvds32.ax"
guid 0x4facbba1, 0xffd8, 0x4cd7, 0x82, 0x28, 0x61, 0xe2, 0xf6, 0x5c, 0xb1, 0xae
out YUY2 noflip
out RGB32,RGB24,RGB16,RGB15 noflip
audiocodec divx
info "DivX audio (WMA)"
format 0x160
format 0x161
driver acm
dll "divxa32.acm"
audiocodec msadpcm
info "MS ADPCM"
format 0x2
driver acm
dll "msadp32.acm"
audiocodec mp3acm
info "MPEG layer-3"
comment "Optimized to Intel MMX/SSE"
format 0x55
driver acm
dll "l3codeca.acm"
flags seekable
audiocodec mp3
info "MPEG layer-2,3"
comment "Optimized to AMD 3Dnow!"
format 0x50
format 0x55
driver mp3lib
flags seekable
audiocodec imaadpcm
info "IMA ADPCM"
format 0x11
driver acm
dll "imaadp32.acm"
audiocodec msgsmacm
info "MS GSM"
format 0x31
format 0x32
driver acm
dll "msgsm32.acm"
audiocodec msgsm
info "MS GSM"
format 0x31
format 0x32
driver msgsm
audiocodec voxware
info "VoxWare"
format 0x75
driver dshow
dll "voxmsdec.ax"
guid 0x73f7a062, 0x8829, 0x11d1, 0xb5, 0x50, 0x00, 0x60, 0x97, 0x24, 0x2d, 0x8d
--- NEW FILE ---
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <ctype.h>
#include <assert.h>
#include <string.h>
#include "libvo/video_out.h"
#include "codec-cfg.h"
#define MALLOC_ADD 10
#define MAX_LINE_LEN 1000
#define STATE_MASK ((1<<7)-1)
#define GOT_NAME (1<<0)
#define GOT_INFO (1<<1)
#define GOT_FOURCC (1<<2)
#define GOT_FORMAT (1<<3)
#define GOT_DRIVER (1<<4)
#define GOT_DLL (1<<5)
#define GOT_OUT (1<<6)
#define RET_EOF -1
#define RET_EOL -2
#define RET_OK 0
FILE *fp;
int line_num = 0;
int line_pos; /* line pos */
int firstdef = 1;
char *line;
char *token;
int nr_codecs = 0;
int get_token(void)
{
static int read_nextline = 1;
if (read_nextline) {
if (!fgets(line, MAX_LINE_LEN, fp))
goto ret_eof;
line_pos = 0;
++line_num;
read_nextline = 0;
}
while (isspace(line[line_pos]))
++line_pos;
if (line[line_pos] == '\0' || line[line_pos] == '#' ||
line[line_pos] == ';') {
read_nextline = 1;
goto ret_eol;
}
token = line + line_pos;
if (line[line_pos] == '"') {
token++;
for (/* NOTHING */; line[++line_pos] != '"' && line[line_pos];)
/* NOTHING */;
if (!line[line_pos]) {
read_nextline = 1;
goto ret_eol;
}
} else {
for (/* NOTHING */; !isspace(line[line_pos]); line_pos++)
/* NOTHING */;
}
line[line_pos] = '\0';
line_pos++;
#ifdef DEBUG
printf("get_token ok\n");
#endif
return RET_OK;
ret_eof:
#ifdef DEBUG
printf("get_token EOF\n");
#endif
token = NULL;
return RET_EOF;
ret_eol:
#ifdef DEBUG
printf("get_token EOL\n");
#endif
token = NULL;
return RET_EOL;
}
int add_to_fourcc(char *s, char *alias, unsigned int *fourcc,
unsigned int *map)
{
int i;
char **aliasp;
/* find first unused slot */
for (i = 0; i < CODECS_MAX_FOURCC && fourcc[i] != 0xffffffff; i++)
/* NOTHING */;
if (i == CODECS_MAX_FOURCC) {
printf("too many fourcc...\n");
return 0;
}
#if 1
if (alias) {
do {
fourcc[i] = *((unsigned int *) s);
map[i] = *((unsigned int *) alias);
s += 4;
i++;
} while (*(s++) == ',');
} else {
do {
fourcc[i] = *((unsigned int *) s);
map[i] = *((unsigned int *) s);
s += 4;
i++;
} while (*(s++) == ',');
}
#else
if (alias)
aliasp = &alias;
else
aliasp = &s;
do {
fourcc[i] = *((unsigned int *) s);
map[i++] = *((unsigned int *) (*aliasp));
s += 4;
} while (*(s++) == ',');
#endif
if (*(--s) != '\0')
return 0;
return 1;
}
int add_to_format(char *s, unsigned int *format)
{
return 1;
}
short get_flags(char *s)
{
if (!s)
return 0;
return 1;
}
int add_to_out(char *sfmt, char *sflags, unsigned int *outfmt,
unsigned char *outflags)
{
static char *fmtstr[] = {
"YUY2",
"YV12",
"RGB8",
"RGB15",
"RGB16",
"RGB24",
"RGB32",
"BGR8",
"BGR15",
"BGR16",
"BGR24",
"BGR32",
NULL
};
static unsigned int fmtnum[] = {
IMGFMT_YUY2,
IMGFMT_YV12,
IMGFMT_RGB|8,
IMGFMT_RGB|15,
IMGFMT_RGB|16,
IMGFMT_RGB|24,
IMGFMT_RGB|32,
IMGFMT_BGR|8,
IMGFMT_BGR|15,
IMGFMT_BGR|16,
IMGFMT_BGR|24,
IMGFMT_BGR|32
};
int i, j;
unsigned char flags;
for (i = 0; i < CODECS_MAX_OUTFMT && outfmt[i] != 0xffffffff; i++)
/* NOTHING */;
if (i == CODECS_MAX_FOURCC) {
printf("too many out...\n");
return 0;
}
flags = get_flags(sflags);
do {
for (j = 0; fmtstr[i] != NULL; j++)
if (!strncmp(sfmt, fmtstr[j], strlen(fmtstr[j])))
break;
if (fmtstr[j] == NULL)
return 0;
outfmt[i] = fmtnum[j];
outflags[i] = flags;
sfmt+=strlen(fmtstr[j]);
} while (*(sfmt++) == ',');
if (*(--sfmt) != '\0')
return 0;
return 1;
}
short get_driver(char *s)
{
return 0;
}
#define DEBUG
codecs_t *parse_codec_cfg(char *cfgfile)
{
#define PRINT_LINENUM printf("%s(%d): ", cfgfile, line_num)
#define GET_MEM\
do {\
if (!(codecs = (codecs_t *) realloc(codecs,\
sizeof(codecs_t) * (nr_codecs + 1)))) {\
perror("parse_codec_cfg: can't realloc 'codecs'");\
goto err_out;\
}\
} while (0)
codecs_t *codecs = NULL;
int free_slots = 0;
int tmp, i;
int state = 0;
char *param1;
#ifdef DEBUG
assert(cfgfile != NULL);
#endif
printf("Reading codec config file: %s\n", cfgfile);
if ((line = (char *) malloc(MAX_LINE_LEN + 1)) == NULL) {
perror("parse_codec_cfg: can't get memory for 'line'");
return NULL;
}
if ((fp = fopen(cfgfile, "r")) == NULL) {
printf("parse_codec_cfg: can't open '%s': %s\n", cfgfile, strerror(errno));
free(line);
return NULL;
}
line_pos = 0;
line[0] = '\0'; /* forces get_token to read next line */
for (;;) {
tmp = get_token();
if (tmp == RET_EOF)
goto eof_out;
if (tmp == RET_EOL)
continue;
if (!strcmp(token, "audiocodec") || !strcmp(token, "videocodec")) {
if (codecs) {
// tmp = ~state & STATE_MASK;
// if (tmp != GOT_FOURCC && tmp != GOT_FORMAT)
// goto parse_error_out;
nr_codecs++;
}
PRINT_LINENUM;
GET_MEM;
state = 0;
codecs[nr_codecs].comment = NULL;
memset(codecs[nr_codecs].fourcc, 0xff,
sizeof(codecs[nr_codecs].fourcc) );
/*
memset(codecs[nr_codecs].fourccmap, 0xff,
sizeof(codecs[nr_codecs].fourccmap) *
CODECS_MAX_FOURCC);
*/
memset(codecs[nr_codecs].outfmt, 0xff,
sizeof(codecs[nr_codecs].outfmt) );
if (*token == 'a') { /* audiocodec */
printf("audio");
codecs[nr_codecs].flags |= CODECS_FLAG_AUDIO;
} else if (*token == 'v') { /* videocodec */
printf("video");
codecs[nr_codecs].flags &= !CODECS_FLAG_AUDIO;
} else {
printf("itt valami nagyon el van baszva\n");
goto err_out;
}
if (get_token() < 0)
goto parse_error_out;
codecs[nr_codecs].name = strdup(token);
state |= GOT_NAME;
printf(" %s\n", codecs[nr_codecs].name);
} else if (!strcmp(token, "info")) {
if (!(state & GOT_NAME))
goto parse_error_out;
PRINT_LINENUM;
printf("info");
if (state & GOT_INFO || get_token() < 0)
goto parse_error_out;
codecs[nr_codecs].info = strdup(token);
state |= GOT_INFO;
printf(" %s\n", codecs[nr_codecs].info);
} else if (!strcmp(token, "comment")) {
if (!(state & GOT_NAME))
goto parse_error_out;
PRINT_LINENUM;
printf("comment");
if (get_token() < 0)
goto parse_error_out;
#if 1
if (!codecs[nr_codecs].comment)
codecs[nr_codecs].comment = strdup(token);
printf(" %s\n", codecs[nr_codecs].comment);
#else
add_comment(token, &codecs[nr_codecs].comment);
printf(" FIXMEEEEEEEEEEEEEEE\n");
#endif
} else if (!strcmp(token, "fourcc")) {
if (!(state & GOT_NAME))
goto parse_error_out;
PRINT_LINENUM;
printf("fourcc");
if (codecs[nr_codecs].flags & CODECS_FLAG_AUDIO) {
printf("\n'fourcc' in audiocodec definition!\n");
goto err_out;
}
if (get_token() < 0)
goto parse_error_out;
param1 = strdup(token);
get_token();
if (!add_to_fourcc(param1, token,
codecs[nr_codecs].fourcc,
codecs[nr_codecs].fourccmap))
goto err_out;
state |= GOT_FOURCC;
printf(" %s: %s\n", param1, token);
free(param1);
} else if (!strcmp(token, "format")) {
if (!(state & GOT_NAME))
goto parse_error_out;
PRINT_LINENUM;
printf("format");
if (!(codecs[nr_codecs].flags & CODECS_FLAG_AUDIO)) {
printf("\n'format' in videocodec definition!\n");
goto err_out;
}
if (get_token() < 0)
goto parse_error_out;
if (!add_to_format(token, codecs[nr_codecs].fourcc))
goto err_out;
state |= GOT_FORMAT;
printf(" %s\n", token);
} else if (!strcmp(token, "driver")) {
if (!(state & GOT_NAME))
goto parse_error_out;
PRINT_LINENUM;
printf("driver");
if (get_token() < 0)
goto parse_error_out;
if ((codecs[nr_codecs].driver = get_driver(token)) == -1)
goto err_out;
printf(" %s\n", token);
} else if (!strcmp(token, "dll")) {
if (!(state & GOT_NAME))
goto parse_error_out;
PRINT_LINENUM;
printf("dll");
if (get_token() < 0)
goto parse_error_out;
codecs[nr_codecs].dll = strdup(token);
printf(" %s\n", codecs[nr_codecs].dll);
} else if (!strcmp(token, "guid")) {
if (!(state & GOT_NAME))
goto parse_error_out;
PRINT_LINENUM;
printf("guid");
if (get_token() < 0)
goto parse_error_out;
sscanf(token, "%ld,", &codecs[nr_codecs].guid.f1);
if (get_token() < 0)
goto parse_error_out;
sscanf(token, "%d,", &tmp);
codecs[nr_codecs].guid.f2 = tmp;
if (get_token() < 0)
goto parse_error_out;
sscanf(token, "%d,", &tmp);
codecs[nr_codecs].guid.f3 = tmp;
for (i = 0; i < 7; i++) {
if (get_token() < 0)
goto parse_error_out;
sscanf(token, "%d,", &tmp);
codecs[nr_codecs].guid.f4[i] = tmp;
}
if (get_token() < 0)
goto parse_error_out;
sscanf(token, "%d", &tmp);
codecs[nr_codecs].guid.f4[7] = tmp;
printf(" %s\n", token);
} else if (!strcmp(token, "out")) {
if (!(state & GOT_NAME))
goto parse_error_out;
PRINT_LINENUM;
printf("out");
if (get_token() < 0)
goto parse_error_out;
param1 = strdup(token);
get_token();
if (!add_to_out(param1, token, codecs[nr_codecs].outfmt,
codecs[nr_codecs].outflags))
goto err_out;
printf(" %s: %s\n", param1, token);
free(param1);
} else if (!strcmp(token, "flags")) {
if (!(state & GOT_NAME))
goto parse_error_out;
PRINT_LINENUM;
printf("flags");
if (get_token() < 0)
goto parse_error_out;
printf(" %s\n", token);
} else
goto parse_error_out;
}
out:
free(line);
fclose(fp);
return codecs;
parse_error_out:
PRINT_LINENUM;
printf("parse error\n");
err_out:
printf("\nOops\n");
if (codecs)
free(codecs);
codecs = NULL;
goto out;
eof_out:
/* FIXME teljes az utolso config?? */
goto out;
}
#ifdef TESTING
int main(void)
{
codecs_t *codecs;
int i,j;
codecs = parse_codec_cfg("codecs.conf");
printf("total %d codecs parsed\n",nr_codecs);
for(i=0;i<nr_codecs;i++){
codecs_t *c=&codecs[i];
printf("\n============== codec %02d ===============\n",i);
printf("name='%s'\n",c->name);
printf("info='%s'\n",c->info);
printf("comment='%s'\n",c->comment);
printf("dll='%s'\n",c->dll);
printf("flags=%X driver=%d\n",c->flags,c->driver);
for(j=0;j<CODECS_MAX_FOURCC;j++){
if(c->fourcc[j]!=0xFFFFFFFF){
printf("fourcc %02d: %08X (%.4s) ===> %08X (%.4s)\n",j,c->fourcc[j],&c->fourcc[j],c->fourccmap[j],&c->fourccmap[j]);
}
}
}
return 0;
}
#endif
--- NEW FILE ---
#ifndef __CODEC_CFG_H
#define __CODEC_CFG_H
//#include <inttypes.h>
#ifndef IMGFMT_YV12
#define IMGFMT_YV12 0x32315659
#define IMGFMT_YUY2 (('2'<<24)|('Y'<<16)|('U'<<8)|'Y')
#define IMGFMT_RGB_MASK 0xFFFFFF00
#define IMGFMT_RGB (('R'<<24)|('G'<<16)|('B'<<8))
#define IMGFMT_BGR_MASK 0xFFFFFF00
#define IMGFMT_BGR (('B'<<24)|('G'<<16)|('R'<<8))
#endif
#define CODECS_MAX_FOURCC 16
#define CODECS_MAX_OUTFMT 16
#define CODECS_FLAG_AUDIO (1<<0)
#warning nem kellene ket typedef GUID-nak...
typedef struct {
long f1;
short f2;
short f3;
char f4[8];
} GUID;
typedef struct {
char *name;
char *info;
char *comment;
unsigned int fourcc[CODECS_MAX_FOURCC];
unsigned int fourccmap[CODECS_MAX_FOURCC];
short driver;
short flags;
char *dll;
GUID guid;
unsigned int outfmt[CODECS_MAX_OUTFMT];
unsigned char outflags[CODECS_MAX_OUTFMT];
} codecs_t;
codecs_t *parse_codec_cfg(char *cfgfile);
#endif
Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/Makefile,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** Makefile 2001/03/30 03:06:46 1.10
--- Makefile 2001/04/06 23:20:46 1.11
***************
*** 18,21 ****
--- 18,23 ----
PRG_AVIP = aviparse
PRG_TV = tvision
+ PRG_CFG = codec-cfg
+
prefix = /usr/local
BINDIR = ${prefix}/bin
***************
*** 31,35 ****
# .PHONY: all clean
! all: $(PRG)
# $(PRG_AVIP)
--- 33,37 ----
# .PHONY: all clean
! all: $(PRG) $(PRG_CFG)
# $(PRG_AVIP)
***************
*** 74,77 ****
--- 76,82 ----
$(PRG_TV): .depend tvision.o $(OBJS) $(COMMONLIBS)
$(CC) $(CFLAGS) -o $(PRG_TV) tvision.o $(OBJS) -lm $(TERMCAP_LIB) $(VO_LIBS)
+
+ $(PRG_CFG): codec-cfg.c codec-cfg.h
+ $(CC) $(CFLAGS) codec-cfg.c -o $(PRG_CFG) -DTESTING
install: $(PRG)
_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog(a)lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog
1
0
CVS: main dec_audio.c,1.1,1.2 dll_init.c,1.3,1.4 mplayer.c,1.36,1.37 stheader.h,1.1,1.2
by GEREOFFY 06 Apr '01
by GEREOFFY 06 Apr '01
06 Apr '01
Update of /cvsroot/mplayer/main
In directory usw-pr-cvs1:/tmp/cvs-serv4544
Modified Files:
dec_audio.c dll_init.c mplayer.c stheader.h
Log Message:
audio init moved to dec_audio.c
Index: dec_audio.c
===================================================================
RCS file: /cvsroot/mplayer/main/dec_audio.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** dec_audio.c 2001/04/06 01:18:59 1.1
--- dec_audio.c 2001/04/06 16:31:18 1.2
***************
*** 1,3 ****
--- 1,186 ----
+ // FIXME: use codec.conf struct here!!!
+ int detect_audio_format(sh_audio_t *sh_audio){
+ int has_audio=0;
+ // Decide audio format:
+ switch(sh_audio->wf.wFormatTag){
+ case 0:
+ has_audio=0;break; // disable/no audio
+ case 6:
+ avi_header.audio_seekable=1;
+ has_audio=5;break; // aLaw
+ case 0x31:
+ case 0x32:
+ has_audio=6;break; // MS-GSM
+ case 0x50:
+ #ifdef DEFAULT_MPG123
+ case 0x55:
+ #endif
+ avi_header.audio_seekable=1;
+ has_audio=1;break; // MPEG
+ case 0x01:
+ avi_header.audio_seekable=1;
+ has_audio=2;break; // PCM
+ case 0x2000:
+ avi_header.audio_seekable=1;
+ has_audio=3;break; // AC3
+ default:
+ avi_header.audio_seekable=0;
+ has_audio=4; // Win32/ACM
+ }
+ if(has_audio==4){
+ if(!avi_header.audio_codec) avi_header.audio_codec=get_auds_codec_name(sh_audio);
+ if(avi_header.auds_guid) has_audio=7; // force DShow
+ if(!avi_header.audio_codec) has_audio=0; // unknown win32 codec
+ if(verbose) printf("win32 audio codec: '%s'\n",avi_header.audio_codec);
+ }
+ if(verbose) printf("detected audio format: %d\n",has_audio);
+ return has_audio;
+ }
+
+ int init_audio(sh_audio_t *sh_audio){
+ int has_audio=sh_audio->codec.driver;
+
+ sh_audio->samplesize=2;
+ sh_audio->pcm_bswap=0;
+ sh_audio->a_buffer_size=16384; // default size, maybe not enough for Win32/ACM
+
+ if(has_audio==4){
+ // Win32 ACM audio codec:
+ if(init_acm_audio_codec(sh_audio)){
+ sh_audio->channels=sh_audio->o_wf.nChannels;
+ sh_audio->samplerate=sh_audio->o_wf.nSamplesPerSec;
+ if(sh_audio->a_buffer_size<sh_audio->audio_out_minsize+OUTBURST)
+ sh_audio->a_buffer_size=sh_audio->audio_out_minsize+OUTBURST;
+ } else {
+ printf("Could not load/initialize Win32/ACM AUDIO codec (missing DLL file?)\n");
+ if((sh_audio->wf.wFormatTag)==0x55){
+ printf("Audio format is MP3 -> fallback to internal mp3lib/mpg123\n");
+ has_audio=1; // fallback to mp3lib
+ } else
+ has_audio=0; // nosound
+ }
+ }
+
+ if(has_audio==7){
+ #ifndef USE_DIRECTSHOW
+ printf("Compiled without DirectShow support -> force nosound :(\n");
+ has_audio=0;
+ #else
+ // Win32 DShow audio codec:
+ WAVEFORMATEX *in_fmt=&sh_audio->wf;
+ sh_audio->o_wf.nChannels=in_fmt->nChannels;
+ sh_audio->o_wf.nSamplesPerSec=in_fmt->nSamplesPerSec;
+ sh_audio->o_wf.nAvgBytesPerSec=2*sh_audio->o_wf.nSamplesPerSec*sh_audio->o_wf.nChannels;
+ sh_audio->o_wf.wFormatTag=WAVE_FORMAT_PCM;
+ sh_audio->o_wf.nBlockAlign=2*in_fmt->nChannels;
+ sh_audio->o_wf.wBitsPerSample=16;
+ sh_audio->o_wf.cbSize=0;
+
+ if(!DS_AudioDecoder_Open(avi_header.audio_codec,avi_header.auds_guid,in_fmt)){
+ sh_audio->channels=sh_audio->o_wf.nChannels;
+ sh_audio->samplerate=sh_audio->o_wf.nSamplesPerSec;
+
+ sh_audio->audio_in_minsize=2*sh_audio->o_wf.nBlockAlign;
+ if(sh_audio->audio_in_minsize<8192) sh_audio->audio_in_minsize=8192;
+ sh_audio->a_in_buffer_size=sh_audio->audio_in_minsize;
+ sh_audio->a_in_buffer=malloc(sh_audio->a_in_buffer_size);
+ sh_audio->a_in_buffer_len=0;
+
+ } else {
+ printf("ERROR: Could not load/initialize Win32/DirctShow AUDIO codec: %s\n",avi_header.audio_codec);
+ if((in_fmt->wFormatTag)==0x55){
+ printf("Audio format is MP3 -> fallback to internal mp3lib/mpg123\n");
+ has_audio=1; // fallback to mp3lib
+ } else
+ printf("Audio disabled! Try to upgrade your w32codec.zip package!!!\n");
+ has_audio=0; // nosound
+ }
+ #endif
+ }
+
+
+ // allocate audio out buffer:
+ sh_audio->a_buffer=malloc(sh_audio->a_buffer_size);
+ memset(sh_audio->a_buffer,0,sh_audio->a_buffer_size);
+ sh_audio->a_buffer_len=0;
+
+ if(has_audio==4){
+ int ret=acm_decode_audio(sh_audio,sh_audio->a_buffer,sh_audio->a_buffer_size);
+ if(ret<0){
+ printf("ACM error %d -> switching to nosound...\n",ret);
+ has_audio=0;
+ } else {
+ sh_audio->a_buffer_len=ret;
+ printf("ACM decoding test: %d bytes\n",ret);
+ }
+ }
+
+ if(has_audio==2){
+ // if(file_format==DEMUXER_TYPE_AVI){ // FIXME!!!!!!!
+ // AVI PCM Audio:
+ WAVEFORMATEX *h=&sh_audio->wf;
+ sh_audio->channels=h->nChannels;
+ sh_audio->samplerate=h->nSamplesPerSec;
+ sh_audio->samplesize=(h->wBitsPerSample+7)/8;
+ // } else {
+ // // DVD PCM audio:
+ // sh_audio->channels=2;
+ // sh_audio->samplerate=48000;
+ // sh_audio->pcm_bswap=1;
+ // }
+ } else
+ if(has_audio==3){
+ // Dolby AC3 audio:
+ ac3_config.fill_buffer_callback = ac3_fill_buffer;
+ ac3_config.num_output_ch = 2;
+ ac3_config.flags = 0;
+ #ifdef HAVE_MMX
+ ac3_config.flags |= AC3_MMX_ENABLE;
+ #endif
+ #ifdef HAVE_3DNOW
+ ac3_config.flags |= AC3_3DNOW_ENABLE;
+ #endif
+ ac3_init();
+ sh_audio->ac3_frame = ac3_decode_frame();
+ if(sh_audio->ac3_frame){
+ sh_audio->samplerate=sh_audio->ac3_frame->sampling_rate;
+ sh_audio->channels=2;
+ } else has_audio=0; // bad frame -> disable audio
+ } else
+ if(has_audio==5){
+ // aLaw audio codec:
+ Gen_aLaw_2_Signed(); // init table
+ sh_audio->channels=sh_audio->wf.nChannels;
+ sh_audio->samplerate=sh_audio->wf.nSamplesPerSec;
+ } else
+ if(has_audio==6){
+ // MS-GSM audio codec:
+ GSM_Init();
+ sh_audio->channels=sh_audio->wf.nChannels;
+ sh_audio->samplerate=sh_audio->wf.nSamplesPerSec;
+ }
+ // must be here for Win32->mp3lib fallbacks
+ if(has_audio==1){
+ // MPEG Audio:
+ MP3_Init();
+ MP3_samplerate=MP3_channels=0;
+ // printf("[\n");
+ sh_audio->a_buffer_len=MP3_DecodeFrame(sh_audio->a_buffer,-1);
+ // printf("]\n");
+ sh_audio->channels=2; // hack
+ sh_audio->samplerate=MP3_samplerate;
+ }
+
+ if(!sh_audio->channels || !sh_audio->samplerate){
+ printf("Unknown/missing audio format, using nosound\n");
+ has_audio=0;
+ }
+
+ sh_audio->o_bps=sh_audio->channels*sh_audio->samplerate*sh_audio->samplesize;
+
+ return has_audio;
+ }
+
// Audio decoding
***************
*** 7,11 ****
case 1: // MPEG layer 2 or 3
len=MP3_DecodeFrame(buf,-1);
! MP3_channels=2; // hack
break;
case 2: // PCM
--- 190,194 ----
case 1: // MPEG layer 2 or 3
len=MP3_DecodeFrame(buf,-1);
! sh_audio->channels=2; // hack
break;
case 2: // PCM
***************
*** 39,43 ****
if(demux_read_data(d_audio,buf,65)!=65) break; // EOF
XA_MSGSM_Decoder(buf,(unsigned short *) buf); // decodes 65 byte -> 320 short
! // XA_GSM_Decoder(buf,(unsigned short *) &a_buffer[a_buffer_len]); // decodes 33 byte -> 160 short
len+=2*320;
}
--- 222,226 ----
if(demux_read_data(d_audio,buf,65)!=65) break; // EOF
XA_MSGSM_Decoder(buf,(unsigned short *) buf); // decodes 65 byte -> 320 short
! // XA_GSM_Decoder(buf,(unsigned short *) &sh_audio->a_buffer[sh_audio->a_buffer_len]); // decodes 33 byte -> 160 short
len+=2*320;
}
***************
*** 49,53 ****
//printf("{2:%d}",avi_header.idx_pos);fflush(stdout);
if(sh_audio->ac3_frame){
! len = 256 * 6 *MP3_channels*MP3_bps;
memcpy(buf,sh_audio->ac3_frame->audio_data,len);
sh_audio->ac3_frame=NULL;
--- 232,236 ----
//printf("{2:%d}",avi_header.idx_pos);fflush(stdout);
if(sh_audio->ac3_frame){
! len = 256 * 6 *sh_audio->channels*sh_audio->samplesize;
memcpy(buf,sh_audio->ac3_frame->audio_data,len);
sh_audio->ac3_frame=NULL;
Index: dll_init.c
===================================================================
RCS file: /cvsroot/mplayer/main/dll_init.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** dll_init.c 2001/04/06 01:18:59 1.3
--- dll_init.c 2001/04/06 16:31:18 1.4
***************
*** 2,6 ****
// based on the avifile library [http://divx.euro.ru]
! int init_audio_codec(sh_audio_t *sh_audio){
HRESULT ret;
WAVEFORMATEX *in_fmt=&sh_audio->wf;
--- 2,6 ----
// based on the avifile library [http://divx.euro.ru]
! int init_acm_audio_codec(sh_audio_t *sh_audio){
HRESULT ret;
WAVEFORMATEX *in_fmt=&sh_audio->wf;
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -r1.36 -r1.37
*** mplayer.c 2001/04/06 01:18:59 1.36
--- mplayer.c 2001/04/06 16:31:18 1.37
***************
*** 187,190 ****
--- 187,191 ----
// video:
unsigned int bitrate;
+ //===== This stuff will be removed when codec.conf reader is finished! =====
// video codec info: (filled by codecs.c)
char *video_codec;
***************
*** 245,249 ****
//**************************************************************************//
! //int mp3_read(char *buf,int size){
int mplayer_audio_read(char *buf,int size){
int len;
--- 246,250 ----
//**************************************************************************//
! // MP3 decoder buffer callback:
int mplayer_audio_read(char *buf,int size){
int len;
***************
*** 252,255 ****
--- 253,257 ----
}
+ // AC3 decoder buffer callback:
static void ac3_fill_buffer(uint8_t **start,uint8_t **end){
int len=ds_get_packet(sh_audio->ds,(char**)start);
***************
*** 262,266 ****
#include "alaw.c"
-
#include "xa/xa_gsm.h"
--- 264,267 ----
***************
*** 723,759 ****
if(audio_format)
has_audio=audio_format; // override type
! else if(has_audio)
! switch(sh_audio->wf.wFormatTag){
! case 0:
! has_audio=0;break; // disable/no audio
! case 6:
! avi_header.audio_seekable=1;
! has_audio=5;break; // aLaw
! case 0x31:
! case 0x32:
! has_audio=6;break; // MS-GSM
! case 0x50:
! #ifdef DEFAULT_MPG123
! case 0x55:
! #endif
! avi_header.audio_seekable=1;
! has_audio=1;break; // MPEG
! case 0x01:
! avi_header.audio_seekable=1;
! has_audio=2;break; // PCM
! case 0x2000:
! avi_header.audio_seekable=1;
! has_audio=3;break; // AC3
! default:
! avi_header.audio_seekable=0;
! has_audio=4; // Win32/ACM
! }
! if(verbose) printf("detected AVI audio format: %d\n",has_audio);
! if(has_audio==4){
! if(!avi_header.audio_codec) avi_header.audio_codec=get_auds_codec_name(sh_audio);
! if(avi_header.auds_guid) has_audio=7; // force DShow
! if(!avi_header.audio_codec) has_audio=0; // unknown win32 codec
! if(verbose) printf("win32 audio codec: '%s'\n",avi_header.audio_codec);
! }
if(has_audio){
if(verbose) printf("AVI: Searching for audio stream (id:%d)\n",d_audio->id);
--- 724,728 ----
if(audio_format)
has_audio=audio_format; // override type
! else if(has_audio) has_audio=detect_audio_format(sh_audio);
if(has_audio){
if(verbose) printf("AVI: Searching for audio stream (id:%d)\n",d_audio->id);
***************
*** 791,827 ****
if(audio_format)
has_audio=audio_format; // override type
! else if(has_audio)
! switch(sh_audio->wf.wFormatTag){
! case 0:
! has_audio=0;break; // disable/no audio
! case 6:
! avi_header.audio_seekable=1;
! has_audio=5;break; // aLaw
! case 0x31:
! case 0x32:
! has_audio=6;break; // MS-GSM
! case 0x50:
! #ifdef DEFAULT_MPG123
! case 0x55:
! #endif
! avi_header.audio_seekable=1;
! has_audio=1;break; // MPEG
! case 0x01:
! avi_header.audio_seekable=1;
! has_audio=2;break; // PCM
! case 0x2000:
! avi_header.audio_seekable=1;
! has_audio=3;break; // AC3
! default:
! avi_header.audio_seekable=0;
! has_audio=4; // Win32/ACM
! }
! if(verbose) printf("detected ASF audio format: %d\n",has_audio);
! if(has_audio==4){
! if(!avi_header.audio_codec) avi_header.audio_codec=get_auds_codec_name(sh_audio);
! if(avi_header.auds_guid) has_audio=7; // force DShow
! if(!avi_header.audio_codec) has_audio=0; // unknown win32 codec
! if(verbose) printf("win32 audio codec: '%s'\n",avi_header.audio_codec);
! }
if(has_audio){
if(verbose) printf("ASF: Searching for audio stream (id:%d)\n",d_audio->id);
--- 760,764 ----
if(audio_format)
has_audio=audio_format; // override type
! else if(has_audio) has_audio=detect_audio_format(sh_audio);
if(has_audio){
if(verbose) printf("ASF: Searching for audio stream (id:%d)\n",d_audio->id);
***************
*** 1182,1188 ****
//================== MAIN: ==========================
{
- char* a_buffer=NULL;
- int a_buffer_len=0;
- int a_buffer_size=0;
int audio_fd=-1;
float buffer_delay=0;
--- 1119,1122 ----
***************
*** 1236,1376 ****
if(verbose) printf("Initializing audio codec...\n");
!
! MP3_bps=2;
! sh_audio->pcm_bswap=0;
! a_buffer_size=16384; // default size, maybe not enough for Win32/ACM
!
! if(has_audio==4){
! // Win32 ACM audio codec:
! if(init_audio_codec(sh_audio)){
! MP3_channels=sh_audio->o_wf.nChannels;
! MP3_samplerate=sh_audio->o_wf.nSamplesPerSec;
! if(a_buffer_size<sh_audio->audio_out_minsize+OUTBURST)
! a_buffer_size=sh_audio->audio_out_minsize+OUTBURST;
! } else {
! printf("Could not load/initialize Win32/ACM AUDIO codec (missing DLL file?)\n");
! if((sh_audio->wf.wFormatTag)==0x55){
! printf("Audio format is MP3 -> fallback to internal mp3lib/mpg123\n");
! has_audio=1; // fallback to mp3lib
! } else
! has_audio=0; // nosound
! }
! }
!
! if(has_audio==7){
! #ifndef USE_DIRECTSHOW
! printf("Compiled without DirectShow support -> force nosound :(\n");
! has_audio=0;
! #else
! // Win32 DShow audio codec:
! WAVEFORMATEX *in_fmt=&sh_audio->wf;
! sh_audio->o_wf.nChannels=in_fmt->nChannels;
! sh_audio->o_wf.nSamplesPerSec=in_fmt->nSamplesPerSec;
! sh_audio->o_wf.nAvgBytesPerSec=2*sh_audio->o_wf.nSamplesPerSec*sh_audio->o_wf.nChannels;
! sh_audio->o_wf.wFormatTag=WAVE_FORMAT_PCM;
! sh_audio->o_wf.nBlockAlign=2*in_fmt->nChannels;
! sh_audio->o_wf.wBitsPerSample=16;
! sh_audio->o_wf.cbSize=0;
!
! if(!DS_AudioDecoder_Open(avi_header.audio_codec,avi_header.auds_guid,in_fmt)){
! MP3_channels=sh_audio->o_wf.nChannels;
! MP3_samplerate=sh_audio->o_wf.nSamplesPerSec;
!
! sh_audio->audio_in_minsize=2*sh_audio->o_wf.nBlockAlign;
! if(sh_audio->audio_in_minsize<8192) sh_audio->audio_in_minsize=8192;
! sh_audio->a_in_buffer_size=sh_audio->audio_in_minsize;
! sh_audio->a_in_buffer=malloc(sh_audio->a_in_buffer_size);
! sh_audio->a_in_buffer_len=0;
!
! } else {
! printf("ERROR: Could not load/initialize Win32/DirctShow AUDIO codec: %s\n",avi_header.audio_codec);
! if((in_fmt->wFormatTag)==0x55){
! printf("Audio format is MP3 -> fallback to internal mp3lib/mpg123\n");
! has_audio=1; // fallback to mp3lib
! } else
! printf("Audio disabled! Try to upgrade your w32codec.zip package!!!\n");
! has_audio=0; // nosound
! }
! #endif
! }
!
!
! // allocate audio out buffer:
! a_buffer=malloc(a_buffer_size);
! memset(a_buffer,0,a_buffer_size);
! a_buffer_len=0;
!
! if(has_audio==4){
! int ret=acm_decode_audio(sh_audio,a_buffer,a_buffer_size);
! if(ret<0){
! printf("ACM error %d -> switching to nosound...\n",ret);
! has_audio=0;
! } else {
! a_buffer_len=ret;
! printf("ACM decoding test: %d bytes\n",ret);
! }
! }
! if(has_audio==2){
! if(file_format==DEMUXER_TYPE_AVI){
! // AVI PCM Audio:
! WAVEFORMATEX *h=&sh_audio->wf;
! MP3_channels=h->nChannels;
! MP3_samplerate=h->nSamplesPerSec;
! MP3_bps=(h->wBitsPerSample+7)/8;
! } else {
! // DVD PCM audio:
! MP3_channels=2;
! MP3_samplerate=48000;
! sh_audio->pcm_bswap=1;
! }
! } else
! if(has_audio==3){
! // Dolby AC3 audio:
! ac3_config.fill_buffer_callback = ac3_fill_buffer;
! ac3_config.num_output_ch = 2;
! ac3_config.flags = 0;
! #ifdef HAVE_MMX
! ac3_config.flags |= AC3_MMX_ENABLE;
! #endif
! #ifdef HAVE_3DNOW
! ac3_config.flags |= AC3_3DNOW_ENABLE;
! #endif
! ac3_init();
! sh_audio->ac3_frame = ac3_decode_frame();
! if(sh_audio->ac3_frame){
! MP3_samplerate=sh_audio->ac3_frame->sampling_rate;
! MP3_channels=2;
! } else has_audio=0; // bad frame -> disable audio
! } else
! if(has_audio==5){
! // aLaw audio codec:
! Gen_aLaw_2_Signed(); // init table
! MP3_channels=sh_audio->wf.nChannels;
! MP3_samplerate=sh_audio->wf.nSamplesPerSec;
! } else
! if(has_audio==6){
! // MS-GSM audio codec:
! GSM_Init();
! MP3_channels=sh_audio->wf.nChannels;
! MP3_samplerate=sh_audio->wf.nSamplesPerSec;
! }
! // must be here for Win32->mp3lib fallbacks
! if(has_audio==1){
! // MPEG Audio:
! MP3_Init();
! MP3_samplerate=MP3_channels=0;
! // printf("[\n");
! a_buffer_len=MP3_DecodeFrame(a_buffer,-1);
! // printf("]\n");
! MP3_channels=2; // hack
! }
!
! if(verbose) printf("Audio: type: %d samplerate=%d channels=%d bps=%d\n",has_audio,MP3_samplerate,MP3_channels,MP3_bps);
!
! if(!MP3_channels || !MP3_samplerate){
! printf("Unknown/missing audio format, using nosound\n");
! has_audio=0;
! }
if(has_audio){
--- 1170,1179 ----
if(verbose) printf("Initializing audio codec...\n");
!
! sh_audio->codec.driver=has_audio; // FIXME!
! has_audio=init_audio(sh_audio);
! sh_audio->codec.driver=has_audio; // FIXME!
! if(verbose) printf("Audio: type: %d samplerate=%d channels=%d bps=%d\n",has_audio,sh_audio->samplerate,sh_audio->channels,sh_audio->samplesize);
if(has_audio){
***************
*** 1380,1385 ****
if( xmm.cSound ){
pSound = xmm.cSound->Init( &xmm );
! if( pSound && pSound->Start( pSound, MP3_samplerate, MP3_channels,
! ( MP3_bps == 2 ) ? XMM_SOUND_FMT_S16LE : XMM_SOUND_FMT_U8 )){
printf("XMM: audio setup ok\n");
} else {
--- 1183,1188 ----
if( xmm.cSound ){
pSound = xmm.cSound->Init( &xmm );
! if( pSound && pSound->Start( pSound, sh_audio->samplerate, sh_audio->channels,
! ( sh_audio->samplesize == 2 ) ? XMM_SOUND_FMT_S16LE : XMM_SOUND_FMT_U8 )){
printf("XMM: audio setup ok\n");
} else {
***************
*** 1403,1413 ****
} else {
// -abs commandline option
! buffer_delay=audio_buffer_size/(float)(MP3_samplerate*MP3_channels*MP3_bps);
}
#else
int r;
! r=(MP3_bps==2)?AFMT_S16_LE:AFMT_U8;ioctl (audio_fd, SNDCTL_DSP_SETFMT, &r);
! r=MP3_channels-1; ioctl (audio_fd, SNDCTL_DSP_STEREO, &r);
! r=MP3_samplerate; if(ioctl (audio_fd, SNDCTL_DSP_SPEED, &r)==-1)
printf("audio_setup: your card doesn't support %d Hz samplerate\n",r);
--- 1206,1216 ----
} else {
// -abs commandline option
! buffer_delay=audio_buffer_size/(float)(sh_audio->o_bps);
}
#else
int r;
! r=(sh_audio->samplesize==2)?AFMT_S16_LE:AFMT_U8;ioctl (audio_fd, SNDCTL_DSP_SETFMT, &r);
! r=sh_audio->channels-1; ioctl (audio_fd, SNDCTL_DSP_STEREO, &r);
! r=sh_audio->samplerate; if(ioctl (audio_fd, SNDCTL_DSP_SPEED, &r)==-1)
printf("audio_setup: your card doesn't support %d Hz samplerate\n",r);
***************
*** 1429,1433 ****
tv.tv_sec=0; tv.tv_usec = 0;
if(!select(audio_fd+1, NULL, &rfds, NULL, &tv)) break;
! write(audio_fd,&a_buffer[a_buffer_len],OUTBURST);
audio_buffer_size+=OUTBURST;
}
--- 1232,1236 ----
tv.tv_sec=0; tv.tv_usec = 0;
if(!select(audio_fd+1, NULL, &rfds, NULL, &tv)) break;
! write(audio_fd,&sh_audio->a_buffer[sh_audio->a_buffer_len],OUTBURST);
audio_buffer_size+=OUTBURST;
}
***************
*** 1439,1443 ****
#endif
}
! buffer_delay=audio_buffer_size/(float)(MP3_samplerate*MP3_channels*MP3_bps);
#endif
a_frame=-(buffer_delay);
--- 1242,1246 ----
#endif
}
! buffer_delay=audio_buffer_size/(float)(sh_audio->o_bps);
#endif
a_frame=-(buffer_delay);
***************
*** 1448,1452 ****
if(has_audio){
! printf("Audio: type: %d samplerate: %d channels: %d bps: %d\n",has_audio,MP3_samplerate,MP3_channels,MP3_bps);
} else {
printf("Audio: no sound\n");
--- 1251,1255 ----
if(has_audio){
! printf("Audio: type: %d samplerate: %d channels: %d bps: %d\n",has_audio,sh_audio->samplerate,sh_audio->channels,sh_audio->samplesize);
} else {
printf("Audio: no sound\n");
***************
*** 1454,1459 ****
ds_free_packs(d_audio); // free buffered chunks
d_audio->id=-2; // do not read audio chunks
! if(a_buffer) free(a_buffer);
! alsa=1; MP3_samplerate=76800;MP3_bps=MP3_channels=2; // fake, required for timer
}
--- 1257,1266 ----
ds_free_packs(d_audio); // free buffered chunks
d_audio->id=-2; // do not read audio chunks
! if(sh_audio->a_buffer) free(sh_audio->a_buffer);
! alsa=1;
! // fake, required for timer:
! sh_audio->samplerate=76800;
! sh_audio->samplesize=sh_audio->channels=2;
! sh_audio->o_bps=sh_audio->channels*sh_audio->samplerate*sh_audio->samplesize;
}
***************
*** 1498,1504 ****
current_module="decode_audio"; // Enter AUDIO decoder module
sh_audio->codec.driver=has_audio; // FIXME!
! while(a_buffer_len<OUTBURST && !d_audio->eof){
! int ret=decode_audio(sh_audio,&a_buffer[a_buffer_len],a_buffer_size-a_buffer_len);
! if(ret>0) a_buffer_len+=ret; else break;
}
current_module=NULL; // Leave AUDIO decoder module
--- 1305,1311 ----
current_module="decode_audio"; // Enter AUDIO decoder module
sh_audio->codec.driver=has_audio; // FIXME!
! while(sh_audio->a_buffer_len<OUTBURST && !d_audio->eof){
! int ret=decode_audio(sh_audio,&sh_audio->a_buffer[sh_audio->a_buffer_len],sh_audio->a_buffer_size-sh_audio->a_buffer_len);
! if(ret>0) sh_audio->a_buffer_len+=ret; else break;
}
current_module=NULL; // Leave AUDIO decoder module
***************
*** 1507,1522 ****
// Play sound from the buffer:
! if(a_buffer_len>=OUTBURST){ // if not EOF
#ifdef USE_XMMP_AUDIO
! pSound->Write( pSound, a_buffer, OUTBURST );
#else
#ifdef SIMULATE_ALSA
! fake_ALSA_write(audio_fd,a_buffer,OUTBURST); // for testing purposes
#else
! write(audio_fd,a_buffer,OUTBURST);
#endif
#endif
! a_buffer_len-=OUTBURST;
! memcpy(a_buffer,&a_buffer[OUTBURST],a_buffer_len);
#ifndef USE_XMMP_AUDIO
#ifndef SIMULATE_ALSA
--- 1314,1329 ----
// Play sound from the buffer:
! if(sh_audio->a_buffer_len>=OUTBURST){ // if not EOF
#ifdef USE_XMMP_AUDIO
! pSound->Write( pSound, sh_audio->a_buffer, OUTBURST );
#else
#ifdef SIMULATE_ALSA
! fake_ALSA_write(audio_fd,sh_audio->a_buffer,OUTBURST); // for testing purposes
#else
! write(audio_fd,sh_audio->a_buffer,OUTBURST);
#endif
#endif
! sh_audio->a_buffer_len-=OUTBURST;
! memcpy(sh_audio->a_buffer,&sh_audio->a_buffer[OUTBURST],sh_audio->a_buffer_len);
#ifndef USE_XMMP_AUDIO
#ifndef SIMULATE_ALSA
***************
*** 1530,1535 ****
tv.tv_usec = 0;
if(select(audio_fd+1, NULL, &rfds, NULL, &tv)){
! a_frame+=OUTBURST/(float)(MP3_samplerate*MP3_channels*MP3_bps);
! a_pts+=OUTBURST/(float)(MP3_samplerate*MP3_channels*MP3_bps);
// printf("Filling audio buffer...\n");
continue;
--- 1337,1342 ----
tv.tv_usec = 0;
if(select(audio_fd+1, NULL, &rfds, NULL, &tv)){
! a_frame+=OUTBURST/(float)(sh_audio->o_bps);
! a_pts+=OUTBURST/(float)(sh_audio->o_bps);
// printf("Filling audio buffer...\n");
continue;
***************
*** 1548,1557 ****
/*========================== UPDATE TIMERS ============================*/
! a_frame+=OUTBURST/(float)(MP3_samplerate*MP3_channels*MP3_bps);
! a_pts+=OUTBURST/(float)(MP3_samplerate*MP3_channels*MP3_bps);
if(alsa){
// Use system timer for sync, not audio card/driver
! time_frame+=OUTBURST/(float)(MP3_samplerate*MP3_channels*MP3_bps);
time_frame-=GetRelativeTime();
// printf("time_frame=%5.3f\n",time_frame);
--- 1355,1364 ----
/*========================== UPDATE TIMERS ============================*/
! a_frame+=OUTBURST/(float)(sh_audio->o_bps);
! a_pts+=OUTBURST/(float)(sh_audio->o_bps);
if(alsa){
// Use system timer for sync, not audio card/driver
! time_frame+=OUTBURST/(float)(sh_audio->o_bps);
time_frame-=GetRelativeTime();
// printf("time_frame=%5.3f\n",time_frame);
***************
*** 2014,2019 ****
ds_free_packs(d_video);
! // printf("a_buffer_len=%d \n",a_buffer_len);
! a_buffer_len=0;
switch(file_format){
--- 1821,1826 ----
ds_free_packs(d_video);
! // printf("sh_audio->a_buffer_len=%d \n",sh_audio->a_buffer_len);
! sh_audio->a_buffer_len=0;
switch(file_format){
Index: stheader.h
===================================================================
RCS file: /cvsroot/mplayer/main/stheader.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** stheader.h 2001/04/06 01:18:59 1.1
--- stheader.h 2001/04/06 16:31:18 1.2
***************
*** 14,21 ****
int channels;
int o_bps; // == samplerate*samplesize*channels
! // buffers:
char* a_in_buffer;
int a_in_buffer_len;
int a_in_buffer_size;
// win32 codec stuff:
AVIStreamHeader audio;
--- 14,25 ----
int channels;
int o_bps; // == samplerate*samplesize*channels
! // in buffers:
char* a_in_buffer;
int a_in_buffer_len;
int a_in_buffer_size;
+ // out buffers:
+ char* a_buffer;
+ int a_buffer_len;
+ int a_buffer_size;
// win32 codec stuff:
AVIStreamHeader audio;
_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog(a)lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog
1
0
Update of /cvsroot/mplayer/main/loader
In directory usw-pr-cvs1:/tmp/cvs-serv4233
Modified Files:
win32.c
Log Message:
added expRegEnumValueA(), fixed expWaitForSingleObject()
Index: win32.c
===================================================================
RCS file: /cvsroot/mplayer/main/loader/win32.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** win32.c 2001/03/28 21:43:21 1.5
--- win32.c 2001/04/06 16:29:55 1.6
***************
*** 585,589 ****
{
mutex_list *ml = (mutex_list *)object;
! int ret;
mutex_list* pp=mlist;
// dbgprintf("WaitForSingleObject(0x%x, duration %d) =>\n",object, duration);
--- 585,589 ----
{
mutex_list *ml = (mutex_list *)object;
! int ret=0x12345678; // fixed by Zdenek Kabelac
mutex_list* pp=mlist;
// dbgprintf("WaitForSingleObject(0x%x, duration %d) =>\n",object, duration);
***************
*** 2335,2343 ****
!
!
!
!
--- 2335,2351 ----
! /******************************************************************************
! * RegEnumValueA [ADVAPI32.@]
! */
! DWORD WINAPI expRegEnumValueA( HKEY hkey, DWORD index, LPSTR value, LPDWORD val_count,
! LPDWORD reserved, LPDWORD type, LPBYTE data, LPDWORD count )
! {
!
! printf("RegEnumValueA(%x,%ld,%p,%p,%p,%p,%p,%p)\n",
! hkey, index, value, val_count, reserved, type, data, count );
+ return -1;
+ }
+
***************
*** 2512,2515 ****
--- 2520,2524 ----
FF(RegSetValueExA, -1)
FF(RegCloseKey, -1)
+ //FF(RegEnumValueA, -1)
};
struct exports exp_gdi32[]={
_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog(a)lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog
1
0
Update of /cvsroot/mplayer/main/DOCS/Spanish
In directory usw-pr-cvs1:/tmp/cvs-serv3873
Modified Files:
tech
Log Message:
It's obsolete, in spite it's up to date X"DD
Index: tech
===================================================================
RCS file: /cvsroot/mplayer/main/DOCS/Spanish/tech,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** tech 2001/03/18 21:56:19 1.4
--- tech 2001/04/06 11:24:02 1.5
***************
*** 1,2 ****
--- 1,3 ----
+ [Ligeramente OBSOLETO]
Bien, voy a describir como funciona todo esto.
_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog(a)lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog
1
0
Update of /cvsroot/mplayer/main/libvo
In directory usw-pr-cvs1:/tmp/cvs-serv23426
Modified Files:
vo_svga.c
Log Message:
Some bugfix.
Index: vo_svga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_svga.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** vo_svga.c 2001/04/06 10:25:47 1.5
--- vo_svga.c 2001/04/06 10:30:29 1.6
***************
*** 153,157 ****
printf("SVGAlib resolution: %dx%d %dbpp - ", WIDTH, HEIGHT, bpp);
! if (maxw != orig_w || maxh != orig_h) printf("Video scaled to: %dx%d %f.2\n",maxw,maxh,scaling);
else printf("No video scaling\n");
--- 153,157 ----
printf("SVGAlib resolution: %dx%d %dbpp - ", WIDTH, HEIGHT, bpp);
! if (maxw != orig_w || maxh != orig_h) printf("Video scaled to: %dx%d\n",maxw,maxh);
else printf("No video scaling\n");
_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog(a)lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog
1
0
Update of /cvsroot/mplayer/main/libvo
In directory usw-pr-cvs1:/tmp/cvs-serv22361/libvo
Modified Files:
vo_svga.c
Log Message:
Some bugfix.
Index: vo_svga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_svga.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** vo_svga.c 2001/04/05 20:42:24 1.4
--- vo_svga.c 2001/04/06 10:25:47 1.5
***************
*** 1,4 ****
/*
! Video driver for SVGAlib - alpha version
by Zoltan Mark Vician <se7en(a)sch.bme.hu>
Code started: Mon Apr 1 23:25:47 2000
--- 1,4 ----
/*
! Video driver for SVGAlib - alpha, slow
by Zoltan Mark Vician <se7en(a)sch.bme.hu>
Code started: Mon Apr 1 23:25:47 2000
***************
*** 76,85 ****
uint32_t d_height, uint32_t fullscreen, char *title,
uint32_t format) {
! static uint8_t bpp;
if (!checked) {
checksupportedmodes(); // Looking for available video modes
}
pformat = format;
! if(format==IMGFMT_YV12) bpp=32; else bpp=format&255;
if (d_width > 800)
switch (bpp) {
--- 76,87 ----
uint32_t d_height, uint32_t fullscreen, char *title,
uint32_t format) {
! static uint8_t bpp;
!
if (!checked) {
checksupportedmodes(); // Looking for available video modes
}
pformat = format;
! if (format == IMGFMT_YV12) bpp = 32;
! else bpp = format & 255;
if (d_width > 800)
switch (bpp) {
***************
*** 126,133 ****
orig_h = height;
if (fullscreen && (WIDTH != orig_w)) {
! maxw = WIDTH;
! scaling = maxw / (orig_w*1.0);
! maxh = (uint32_t) (orig_h * scaling);
! scalebuf = malloc(maxw * maxh * BYTESPERPIXEL);
} else {
maxw = orig_w;
--- 128,142 ----
orig_h = height;
if (fullscreen && (WIDTH != orig_w)) {
! if (((orig_w*1.0) / orig_h) < (4.0/3)) {
! maxh = HEIGHT;
! scaling = maxh / (orig_h * 1.0);
! maxw = (uint32_t) (orig_w * scaling);
! scalebuf = malloc(maxw * maxh * BYTESPERPIXEL);
! } else {
! maxw = WIDTH;
! scaling = maxw / (orig_w * 1.0);
! maxh = (uint32_t) (orig_h * scaling);
! scalebuf = malloc(maxw * maxh * BYTESPERPIXEL);
! }
} else {
maxw = orig_w;
***************
*** 143,148 ****
}
! printf("SVGAlib resolution: %dx%d %dbpp - ",WIDTH,HEIGHT,bpp);
! if (maxw != orig_w || maxh != orig_h) printf("Video scaled to: %dx%d\n",maxw,maxh);
else printf("No video scaling\n");
--- 152,157 ----
}
! printf("SVGAlib resolution: %dx%d %dbpp - ", WIDTH, HEIGHT, bpp);
! if (maxw != orig_w || maxh != orig_h) printf("Video scaled to: %dx%d %f.2\n",maxw,maxh,scaling);
else printf("No video scaling\n");
***************
*** 226,231 ****
static void flip_page(void) {
! gl_fillbox(0, 0, WIDTH, y_pos, 0);
! gl_fillbox(0, HEIGHT - y_pos, WIDTH, y_pos, 0);
vo_draw_text(WIDTH, HEIGHT, draw_alpha);
gl_copyscreen(screen);
--- 235,245 ----
static void flip_page(void) {
! if (y_pos) {
! gl_fillbox(0, 0, WIDTH, y_pos, 0);
! gl_fillbox(0, HEIGHT - y_pos, WIDTH, y_pos, 0);
! } else {
! gl_fillbox(0, 0, x_pos, HEIGHT, 0);
! gl_fillbox(WIDTH - x_pos, 0, x_pos, HEIGHT, 0);
! }
vo_draw_text(WIDTH, HEIGHT, draw_alpha);
gl_copyscreen(screen);
_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog(a)lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog
1
0
CVS: main dec_audio.c,NONE,1.1 stheader.h,NONE,1.1 asfheader.c,1.2,1.3 aviheader.c,1.1.1.1,1.2 codecs.c,1.9,1.10 demux_avi.c,1.2,1.3 demuxer.c,1.1.1.1,1.2 dll_init.c,1.2,1.3 mplayer.c,1.35,1.36
by GEREOFFY 05 Apr '01
by GEREOFFY 05 Apr '01
05 Apr '01
Update of /cvsroot/mplayer/main
In directory usw-pr-cvs1:/tmp/cvs-serv10949
Modified Files:
asfheader.c aviheader.c codecs.c demux_avi.c demuxer.c
dll_init.c mplayer.c
Added Files:
dec_audio.c stheader.h
Log Message:
sh_audio/sh_video added, general codec cleanup
--- NEW FILE ---
// Audio decoding
int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int maxlen){
int len=-1;
switch(sh_audio->codec.driver){
case 1: // MPEG layer 2 or 3
len=MP3_DecodeFrame(buf,-1);
MP3_channels=2; // hack
break;
case 2: // PCM
{ len=demux_read_data(sh_audio->ds,buf,OUTBURST);
if(sh_audio->pcm_bswap){
int j;
//if(i&1){ printf("Warning! pcm_audio_size&1 !=0 (%d)\n",i);i&=~1; }
for(j=0;j<len;j+=2){
char x=buf[j];
buf[j]=buf[j+1];
buf[j+1]=x;
}
}
break;
}
case 5: // aLaw decoder
{ int l=demux_read_data(sh_audio->ds,buf,OUTBURST/2);
unsigned short *d=(unsigned short *) buf;
unsigned char *s=buf;
len=2*l;
while(l>0){
--l;
d[l]=xa_alaw_2_sign[s[l]];
}
break;
}
case 6: // MS-GSM decoder
{ unsigned char buf[65]; // 65 bytes / frame
len=0;
while(len<OUTBURST){
if(demux_read_data(d_audio,buf,65)!=65) break; // EOF
XA_MSGSM_Decoder(buf,(unsigned short *) buf); // decodes 65 byte -> 320 short
// XA_GSM_Decoder(buf,(unsigned short *) &a_buffer[a_buffer_len]); // decodes 33 byte -> 160 short
len+=2*320;
}
break;
}
case 3: // AC3 decoder
//printf("{1:%d}",avi_header.idx_pos);fflush(stdout);
if(!sh_audio->ac3_frame) sh_audio->ac3_frame=ac3_decode_frame();
//printf("{2:%d}",avi_header.idx_pos);fflush(stdout);
if(sh_audio->ac3_frame){
len = 256 * 6 *MP3_channels*MP3_bps;
memcpy(buf,sh_audio->ac3_frame->audio_data,len);
sh_audio->ac3_frame=NULL;
}
//printf("{3:%d}",avi_header.idx_pos);fflush(stdout);
break;
case 4:
{ len=acm_decode_audio(sh_audio,buf,maxlen);
break;
}
#ifdef USE_DIRECTSHOW
case 7: // DirectShow
{ int ret;
int size_in=0;
int size_out=0;
int srcsize=DS_AudioDecoder_GetSrcSize(maxlen);
if(verbose>2)printf("DShow says: srcsize=%d (buffsize=%d) out_size=%d\n",srcsize,sh_audio->a_in_buffer_size,maxlen);
if(srcsize>sh_audio->a_in_buffer_size) srcsize=sh_audio->a_in_buffer_size; // !!!!!!
if(sh_audio->a_in_buffer_len<srcsize){
sh_audio->a_in_buffer_len+=
demux_read_data(sh_audio->ds,&sh_audio->a_in_buffer[sh_audio->a_in_buffer_len],
srcsize-sh_audio->a_in_buffer_len);
}
DS_AudioDecoder_Convert(sh_audio->a_in_buffer,sh_audio->a_in_buffer_len,
buf,maxlen, &size_in,&size_out);
if(verbose>2)printf("DShow: audio %d -> %d converted (in_buf_len=%d of %d)\n",size_in,size_out,sh_audio->a_in_buffer_len,sh_audio->a_in_buffer_size);
if(size_in>=sh_audio->a_in_buffer_len){
sh_audio->a_in_buffer_len=0;
} else {
sh_audio->a_in_buffer_len-=size_in;
memcpy(sh_audio->a_in_buffer,&sh_audio->a_in_buffer[size_in],sh_audio->a_in_buffer_len);
}
len=size_out;
break;
}
#endif
}
return len;
}
--- NEW FILE ---
// Stream headers:
typedef struct {
int driver;
// codec descriptor from codec.conf
} codecinfo_t;
typedef struct {
demux_stream_t *ds;
codecinfo_t codec;
// output format:
int samplerate;
int samplesize;
int channels;
int o_bps; // == samplerate*samplesize*channels
// buffers:
char* a_in_buffer;
int a_in_buffer_len;
int a_in_buffer_size;
// win32 codec stuff:
AVIStreamHeader audio;
WAVEFORMATEX wf;
char wf_ext[64]; // in format
WAVEFORMATEX o_wf; // out format
HACMSTREAM srcstream; // handle
int audio_in_minsize;
int audio_out_minsize;
// other codecs:
ac3_frame_t *ac3_frame;
int pcm_bswap;
} sh_audio_t;
typedef struct {
demux_stream_t *ds;
codecinfo_t codec;
// output format:
float fps;
float frametime; // 1/fps
unsigned int outfmt;
// unsigned int bitrate;
// buffers:
char *our_out_buffer;
// win32 codec stuff:
AVIStreamHeader video;
BITMAPINFOHEADER bih; // in format
BITMAPINFOHEADER o_bih; // out format
HIC hic; // handle
} sh_video_t;
Index: asfheader.c
===================================================================
RCS file: /cvsroot/mplayer/main/asfheader.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** asfheader.c 2001/03/15 19:38:34 1.2
--- asfheader.c 2001/04/06 01:18:59 1.3
***************
*** 126,131 ****
stream_read(demuxer->stream,(char*) buffer,streamh.type_size);
switch(*((unsigned int*)&streamh.type)){
! case 0xF8699E40: // guid_audio_stream
! memcpy(avi_header.wf_ext,buffer,streamh.type_size<64?streamh.type_size:64);
if(verbose>=1) print_wave_header((WAVEFORMATEX*)buffer);
if((*((unsigned int*)&streamh.concealment))==0xbfc3cd50){
--- 126,132 ----
stream_read(demuxer->stream,(char*) buffer,streamh.type_size);
switch(*((unsigned int*)&streamh.type)){
! case 0xF8699E40: { // guid_audio_stream
! sh_audio_t *sh_audio=&sh_audio_i; // FIXME!
! memcpy(&sh_audio->wf,buffer,streamh.type_size<64?streamh.type_size:64);
if(verbose>=1) print_wave_header((WAVEFORMATEX*)buffer);
if((*((unsigned int*)&streamh.concealment))==0xbfc3cd50){
***************
*** 141,150 ****
if(demuxer->audio->id==-1) demuxer->audio->id=streamh.stream_no & 0x7F;
break;
! case 0xBC19EFC0: // guid_video_stream
! memcpy(&avi_header.bih,&buffer[4+4+1+2],sizeof(BITMAPINFOHEADER));
if(verbose>=1) print_video_header((BITMAPINFOHEADER*)&buffer[4+4+1+2]);
//asf_video_id=streamh.stream_no & 0x7F;
! if(demuxer->video->id==-1) demuxer->video->id=streamh.stream_no & 0x7F;
break;
}
// stream-specific data:
--- 142,156 ----
if(demuxer->audio->id==-1) demuxer->audio->id=streamh.stream_no & 0x7F;
break;
! }
! case 0xBC19EFC0: { // guid_video_stream
! sh_video_t *sh_video=&sh_video_i; // FIXME!
! memcpy(&sh_video->bih,&buffer[4+4+1+2],sizeof(BITMAPINFOHEADER));
! sh_video->fps=(float)sh_video->video.dwRate/(float)sh_video->video.dwScale;
! sh_video->frametime=(float)sh_video->video.dwScale/(float)sh_video->video.dwRate;
if(verbose>=1) print_video_header((BITMAPINFOHEADER*)&buffer[4+4+1+2]);
//asf_video_id=streamh.stream_no & 0x7F;
! if(demuxer->video->id==-1) demuxer->video->id=streamh.stream_no & 0x7F;
break;
+ }
}
// stream-specific data:
Index: aviheader.c
===================================================================
RCS file: /cvsroot/mplayer/main/aviheader.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** aviheader.c 2001/02/24 20:28:23 1.1.1.1
--- aviheader.c 2001/04/06 01:18:59 1.2
***************
*** 42,47 ****
stream_read(demuxer->stream,(char*) &h,MIN(size2,sizeof(h)));
chunksize-=MIN(size2,sizeof(h));
! if(h.fccType==streamtypeVIDEO) memcpy(&avi_header.video,&h,sizeof(h));else
! if(h.fccType==streamtypeAUDIO) memcpy(&avi_header.audio,&h,sizeof(h));
last_fccType=h.fccType;
if(verbose>=1) print_strh(&h);
--- 42,47 ----
stream_read(demuxer->stream,(char*) &h,MIN(size2,sizeof(h)));
chunksize-=MIN(size2,sizeof(h));
! if(h.fccType==streamtypeVIDEO) memcpy(&sh_video_i.video,&h,sizeof(h));else
! if(h.fccType==streamtypeAUDIO) memcpy(&sh_audio_i.audio,&h,sizeof(h));
last_fccType=h.fccType;
if(verbose>=1) print_strh(&h);
***************
*** 50,67 ****
case ckidSTREAMFORMAT: { // read 'strf'
if(last_fccType==streamtypeVIDEO){
! stream_read(demuxer->stream,(char*) &avi_header.bih,MIN(size2,sizeof(avi_header.bih)));
! chunksize-=MIN(size2,sizeof(avi_header.bih));
! // init_video_codec();
! // init_video_out();
if(demuxer->video->id==-1) demuxer->video->id=stream_id;
} else
if(last_fccType==streamtypeAUDIO){
int z=(chunksize<64)?chunksize:64;
if(verbose>=2) printf("found 'wf', %d bytes of %d\n",chunksize,sizeof(WAVEFORMATEX));
! stream_read(demuxer->stream,(char*) &avi_header.wf_ext,z);
chunksize-=z;
! if(verbose>=1) print_wave_header((WAVEFORMATEX*)&avi_header.wf_ext);
! // init_audio_codec();
! // init_audio_out();
if(demuxer->audio->id==-1) demuxer->audio->id=stream_id;
}
--- 50,67 ----
case ckidSTREAMFORMAT: { // read 'strf'
if(last_fccType==streamtypeVIDEO){
! sh_video_t *sh_video=&sh_video_i; // FIXME!
! stream_read(demuxer->stream,(char*) &sh_video->bih,MIN(size2,sizeof(sh_video->bih)));
! chunksize-=MIN(size2,sizeof(sh_video->bih));
! sh_video->fps=(float)sh_video->video.dwRate/(float)sh_video->video.dwScale;
! sh_video->frametime=(float)sh_video->video.dwScale/(float)sh_video->video.dwRate;
if(demuxer->video->id==-1) demuxer->video->id=stream_id;
} else
if(last_fccType==streamtypeAUDIO){
+ sh_audio_t *sh_audio=&sh_audio_i; // FIXME!
int z=(chunksize<64)?chunksize:64;
if(verbose>=2) printf("found 'wf', %d bytes of %d\n",chunksize,sizeof(WAVEFORMATEX));
! stream_read(demuxer->stream,(char*) &sh_audio->wf,z);
chunksize-=z;
! if(verbose>=1) print_wave_header(&sh_audio->wf);
if(demuxer->audio->id==-1) demuxer->audio->id=stream_id;
}
Index: codecs.c
===================================================================
RCS file: /cvsroot/mplayer/main/codecs.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** codecs.c 2001/04/01 19:42:41 1.9
--- codecs.c 2001/04/06 01:18:59 1.10
***************
*** 22,28 ****
! char* get_vids_codec_name(){
// unsigned long fccHandler=avi_header.video.fccHandler;
! unsigned long fccHandler=avi_header.bih.biCompression;
avi_header.yuv_supported=0;
avi_header.yuv_hack_needed=0;
--- 22,28 ----
! char* get_vids_codec_name(sh_video_t *sh){
// unsigned long fccHandler=avi_header.video.fccHandler;
! unsigned long fccHandler=sh->bih.biCompression;
avi_header.yuv_supported=0;
avi_header.yuv_hack_needed=0;
***************
*** 48,52 ****
case mmioFOURCC('m', 'p', '4', '3'):
printf("Video in MPEG-4 v3 (really DivX) format\n");
! avi_header.bih.biCompression=mmioFOURCC('d', 'i', 'v', '3'); // hack
avi_header.yuv_supported=1;
#ifdef USE_DIRECTSHOW
--- 48,52 ----
case mmioFOURCC('m', 'p', '4', '3'):
printf("Video in MPEG-4 v3 (really DivX) format\n");
! sh->bih.biCompression=mmioFOURCC('d', 'i', 'v', '3'); // hack
avi_header.yuv_supported=1;
#ifdef USE_DIRECTSHOW
***************
*** 70,74 ****
case mmioFOURCC('D', 'I', 'V', '6'):
case mmioFOURCC('d', 'i', 'v', '6'):
! avi_header.bih.biCompression-=0x02000000; // div5->div3, div6->div4
case mmioFOURCC('D', 'I', 'V', '3'):
case mmioFOURCC('d', 'i', 'v', '3'):
--- 70,74 ----
case mmioFOURCC('D', 'I', 'V', '6'):
case mmioFOURCC('d', 'i', 'v', '6'):
! sh->bih.biCompression-=0x02000000; // div5->div3, div6->div4
case mmioFOURCC('D', 'I', 'V', '3'):
case mmioFOURCC('d', 'i', 'v', '3'):
***************
*** 196,201 ****
}
! char* get_auds_codec_name(){
! int id=((WAVEFORMATEX*)avi_header.wf_ext)->wFormatTag;
avi_header.auds_guid=NULL;
switch (id){
--- 196,201 ----
}
! char* get_auds_codec_name(sh_audio_t *sh){
! int id=sh->wf.wFormatTag;
avi_header.auds_guid=NULL;
switch (id){
Index: demux_avi.c
===================================================================
RCS file: /cvsroot/mplayer/main/demux_avi.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** demux_avi.c 2001/03/15 19:38:34 1.2
--- demux_avi.c 2001/04/06 01:18:59 1.3
***************
*** 49,53 ****
// ezt a 2 sort lehet hogy fell kell majd cserelni:
//avi_video_pts+=avi_pts_frametime;
! avi_video_pts+=(float)avi_header.video.dwScale/(float)avi_header.video.dwRate;
avi_audio_pts=avi_video_pts;
}
--- 49,55 ----
// ezt a 2 sort lehet hogy fell kell majd cserelni:
//avi_video_pts+=avi_pts_frametime;
! //avi_video_pts+=(float)avi_header.video.dwScale/(float)avi_header.video.dwRate;
! //avi_video_pts+=((sh_video_t*)ds->sh)->frametime;
! avi_video_pts+=(float)((sh_video_t*)(demux->video->sh))->video.dwScale/(float)((sh_video_t*)(demux->video->sh))->video.dwRate;
avi_audio_pts=avi_video_pts;
}
Index: demuxer.c
===================================================================
RCS file: /cvsroot/mplayer/main/demuxer.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** demuxer.c 2001/02/24 20:28:35 1.1.1.1
--- demuxer.c 2001/04/06 01:18:59 1.2
***************
*** 46,49 ****
--- 46,51 ----
demux_packet_t *asf_packet; // read asf fragments here
int asf_seq;
+ // ---- stream header ----
+ void* sh;
} demux_stream_t;
***************
*** 66,69 ****
--- 68,73 ----
ds->asf_seq=-1;
ds->asf_packet=NULL;
+ //----------------
+ ds->sh=NULL;
return ds;
}
Index: dll_init.c
===================================================================
RCS file: /cvsroot/mplayer/main/dll_init.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** dll_init.c 2001/03/12 01:09:35 1.2
--- dll_init.c 2001/04/06 01:18:59 1.3
***************
*** 2,32 ****
// based on the avifile library [http://divx.euro.ru]
! static char* a_in_buffer=NULL;
! static int a_in_buffer_len=0;
! static int a_in_buffer_size=0;
!
! int init_audio_codec(){
HRESULT ret;
! WAVEFORMATEX *in_fmt=(WAVEFORMATEX*)&avi_header.wf_ext;
unsigned long srcsize=0;
if(verbose) printf("======= Win32 (ACM) AUDIO Codec init =======\n");
! avi_header.srcstream=NULL;
// if(in_fmt->nSamplesPerSec==0){ printf("Bad WAVE header!\n");exit(1); }
// MSACM_RegisterAllDrivers();
! avi_header.wf.nChannels=in_fmt->nChannels;
! avi_header.wf.nSamplesPerSec=in_fmt->nSamplesPerSec;
! avi_header.wf.nAvgBytesPerSec=2*avi_header.wf.nSamplesPerSec*avi_header.wf.nChannels;
! avi_header.wf.wFormatTag=WAVE_FORMAT_PCM;
! avi_header.wf.nBlockAlign=2*in_fmt->nChannels;
! avi_header.wf.wBitsPerSample=16;
! avi_header.wf.cbSize=0;
win32_codec_name = avi_header.audio_codec;
! ret=acmStreamOpen(&avi_header.srcstream,(HACMDRIVER)NULL,
! in_fmt,&avi_header.wf,
NULL,0,0,0);
if(ret){
--- 2,28 ----
// based on the avifile library [http://divx.euro.ru]
! int init_audio_codec(sh_audio_t *sh_audio){
HRESULT ret;
! WAVEFORMATEX *in_fmt=&sh_audio->wf;
unsigned long srcsize=0;
if(verbose) printf("======= Win32 (ACM) AUDIO Codec init =======\n");
! sh_audio->srcstream=NULL;
// if(in_fmt->nSamplesPerSec==0){ printf("Bad WAVE header!\n");exit(1); }
// MSACM_RegisterAllDrivers();
! sh_audio->o_wf.nChannels=in_fmt->nChannels;
! sh_audio->o_wf.nSamplesPerSec=in_fmt->nSamplesPerSec;
! sh_audio->o_wf.nAvgBytesPerSec=2*sh_audio->o_wf.nSamplesPerSec*sh_audio->o_wf.nChannels;
! sh_audio->o_wf.wFormatTag=WAVE_FORMAT_PCM;
! sh_audio->o_wf.nBlockAlign=2*in_fmt->nChannels;
! sh_audio->o_wf.wBitsPerSample=16;
! sh_audio->o_wf.cbSize=0;
win32_codec_name = avi_header.audio_codec;
! ret=acmStreamOpen(&sh_audio->srcstream,(HACMDRIVER)NULL,
! in_fmt,&sh_audio->o_wf,
NULL,0,0,0);
if(ret){
***************
*** 35,39 ****
else
printf("ACM_Decoder: acmStreamOpen error %d", ret);
! avi_header.srcstream=NULL;
return 0;
}
--- 31,35 ----
else
printf("ACM_Decoder: acmStreamOpen error %d", ret);
! sh_audio->srcstream=NULL;
return 0;
}
***************
*** 41,72 ****
srcsize=in_fmt->nBlockAlign;
! acmStreamSize(avi_header.srcstream, srcsize, &srcsize, ACM_STREAMSIZEF_SOURCE);
if(srcsize<OUTBURST) srcsize=OUTBURST;
! avi_header.audio_out_minsize=srcsize; // audio output min. size
if(verbose) printf("Audio ACM output buffer min. size: %d\n",srcsize);
! acmStreamSize(avi_header.srcstream, srcsize, &srcsize, ACM_STREAMSIZEF_DESTINATION);
! avi_header.audio_in_minsize=srcsize; // audio input min. size
if(verbose) printf("Audio ACM input buffer min. size: %d\n",srcsize);
! a_in_buffer_size=avi_header.audio_in_minsize;
! a_in_buffer=malloc(a_in_buffer_size);
! a_in_buffer_len=0;
return 1;
}
! int acm_decode_audio(void* a_buffer,int len){
ACMSTREAMHEADER ash;
HRESULT hr;
DWORD srcsize=0;
! acmStreamSize(avi_header.srcstream,len , &srcsize, ACM_STREAMSIZEF_DESTINATION);
! if(verbose>=3)printf("acm says: srcsize=%d (buffsize=%d) out_size=%d\n",srcsize,a_in_buffer_size,len);
! // if(srcsize==0) srcsize=((WAVEFORMATEX *)&avi_header.wf_ext)->nBlockAlign;
! if(srcsize>a_in_buffer_size) srcsize=a_in_buffer_size; // !!!!!!
! if(a_in_buffer_len<srcsize){
! a_in_buffer_len+=
! demux_read_data(d_audio,&a_in_buffer[a_in_buffer_len],
! srcsize-a_in_buffer_len);
}
memset(&ash, 0, sizeof(ash));
--- 37,68 ----
srcsize=in_fmt->nBlockAlign;
! acmStreamSize(sh_audio->srcstream, srcsize, &srcsize, ACM_STREAMSIZEF_SOURCE);
if(srcsize<OUTBURST) srcsize=OUTBURST;
! sh_audio->audio_out_minsize=srcsize; // audio output min. size
if(verbose) printf("Audio ACM output buffer min. size: %d\n",srcsize);
! acmStreamSize(sh_audio->srcstream, srcsize, &srcsize, ACM_STREAMSIZEF_DESTINATION);
! sh_audio->audio_in_minsize=srcsize; // audio input min. size
if(verbose) printf("Audio ACM input buffer min. size: %d\n",srcsize);
! sh_audio->a_in_buffer_size=sh_audio->audio_in_minsize;
! sh_audio->a_in_buffer=malloc(sh_audio->a_in_buffer_size);
! sh_audio->a_in_buffer_len=0;
return 1;
}
! int acm_decode_audio(sh_audio_t *sh_audio, void* a_buffer,int len){
ACMSTREAMHEADER ash;
HRESULT hr;
DWORD srcsize=0;
! acmStreamSize(sh_audio->srcstream,len , &srcsize, ACM_STREAMSIZEF_DESTINATION);
! if(verbose>=3)printf("acm says: srcsize=%d (buffsize=%d) out_size=%d\n",srcsize,sh_audio->a_in_buffer_size,len);
! // if(srcsize==0) srcsize=((WAVEFORMATEX *)&sh_audio->o_wf_ext)->nBlockAlign;
! if(srcsize>sh_audio->a_in_buffer_size) srcsize=sh_audio->a_in_buffer_size; // !!!!!!
! if(sh_audio->a_in_buffer_len<srcsize){
! sh_audio->a_in_buffer_len+=
! demux_read_data(sh_audio->ds,&sh_audio->a_in_buffer[sh_audio->a_in_buffer_len],
! srcsize-sh_audio->a_in_buffer_len);
}
memset(&ash, 0, sizeof(ash));
***************
*** 74,87 ****
ash.fdwStatus=0;
ash.dwUser=0;
! ash.pbSrc=a_in_buffer;
! ash.cbSrcLength=a_in_buffer_len;
ash.pbDst=a_buffer;
ash.cbDstLength=len;
! hr=acmStreamPrepareHeader(avi_header.srcstream,&ash,0);
if(hr){
printf("ACM_Decoder: acmStreamPrepareHeader error %d\n",hr);
return -1;
}
! hr=acmStreamConvert(avi_header.srcstream,&ash,0);
if(hr){
printf("ACM_Decoder: acmStreamConvert error %d\n",hr);
--- 70,83 ----
ash.fdwStatus=0;
ash.dwUser=0;
! ash.pbSrc=sh_audio->a_in_buffer;
! ash.cbSrcLength=sh_audio->a_in_buffer_len;
ash.pbDst=a_buffer;
ash.cbDstLength=len;
! hr=acmStreamPrepareHeader(sh_audio->srcstream,&ash,0);
if(hr){
printf("ACM_Decoder: acmStreamPrepareHeader error %d\n",hr);
return -1;
}
! hr=acmStreamConvert(sh_audio->srcstream,&ash,0);
if(hr){
printf("ACM_Decoder: acmStreamConvert error %d\n",hr);
***************
*** 89,100 ****
}
//printf("ACM convert %d -> %d (buf=%d)\n",ash.cbSrcLengthUsed,ash.cbDstLengthUsed,a_in_buffer_len);
! if(ash.cbSrcLengthUsed>=a_in_buffer_len){
! a_in_buffer_len=0;
} else {
! a_in_buffer_len-=ash.cbSrcLengthUsed;
! memcpy(a_in_buffer,&a_in_buffer[ash.cbSrcLengthUsed],a_in_buffer_len);
}
len=ash.cbDstLengthUsed;
! hr=acmStreamUnprepareHeader(avi_header.srcstream,&ash,0);
if(hr){
printf("ACM_Decoder: acmStreamUnprepareHeader error %d\n",hr);
--- 85,96 ----
}
//printf("ACM convert %d -> %d (buf=%d)\n",ash.cbSrcLengthUsed,ash.cbDstLengthUsed,a_in_buffer_len);
! if(ash.cbSrcLengthUsed>=sh_audio->a_in_buffer_len){
! sh_audio->a_in_buffer_len=0;
} else {
! sh_audio->a_in_buffer_len-=ash.cbSrcLengthUsed;
! memcpy(sh_audio->a_in_buffer,&sh_audio->a_in_buffer[ash.cbSrcLengthUsed],sh_audio->a_in_buffer_len);
}
len=ash.cbDstLengthUsed;
! hr=acmStreamUnprepareHeader(sh_audio->srcstream,&ash,0);
if(hr){
printf("ACM_Decoder: acmStreamUnprepareHeader error %d\n",hr);
***************
*** 110,127 ****
if(verbose) printf("======= Win32 (VFW) VIDEO Codec init =======\n");
! memset(&avi_header.o_bih, 0, sizeof(BITMAPINFOHEADER));
! avi_header.o_bih.biSize = sizeof(BITMAPINFOHEADER);
win32_codec_name = avi_header.video_codec;
! avi_header.hic = ICOpen( 0x63646976, avi_header.bih.biCompression, ICMODE_FASTDECOMPRESS);
! // avi_header.hic = ICOpen( 0x63646976, avi_header.bih.biCompression, ICMODE_DECOMPRESS);
! if(!avi_header.hic){
printf("ICOpen failed! unknown codec / wrong parameters?\n");
return 0;
}
! // avi_header.bih.biBitCount=32;
! ret = ICDecompressGetFormat(avi_header.hic, &avi_header.bih, &avi_header.o_bih);
if(ret){
printf("ICDecompressGetFormat failed: Error %d\n", ret);
--- 106,123 ----
if(verbose) printf("======= Win32 (VFW) VIDEO Codec init =======\n");
! memset(&sh_video->o_bih, 0, sizeof(BITMAPINFOHEADER));
! sh_video->o_bih.biSize = sizeof(BITMAPINFOHEADER);
win32_codec_name = avi_header.video_codec;
! sh_video->hic = ICOpen( 0x63646976, sh_video->bih.biCompression, ICMODE_FASTDECOMPRESS);
! // sh_video->hic = ICOpen( 0x63646976, sh_video->bih.biCompression, ICMODE_DECOMPRESS);
! if(!sh_video->hic){
printf("ICOpen failed! unknown codec / wrong parameters?\n");
return 0;
}
! // sh_video->bih.biBitCount=32;
! ret = ICDecompressGetFormat(sh_video->hic, &sh_video->bih, &sh_video->o_bih);
if(ret){
printf("ICDecompressGetFormat failed: Error %d\n", ret);
***************
*** 132,181 ****
// printf("ICM_DECOMPRESS_QUERY=0x%X",ICM_DECOMPRESS_QUERY);
! // avi_header.o_bih.biWidth=avi_header.bih.biWidth;
! // avi_header.o_bih.biCompression = 0x32315659; // mmioFOURCC('U','Y','V','Y');
! // ret=ICDecompressGetFormatSize(avi_header.hic,&avi_header.o_bih);
! // avi_header.o_bih.biCompression = 3; //0x32315659;
! // avi_header.o_bih.biCompression = mmioFOURCC('U','Y','V','Y');
! // avi_header.o_bih.biCompression = mmioFOURCC('U','Y','V','Y');
! // avi_header.o_bih.biCompression = mmioFOURCC('Y','U','Y','2');
! // avi_header.o_bih.biPlanes=3;
! // avi_header.o_bih.biBitCount=16;
if(outfmt==IMGFMT_YUY2)
! avi_header.o_bih.biBitCount=16;
else
! avi_header.o_bih.biBitCount=outfmt&0xFF;// //24;
! avi_header.o_bih.biSizeImage=avi_header.o_bih.biWidth*avi_header.o_bih.biHeight*(avi_header.o_bih.biBitCount/8);
if(!avi_header.flipped)
! avi_header.o_bih.biHeight=-avi_header.bih.biHeight; // flip image!
if(outfmt==IMGFMT_YUY2 && !avi_header.yuv_hack_needed)
! avi_header.o_bih.biCompression = mmioFOURCC('Y','U','Y','2');
! // avi_header.o_bih.biCompression = mmioFOURCC('U','Y','V','Y');
if(verbose) {
printf("Starting decompression, format:\n");
! printf(" biSize %d\n", avi_header.bih.biSize);
! printf(" biWidth %d\n", avi_header.bih.biWidth);
! printf(" biHeight %d\n", avi_header.bih.biHeight);
! printf(" biPlanes %d\n", avi_header.bih.biPlanes);
! printf(" biBitCount %d\n", avi_header.bih.biBitCount);
! printf(" biCompression %d='%.4s'\n", avi_header.bih.biCompression, &avi_header.bih.biCompression);
! printf(" biSizeImage %d\n", avi_header.bih.biSizeImage);
printf("Dest fmt:\n");
! printf(" biSize %d\n", avi_header.o_bih.biSize);
! printf(" biWidth %d\n", avi_header.o_bih.biWidth);
! printf(" biHeight %d\n", avi_header.o_bih.biHeight);
! printf(" biPlanes %d\n", avi_header.o_bih.biPlanes);
! printf(" biBitCount %d\n", avi_header.o_bih.biBitCount);
! printf(" biCompression %d='%.4s'\n", avi_header.o_bih.biCompression, &avi_header.o_bih.biCompression);
! printf(" biSizeImage %d\n", avi_header.o_bih.biSizeImage);
}
! ret = ICDecompressQuery(avi_header.hic, &avi_header.bih, &avi_header.o_bih);
if(ret){
printf("ICDecompressQuery failed: Error %d\n", ret);
--- 128,177 ----
// printf("ICM_DECOMPRESS_QUERY=0x%X",ICM_DECOMPRESS_QUERY);
! // sh_video->o_bih.biWidth=sh_video->bih.biWidth;
! // sh_video->o_bih.biCompression = 0x32315659; // mmioFOURCC('U','Y','V','Y');
! // ret=ICDecompressGetFormatSize(sh_video->hic,&sh_video->o_bih);
! // sh_video->o_bih.biCompression = 3; //0x32315659;
! // sh_video->o_bih.biCompression = mmioFOURCC('U','Y','V','Y');
! // sh_video->o_bih.biCompression = mmioFOURCC('U','Y','V','Y');
! // sh_video->o_bih.biCompression = mmioFOURCC('Y','U','Y','2');
! // sh_video->o_bih.biPlanes=3;
! // sh_video->o_bih.biBitCount=16;
if(outfmt==IMGFMT_YUY2)
! sh_video->o_bih.biBitCount=16;
else
! sh_video->o_bih.biBitCount=outfmt&0xFF;// //24;
! sh_video->o_bih.biSizeImage=sh_video->o_bih.biWidth*sh_video->o_bih.biHeight*(sh_video->o_bih.biBitCount/8);
if(!avi_header.flipped)
! sh_video->o_bih.biHeight=-sh_video->bih.biHeight; // flip image!
if(outfmt==IMGFMT_YUY2 && !avi_header.yuv_hack_needed)
! sh_video->o_bih.biCompression = mmioFOURCC('Y','U','Y','2');
! // sh_video->o_bih.biCompression = mmioFOURCC('U','Y','V','Y');
if(verbose) {
printf("Starting decompression, format:\n");
! printf(" biSize %d\n", sh_video->bih.biSize);
! printf(" biWidth %d\n", sh_video->bih.biWidth);
! printf(" biHeight %d\n", sh_video->bih.biHeight);
! printf(" biPlanes %d\n", sh_video->bih.biPlanes);
! printf(" biBitCount %d\n", sh_video->bih.biBitCount);
! printf(" biCompression %d='%.4s'\n", sh_video->bih.biCompression, &sh_video->bih.biCompression);
! printf(" biSizeImage %d\n", sh_video->bih.biSizeImage);
printf("Dest fmt:\n");
! printf(" biSize %d\n", sh_video->o_bih.biSize);
! printf(" biWidth %d\n", sh_video->o_bih.biWidth);
! printf(" biHeight %d\n", sh_video->o_bih.biHeight);
! printf(" biPlanes %d\n", sh_video->o_bih.biPlanes);
! printf(" biBitCount %d\n", sh_video->o_bih.biBitCount);
! printf(" biCompression %d='%.4s'\n", sh_video->o_bih.biCompression, &sh_video->o_bih.biCompression);
! printf(" biSizeImage %d\n", sh_video->o_bih.biSizeImage);
}
! ret = ICDecompressQuery(sh_video->hic, &sh_video->bih, &sh_video->o_bih);
if(ret){
printf("ICDecompressQuery failed: Error %d\n", ret);
***************
*** 185,189 ****
! ret = ICDecompressBegin(avi_header.hic, &avi_header.bih, &avi_header.o_bih);
if(ret){
printf("ICDecompressBegin failed: Error %d\n", ret);
--- 181,185 ----
! ret = ICDecompressBegin(sh_video->hic, &sh_video->bih, &sh_video->o_bih);
if(ret){
printf("ICDecompressBegin failed: Error %d\n", ret);
***************
*** 193,202 ****
#if 0
! //avi_header.hic
//ICSendMessage(HIC hic,unsigned int msg,long lParam1,long lParam2)
{ int i;
for(i=73;i<256;i++){
printf("Calling ICM_USER+%d function...",i);fflush(stdout);
! ret = ICSendMessage(avi_header.hic,ICM_USER+i,NULL,NULL);
printf(" ret=%d\n",ret);
}
--- 189,198 ----
#if 0
! //sh_video->hic
//ICSendMessage(HIC hic,unsigned int msg,long lParam1,long lParam2)
{ int i;
for(i=73;i<256;i++){
printf("Calling ICM_USER+%d function...",i);fflush(stdout);
! ret = ICSendMessage(sh_video->hic,ICM_USER+i,NULL,NULL);
printf(" ret=%d\n",ret);
}
***************
*** 204,215 ****
#endif
! avi_header.our_out_buffer = malloc(avi_header.o_bih.biSizeImage);
! if(!avi_header.our_out_buffer){
! printf("not enough memory for decoded picture buffer (%d bytes)\n", avi_header.o_bih.biSizeImage);
return 0;
}
if(outfmt==IMGFMT_YUY2 && avi_header.yuv_hack_needed)
! avi_header.o_bih.biCompression = mmioFOURCC('Y','U','Y','2');
// avi_header.our_in_buffer=malloc(avi_header.video.dwSuggestedBufferSize); // FIXME!!!!
--- 200,211 ----
#endif
! sh_video->our_out_buffer = malloc(sh_video->o_bih.biSizeImage);
! if(!sh_video->our_out_buffer){
! printf("not enough memory for decoded picture buffer (%d bytes)\n", sh_video->o_bih.biSizeImage);
return 0;
}
if(outfmt==IMGFMT_YUY2 && avi_header.yuv_hack_needed)
! sh_video->o_bih.biCompression = mmioFOURCC('Y','U','Y','2');
// avi_header.our_in_buffer=malloc(avi_header.video.dwSuggestedBufferSize); // FIXME!!!!
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -r1.35 -r1.36
*** mplayer.c 2001/04/01 23:01:37 1.35
--- mplayer.c 2001/04/06 01:18:59 1.36
***************
*** 185,199 ****
int idx_pos_v;
int idx_offset; // ennyit kell hozzaadni az index offset ertekekhez
- // int a_idx;
- // int v_idx;
// video:
- AVIStreamHeader video;
- char *video_codec;
- BITMAPINFOHEADER bih; // in format
- BITMAPINFOHEADER o_bih; // out format
- HIC hic;
- char *our_out_buffer;
unsigned int bitrate;
! // video format flags: (filled by codecs.c)
char yuv_supported; // 1 if codec support YUY2 output format
char yuv_hack_needed; // requires for divx & mpeg4
--- 185,192 ----
int idx_pos_v;
int idx_offset; // ennyit kell hozzaadni az index offset ertekekhez
// video:
unsigned int bitrate;
! // video codec info: (filled by codecs.c)
! char *video_codec;
char yuv_supported; // 1 if codec support YUY2 output format
char yuv_hack_needed; // requires for divx & mpeg4
***************
*** 201,214 ****
char flipped; // image is upside-down
GUID* vids_guid;
! // audio:
! AVIStreamHeader audio;
char *audio_codec;
int audio_seekable;
GUID* auds_guid;
- char wf_ext[64]; // in format
- WAVEFORMATEX wf; // out format
- HACMSTREAM srcstream;
- int audio_in_minsize;
- int audio_out_minsize;
} avi_header_t;
--- 194,201 ----
char flipped; // image is upside-down
GUID* vids_guid;
! // audio codec info: (filled by codecs.c)
char *audio_codec;
int audio_seekable;
GUID* auds_guid;
} avi_header_t;
***************
*** 216,220 ****
#include "aviprint.c"
- #include "codecs.c"
extern picture_t *picture;
--- 203,206 ----
***************
*** 230,233 ****
--- 216,222 ----
#include "stream.c"
#include "demuxer.c"
+
+ #include "stheader.h"
+
#include "demux_avi.c"
#include "demux_mpg.c"
***************
*** 237,240 ****
--- 226,234 ----
demux_stream_t *d_video=NULL;
+ sh_audio_t sh_audio_i; // FIXME later!
+ sh_video_t sh_video_i;
+ sh_audio_t *sh_audio=&sh_audio_i;
+ sh_video_t *sh_video=&sh_video_i;
+
// MPEG video stream parser:
#include "parse_es.c"
***************
*** 245,248 ****
--- 239,244 ----
};
+ #include "codecs.c"
+
//**************************************************************************//
// Audio codecs:
***************
*** 252,261 ****
int mplayer_audio_read(char *buf,int size){
int len;
! len=demux_read_data(d_audio,buf,size);
return len;
}
static void ac3_fill_buffer(uint8_t **start,uint8_t **end){
! int len=ds_get_packet(d_audio,(char**)start);
//printf("<ac3:%d>\n",len);
if(len<0)
--- 248,257 ----
int mplayer_audio_read(char *buf,int size){
int len;
! len=demux_read_data(sh_audio->ds,buf,size);
return len;
}
static void ac3_fill_buffer(uint8_t **start,uint8_t **end){
! int len=ds_get_packet(sh_audio->ds,(char**)start);
//printf("<ac3:%d>\n",len);
if(len<0)
***************
*** 269,272 ****
--- 265,270 ----
#include "xa/xa_gsm.h"
+ #include "dec_audio.c"
+
//**************************************************************************//
// The OpenDivX stuff:
***************
*** 650,653 ****
--- 648,653 ----
d_audio=demuxer->audio;
d_video=demuxer->video;
+ d_audio->sh=sh_audio; sh_audio->ds=d_audio;
+ d_video->sh=sh_video; sh_video->ds=d_video;
switch(file_format){
***************
*** 724,728 ****
has_audio=audio_format; // override type
else if(has_audio)
! switch(((WAVEFORMATEX *)&avi_header.wf_ext)->wFormatTag){
case 0:
has_audio=0;break; // disable/no audio
--- 724,728 ----
has_audio=audio_format; // override type
else if(has_audio)
! switch(sh_audio->wf.wFormatTag){
case 0:
has_audio=0;break; // disable/no audio
***************
*** 751,755 ****
if(verbose) printf("detected AVI audio format: %d\n",has_audio);
if(has_audio==4){
! if(!avi_header.audio_codec) avi_header.audio_codec=get_auds_codec_name();
if(avi_header.auds_guid) has_audio=7; // force DShow
if(!avi_header.audio_codec) has_audio=0; // unknown win32 codec
--- 751,755 ----
if(verbose) printf("detected AVI audio format: %d\n",has_audio);
if(has_audio==4){
! if(!avi_header.audio_codec) avi_header.audio_codec=get_auds_codec_name(sh_audio);
if(avi_header.auds_guid) has_audio=7; // force DShow
if(!avi_header.audio_codec) has_audio=0; // unknown win32 codec
***************
*** 763,767 ****
}
}
! default_fps=(float)avi_header.video.dwRate/(float)avi_header.video.dwScale;
break;
}
--- 763,767 ----
}
}
! default_fps=(float)sh_video->video.dwRate/(float)sh_video->video.dwScale;
break;
}
***************
*** 792,796 ****
has_audio=audio_format; // override type
else if(has_audio)
! switch(((WAVEFORMATEX *)&avi_header.wf_ext)->wFormatTag){
case 0:
has_audio=0;break; // disable/no audio
--- 792,796 ----
has_audio=audio_format; // override type
else if(has_audio)
! switch(sh_audio->wf.wFormatTag){
case 0:
has_audio=0;break; // disable/no audio
***************
*** 819,823 ****
if(verbose) printf("detected ASF audio format: %d\n",has_audio);
if(has_audio==4){
! if(!avi_header.audio_codec) avi_header.audio_codec=get_auds_codec_name();
if(avi_header.auds_guid) has_audio=7; // force DShow
if(!avi_header.audio_codec) has_audio=0; // unknown win32 codec
--- 819,823 ----
if(verbose) printf("detected ASF audio format: %d\n",has_audio);
if(has_audio==4){
! if(!avi_header.audio_codec) avi_header.audio_codec=get_auds_codec_name(sh_audio);
if(avi_header.auds_guid) has_audio=7; // force DShow
if(!avi_header.audio_codec) has_audio=0; // unknown win32 codec
***************
*** 860,872 ****
if(has_video==2){
! if(avi_header.video.fccHandler==mmioFOURCC('d', 'v', 'x', '1')) has_video=3;
! if(avi_header.video.fccHandler==mmioFOURCC('d', 'i', 'v', 'x')) has_video=3;
! if(avi_header.bih.biCompression==mmioFOURCC('d', 'v', 'x', '1')) has_video=3;
! if(avi_header.bih.biCompression==mmioFOURCC('d', 'i', 'v', 'x')) has_video=3;
! // if(avi_header.bih.biCompression==mmioFOURCC('D', 'I', 'V', 'X')) has_video=3; // Gabucino
}
if(has_video==2){
! if(!avi_header.video_codec) avi_header.video_codec=get_vids_codec_name();
if(verbose)
printf("win32 video codec: '%s' %s%s%s\n",avi_header.video_codec,
--- 860,872 ----
if(has_video==2){
! if(sh_video->video.fccHandler==mmioFOURCC('d', 'v', 'x', '1')) has_video=3;
! if(sh_video->video.fccHandler==mmioFOURCC('d', 'i', 'v', 'x')) has_video=3;
! if(sh_video->bih.biCompression==mmioFOURCC('d', 'v', 'x', '1')) has_video=3;
! if(sh_video->bih.biCompression==mmioFOURCC('d', 'i', 'v', 'x')) has_video=3;
! // if(sh_video->bih.biCompression==mmioFOURCC('D', 'I', 'V', 'X')) has_video=3; // Gabucino
}
if(has_video==2){
! if(!avi_header.video_codec) avi_header.video_codec=get_vids_codec_name(sh_video);
if(verbose)
printf("win32 video codec: '%s' %s%s%s\n",avi_header.video_codec,
***************
*** 906,919 ****
// calculating video bitrate:
avi_header.bitrate=avi_header.movi_end-avi_header.movi_start-avi_header.idx_size*8;
! if(avi_header.audio.fccType) avi_header.bitrate-=avi_header.audio.dwLength;
if(verbose) printf("AVI video length=%d\n",avi_header.bitrate);
! avi_header.bitrate=((float)avi_header.bitrate/(float)avi_header.video.dwLength)
! *((float)avi_header.video.dwRate/(float)avi_header.video.dwScale);
! // default_fps=(float)avi_header.video.dwRate/(float)avi_header.video.dwScale;
printf("VIDEO: [%.4s] %dx%d %dbpp %4.2f fps %5.1f kbps (%4.1f kbyte/s)\n",
! &avi_header.bih.biCompression,
! avi_header.bih.biWidth,
! avi_header.bih.biHeight,
! avi_header.bih.biBitCount,
default_fps,
avi_header.bitrate*0.008f,
--- 906,919 ----
// calculating video bitrate:
avi_header.bitrate=avi_header.movi_end-avi_header.movi_start-avi_header.idx_size*8;
! if(sh_audio->audio.fccType) avi_header.bitrate-=sh_audio->audio.dwLength;
if(verbose) printf("AVI video length=%d\n",avi_header.bitrate);
! avi_header.bitrate=((float)avi_header.bitrate/(float)sh_video->video.dwLength)
! *((float)sh_video->video.dwRate/(float)sh_video->video.dwScale);
! // default_fps=(float)sh_video->video.dwRate/(float)sh_video->video.dwScale;
printf("VIDEO: [%.4s] %dx%d %dbpp %4.2f fps %5.1f kbps (%4.1f kbyte/s)\n",
! &sh_video->bih.biCompression,
! sh_video->bih.biWidth,
! sh_video->bih.biHeight,
! sh_video->bih.biBitCount,
default_fps,
avi_header.bitrate*0.008f,
***************
*** 921,926 ****
// display info:
! movie_size_x=avi_header.o_bih.biWidth;
! movie_size_y=abs(avi_header.o_bih.biHeight);
break;
}
--- 921,926 ----
// display info:
! movie_size_x=sh_video->o_bih.biWidth;
! movie_size_y=abs(sh_video->o_bih.biHeight);
break;
}
***************
*** 940,945 ****
//if(verbose) printf("AVI out_fmt=%X\n",out_fmt);
if(verbose) if(out_fmt==IMGFMT_YUY2) printf("Using YUV/YUY2 video output format!\n");
! avi_header.our_out_buffer=NULL;
! if(DS_VideoDecoder_Open(avi_header.video_codec,avi_header.vids_guid, &avi_header.bih, 0, &avi_header.our_out_buffer)){
printf("ERROR: Couldn't open required DirectShow codec: %s\n",avi_header.video_codec);
printf("Maybe you forget to upgrade your win32 codecs?? It's time to download the new\n");
--- 940,945 ----
//if(verbose) printf("AVI out_fmt=%X\n",out_fmt);
if(verbose) if(out_fmt==IMGFMT_YUY2) printf("Using YUV/YUY2 video output format!\n");
! sh_video->our_out_buffer=NULL;
! if(DS_VideoDecoder_Open(avi_header.video_codec,avi_header.vids_guid, &sh_video->bih, 0, &sh_video->our_out_buffer)){
printf("ERROR: Couldn't open required DirectShow codec: %s\n",avi_header.video_codec);
printf("Maybe you forget to upgrade your win32 codecs?? It's time to download the new\n");
***************
*** 964,977 ****
// calculating video bitrate:
avi_header.bitrate=avi_header.movi_end-avi_header.movi_start-avi_header.idx_size*8;
! if(avi_header.audio.fccType) avi_header.bitrate-=avi_header.audio.dwLength;
if(verbose) printf("AVI video length=%d\n",avi_header.bitrate);
! avi_header.bitrate=((float)avi_header.bitrate/(float)avi_header.video.dwLength)
! *((float)avi_header.video.dwRate/(float)avi_header.video.dwScale);
! // default_fps=(float)avi_header.video.dwRate/(float)avi_header.video.dwScale;
printf("VIDEO: [%.4s] %dx%d %dbpp %4.2f fps %5.1f kbps (%4.1f kbyte/s)\n",
! &avi_header.bih.biCompression,
! avi_header.bih.biWidth,
! avi_header.bih.biHeight,
! avi_header.bih.biBitCount,
default_fps,
avi_header.bitrate*0.008f,
--- 964,977 ----
// calculating video bitrate:
avi_header.bitrate=avi_header.movi_end-avi_header.movi_start-avi_header.idx_size*8;
! if(sh_audio->audio.fccType) avi_header.bitrate-=sh_audio->audio.dwLength;
if(verbose) printf("AVI video length=%d\n",avi_header.bitrate);
! avi_header.bitrate=((float)avi_header.bitrate/(float)sh_video->video.dwLength)
! *((float)sh_video->video.dwRate/(float)sh_video->video.dwScale);
! // default_fps=(float)sh_video->video.dwRate/(float)sh_video->video.dwScale;
printf("VIDEO: [%.4s] %dx%d %dbpp %4.2f fps %5.1f kbps (%4.1f kbyte/s)\n",
! &sh_video->bih.biCompression,
! sh_video->bih.biWidth,
! sh_video->bih.biHeight,
! sh_video->bih.biBitCount,
default_fps,
avi_header.bitrate*0.008f,
***************
*** 979,984 ****
// display info:
! movie_size_x=avi_header.bih.biWidth;
! movie_size_y=abs(avi_header.bih.biHeight);
break;
}
--- 979,984 ----
// display info:
! movie_size_x=sh_video->bih.biWidth;
! movie_size_y=abs(sh_video->bih.biHeight);
break;
}
***************
*** 994,999 ****
{ DEC_PARAM dec_param;
DEC_SET dec_set;
! dec_param.x_dim = avi_header.bih.biWidth;
! dec_param.y_dim = avi_header.bih.biHeight;
dec_param.color_depth = 32;
decore(0x123, DEC_OPT_INIT, &dec_param, NULL);
--- 994,999 ----
{ DEC_PARAM dec_param;
DEC_SET dec_set;
! dec_param.x_dim = sh_video->bih.biWidth;
! dec_param.y_dim = sh_video->bih.biHeight;
dec_param.color_depth = 32;
decore(0x123, DEC_OPT_INIT, &dec_param, NULL);
***************
*** 1005,1018 ****
// calculating video bitrate:
avi_header.bitrate=avi_header.movi_end-avi_header.movi_start-avi_header.idx_size*8;
! if(avi_header.audio.fccType) avi_header.bitrate-=avi_header.audio.dwLength;
if(verbose) printf("AVI video length=%d\n",avi_header.bitrate);
! avi_header.bitrate=((float)avi_header.bitrate/(float)avi_header.video.dwLength)
! *((float)avi_header.video.dwRate/(float)avi_header.video.dwScale);
! // default_fps=(float)avi_header.video.dwRate/(float)avi_header.video.dwScale;
printf("VIDEO: [%.4s] %dx%d %dbpp %4.2f fps %5.1f kbps (%4.1f kbyte/s)\n",
! &avi_header.bih.biCompression,
! avi_header.bih.biWidth,
! avi_header.bih.biHeight,
! avi_header.bih.biBitCount,
default_fps,
avi_header.bitrate*0.008f,
--- 1005,1018 ----
// calculating video bitrate:
avi_header.bitrate=avi_header.movi_end-avi_header.movi_start-avi_header.idx_size*8;
! if(sh_audio->audio.fccType) avi_header.bitrate-=sh_audio->audio.dwLength;
if(verbose) printf("AVI video length=%d\n",avi_header.bitrate);
! avi_header.bitrate=((float)avi_header.bitrate/(float)sh_video->video.dwLength)
! *((float)sh_video->video.dwRate/(float)sh_video->video.dwScale);
! // default_fps=(float)sh_video->video.dwRate/(float)sh_video->video.dwScale;
printf("VIDEO: [%.4s] %dx%d %dbpp %4.2f fps %5.1f kbps (%4.1f kbyte/s)\n",
! &sh_video->bih.biCompression,
! sh_video->bih.biWidth,
! sh_video->bih.biHeight,
! sh_video->bih.biBitCount,
default_fps,
avi_header.bitrate*0.008f,
***************
*** 1020,1026 ****
// display info:
! // movie_size_x=avi_header.bih.biWidth+(divx_quality?0:64);
! movie_size_x=avi_header.bih.biWidth;
! movie_size_y=abs(avi_header.bih.biHeight);
break;
}
--- 1020,1026 ----
// display info:
! // movie_size_x=sh_video->bih.biWidth+(divx_quality?0:64);
! movie_size_x=sh_video->bih.biWidth;
! movie_size_y=abs(sh_video->bih.biHeight);
break;
}
***************
*** 1186,1190 ****
int a_buffer_size=0;
int audio_fd=-1;
- int pcm_bswap=0;
float buffer_delay=0;
float frame_correction=0; // A-V timestamp kulonbseg atlagolas
--- 1186,1189 ----
***************
*** 1199,1203 ****
int eof=0;
int force_redraw=0;
- ac3_frame_t *ac3_frame=NULL;
float num_frames=0; // number of frames played
//int real_num_frames=0; // number of frames readed
--- 1198,1201 ----
***************
*** 1240,1256 ****
MP3_bps=2;
! pcm_bswap=0;
a_buffer_size=16384; // default size, maybe not enough for Win32/ACM
if(has_audio==4){
// Win32 ACM audio codec:
! if(init_audio_codec()){
! MP3_channels=avi_header.wf.nChannels;
! MP3_samplerate=avi_header.wf.nSamplesPerSec;
! if(a_buffer_size<avi_header.audio_out_minsize+OUTBURST)
! a_buffer_size=avi_header.audio_out_minsize+OUTBURST;
} else {
printf("Could not load/initialize Win32/ACM AUDIO codec (missing DLL file?)\n");
! if((((WAVEFORMATEX *)&avi_header.wf_ext)->wFormatTag)==0x55){
printf("Audio format is MP3 -> fallback to internal mp3lib/mpg123\n");
has_audio=1; // fallback to mp3lib
--- 1238,1254 ----
MP3_bps=2;
! sh_audio->pcm_bswap=0;
a_buffer_size=16384; // default size, maybe not enough for Win32/ACM
if(has_audio==4){
// Win32 ACM audio codec:
! if(init_audio_codec(sh_audio)){
! MP3_channels=sh_audio->o_wf.nChannels;
! MP3_samplerate=sh_audio->o_wf.nSamplesPerSec;
! if(a_buffer_size<sh_audio->audio_out_minsize+OUTBURST)
! a_buffer_size=sh_audio->audio_out_minsize+OUTBURST;
} else {
printf("Could not load/initialize Win32/ACM AUDIO codec (missing DLL file?)\n");
! if((sh_audio->wf.wFormatTag)==0x55){
printf("Audio format is MP3 -> fallback to internal mp3lib/mpg123\n");
has_audio=1; // fallback to mp3lib
***************
*** 1266,1287 ****
#else
// Win32 DShow audio codec:
! WAVEFORMATEX *in_fmt=(WAVEFORMATEX*)&avi_header.wf_ext;
! avi_header.wf.nChannels=in_fmt->nChannels;
! avi_header.wf.nSamplesPerSec=in_fmt->nSamplesPerSec;
! avi_header.wf.nAvgBytesPerSec=2*avi_header.wf.nSamplesPerSec*avi_header.wf.nChannels;
! avi_header.wf.wFormatTag=WAVE_FORMAT_PCM;
! avi_header.wf.nBlockAlign=2*in_fmt->nChannels;
! avi_header.wf.wBitsPerSample=16;
! avi_header.wf.cbSize=0;
if(!DS_AudioDecoder_Open(avi_header.audio_codec,avi_header.auds_guid,in_fmt)){
! MP3_channels=avi_header.wf.nChannels;
! MP3_samplerate=avi_header.wf.nSamplesPerSec;
! avi_header.audio_in_minsize=2*avi_header.wf.nBlockAlign;
! if(avi_header.audio_in_minsize<8192) avi_header.audio_in_minsize=8192;
! a_in_buffer_size=avi_header.audio_in_minsize;
! a_in_buffer=malloc(a_in_buffer_size);
! a_in_buffer_len=0;
} else {
--- 1264,1285 ----
#else
// Win32 DShow audio codec:
! WAVEFORMATEX *in_fmt=&sh_audio->wf;
! sh_audio->o_wf.nChannels=in_fmt->nChannels;
! sh_audio->o_wf.nSamplesPerSec=in_fmt->nSamplesPerSec;
! sh_audio->o_wf.nAvgBytesPerSec=2*sh_audio->o_wf.nSamplesPerSec*sh_audio->o_wf.nChannels;
! sh_audio->o_wf.wFormatTag=WAVE_FORMAT_PCM;
! sh_audio->o_wf.nBlockAlign=2*in_fmt->nChannels;
! sh_audio->o_wf.wBitsPerSample=16;
! sh_audio->o_wf.cbSize=0;
if(!DS_AudioDecoder_Open(avi_header.audio_codec,avi_header.auds_guid,in_fmt)){
! MP3_channels=sh_audio->o_wf.nChannels;
! MP3_samplerate=sh_audio->o_wf.nSamplesPerSec;
! sh_audio->audio_in_minsize=2*sh_audio->o_wf.nBlockAlign;
! if(sh_audio->audio_in_minsize<8192) sh_audio->audio_in_minsize=8192;
! sh_audio->a_in_buffer_size=sh_audio->audio_in_minsize;
! sh_audio->a_in_buffer=malloc(sh_audio->a_in_buffer_size);
! sh_audio->a_in_buffer_len=0;
} else {
***************
*** 1304,1308 ****
if(has_audio==4){
! int ret=acm_decode_audio(a_buffer,a_buffer_size);
if(ret<0){
printf("ACM error %d -> switching to nosound...\n",ret);
--- 1302,1306 ----
if(has_audio==4){
! int ret=acm_decode_audio(sh_audio,a_buffer,a_buffer_size);
if(ret<0){
printf("ACM error %d -> switching to nosound...\n",ret);
***************
*** 1317,1321 ****
if(file_format==DEMUXER_TYPE_AVI){
// AVI PCM Audio:
! WAVEFORMATEX *h=(WAVEFORMATEX*)&avi_header.wf_ext;
MP3_channels=h->nChannels;
MP3_samplerate=h->nSamplesPerSec;
--- 1315,1319 ----
if(file_format==DEMUXER_TYPE_AVI){
// AVI PCM Audio:
! WAVEFORMATEX *h=&sh_audio->wf;
MP3_channels=h->nChannels;
MP3_samplerate=h->nSamplesPerSec;
***************
*** 1325,1329 ****
MP3_channels=2;
MP3_samplerate=48000;
! pcm_bswap=1;
}
} else
--- 1323,1327 ----
MP3_channels=2;
MP3_samplerate=48000;
! sh_audio->pcm_bswap=1;
}
} else
***************
*** 1340,1346 ****
#endif
ac3_init();
! ac3_frame = ac3_decode_frame();
! if(ac3_frame){
! MP3_samplerate=ac3_frame->sampling_rate;
MP3_channels=2;
} else has_audio=0; // bad frame -> disable audio
--- 1338,1344 ----
#endif
ac3_init();
! sh_audio->ac3_frame = ac3_decode_frame();
! if(sh_audio->ac3_frame){
! MP3_samplerate=sh_audio->ac3_frame->sampling_rate;
MP3_channels=2;
} else has_audio=0; // bad frame -> disable audio
***************
*** 1349,1360 ****
// aLaw audio codec:
Gen_aLaw_2_Signed(); // init table
! MP3_channels=((WAVEFORMATEX*)&avi_header.wf_ext)->nChannels;
! MP3_samplerate=((WAVEFORMATEX*)&avi_header.wf_ext)->nSamplesPerSec;
} else
if(has_audio==6){
// MS-GSM audio codec:
GSM_Init();
! MP3_channels=((WAVEFORMATEX*)&avi_header.wf_ext)->nChannels;
! MP3_samplerate=((WAVEFORMATEX*)&avi_header.wf_ext)->nSamplesPerSec;
}
// must be here for Win32->mp3lib fallbacks
--- 1347,1358 ----
// aLaw audio codec:
Gen_aLaw_2_Signed(); // init table
! MP3_channels=sh_audio->wf.nChannels;
! MP3_samplerate=sh_audio->wf.nSamplesPerSec;
} else
if(has_audio==6){
// MS-GSM audio codec:
GSM_Init();
! MP3_channels=sh_audio->wf.nChannels;
! MP3_samplerate=sh_audio->wf.nSamplesPerSec;
}
// must be here for Win32->mp3lib fallbacks
***************
*** 1466,1472 ****
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;
! printf("AVI Initial frame delay: %5.3f\n",(float)(avi_header.audio.dwInitialFrames-avi_header.video.dwInitialFrames)/default_fps);
printf("v: audio_delay=%5.3f buffer_delay=%5.3f a_pts=%5.3f a_frame=%5.3f\n",
audio_delay,buffer_delay,a_pts,a_frame);
--- 1464,1470 ----
if(file_format==DEMUXER_TYPE_AVI){
a_pts=d_audio->pts-(buffer_delay+audio_delay);
! audio_delay-=(float)(sh_audio->audio.dwInitialFrames-sh_video->video.dwInitialFrames)/default_fps;
! // audio_delay-=(float)(sh_audio->audio.dwInitialFrames-sh_video->video.dwInitialFrames)/default_fps;
! printf("AVI Initial frame delay: %5.3f\n",(float)(sh_audio->audio.dwInitialFrames-sh_video->video.dwInitialFrames)/default_fps);
printf("v: audio_delay=%5.3f buffer_delay=%5.3f a_pts=%5.3f a_frame=%5.3f\n",
audio_delay,buffer_delay,a_pts,a_frame);
***************
*** 1495,1594 ****
while(has_audio){
unsigned int t=GetTimer();
current_module="decode_audio"; // Enter AUDIO decoder module
! // Update buffer if needed
while(a_buffer_len<OUTBURST && !d_audio->eof){
! switch(has_audio){
! case 1: // MPEG layer 2 or 3
! a_buffer_len+=MP3_DecodeFrame(&a_buffer[a_buffer_len],-1);
! MP3_channels=2; // hack
! break;
! case 2: // PCM
! { int i=demux_read_data(d_audio,&a_buffer[a_buffer_len],OUTBURST);
! if(pcm_bswap){
! int j;
! if(i&3){ printf("Warning! pcm_audio_size&3 !=0 (%d)\n",i);i&=~3; }
! for(j=0;j<i;j+=2){
! char x=a_buffer[a_buffer_len+j];
! a_buffer[a_buffer_len+j]=a_buffer[a_buffer_len+j+1];
! a_buffer[a_buffer_len+j+1]=x;
! }
! }
! a_buffer_len+=i;
! break;
! }
! case 5: // aLaw decoder
! { int l=demux_read_data(d_audio,&a_buffer[a_buffer_len],OUTBURST/2);
! unsigned short *d=(unsigned short *) &a_buffer[a_buffer_len];
! unsigned char *s=&a_buffer[a_buffer_len];
! a_buffer_len+=2*l;
! while(l>0){
! --l;
! d[l]=xa_alaw_2_sign[s[l]];
! }
! break;
! }
! case 6: // MS-GSM decoder
! { unsigned char buf[65]; // 65 bytes / frame
! while(a_buffer_len<OUTBURST){
! if(demux_read_data(d_audio,buf,65)!=65) break; // EOF
! XA_MSGSM_Decoder(buf,(unsigned short *) &a_buffer[a_buffer_len]); // decodes 65 byte -> 320 short
! // XA_GSM_Decoder(buf,(unsigned short *) &a_buffer[a_buffer_len]); // decodes 33 byte -> 160 short
! a_buffer_len+=2*320;
! }
! break;
! }
! case 3: // AC3 decoder
! //printf("{1:%d}",avi_header.idx_pos);fflush(stdout);
! if(!ac3_frame) ac3_frame=ac3_decode_frame();
! //printf("{2:%d}",avi_header.idx_pos);fflush(stdout);
! if(ac3_frame){
! memcpy(&a_buffer[a_buffer_len],ac3_frame->audio_data,256 * 6 *MP3_channels*MP3_bps);
! a_buffer_len+=256 * 6 *MP3_channels*MP3_bps;
! ac3_frame=NULL;
! }
! //printf("{3:%d}",avi_header.idx_pos);fflush(stdout);
! break;
! case 4:
! { int ret=acm_decode_audio(&a_buffer[a_buffer_len],a_buffer_size-a_buffer_len);
! if(ret>0) a_buffer_len+=ret;
! break;
! }
! #ifdef USE_DIRECTSHOW
! case 7: // DirectShow
! { int ret;
! int len=a_buffer_size-a_buffer_len;
! int size_in=0;
! int size_out=0;
! int srcsize=DS_AudioDecoder_GetSrcSize(len);
! if(verbose>2)printf("DShow says: srcsize=%d (buffsize=%d) out_size=%d\n",srcsize,a_in_buffer_size,len);
! if(srcsize>a_in_buffer_size) srcsize=a_in_buffer_size; // !!!!!!
! if(a_in_buffer_len<srcsize){
! a_in_buffer_len+=
! demux_read_data(d_audio,&a_in_buffer[a_in_buffer_len],
! srcsize-a_in_buffer_len);
! }
! DS_AudioDecoder_Convert(a_in_buffer,a_in_buffer_len,
! &a_buffer[a_buffer_len],len, &size_in,&size_out);
! if(verbose>2)printf("DShow: audio %d -> %d converted (in_buf_len=%d of %d)\n",size_in,size_out,a_in_buffer_len,a_in_buffer_size);
! if(size_in>=a_in_buffer_len){
! a_in_buffer_len=0;
! } else {
! a_in_buffer_len-=size_in;
! memcpy(a_in_buffer,&a_in_buffer[size_in],a_in_buffer_len);
! }
! a_buffer_len+=size_out;
!
! break;
! }
! #endif
! }
}
current_module=NULL; // Leave AUDIO decoder module
! t=GetTimer()-t;
! audio_time_usage+=t*0.000001;
- // Play sound from the buffer:
if(a_buffer_len>=OUTBURST){ // if not EOF
#ifdef USE_XMMP_AUDIO
--- 1493,1510 ----
while(has_audio){
+
+ // Update buffer if needed
unsigned int t=GetTimer();
current_module="decode_audio"; // Enter AUDIO decoder module
! sh_audio->codec.driver=has_audio; // FIXME!
while(a_buffer_len<OUTBURST && !d_audio->eof){
! int ret=decode_audio(sh_audio,&a_buffer[a_buffer_len],a_buffer_size-a_buffer_len);
! if(ret>0) a_buffer_len+=ret; else break;
}
current_module=NULL; // Leave AUDIO decoder module
! t=GetTimer()-t;audio_time_usage+=t*0.000001;
+ // Play sound from the buffer:
if(a_buffer_len>=OUTBURST){ // if not EOF
#ifdef USE_XMMP_AUDIO
***************
*** 1697,1701 ****
++num_frames;
! v_frame+=1.0f/default_fps; //(float)avi_header.video.dwScale/(float)avi_header.video.dwRate;
break;
--- 1613,1617 ----
++num_frames;
! v_frame+=1.0f/default_fps; //(float)sh_video->video.dwScale/(float)sh_video->video.dwRate;
break;
***************
*** 1717,1721 ****
t2=GetTimer();t=t2-t;video_time_usage+=t*0.000001f;
! video_out->draw_frame((uint8_t **)&avi_header.our_out_buffer);
// video_out->flip_page();
t2=GetTimer()-t2;vout_time_usage+=t2*0.000001f;
--- 1633,1637 ----
t2=GetTimer();t=t2-t;video_time_usage+=t*0.000001f;
! video_out->draw_frame((uint8_t **)&sh_video->our_out_buffer);
// video_out->flip_page();
t2=GetTimer()-t2;vout_time_usage+=t2*0.000001f;
***************
*** 1727,1732 ****
if(d>0 && d<0.2) v_frame+=d;
} else
! v_frame+=1.0f/default_fps; //(float)avi_header.video.dwScale/(float)avi_header.video.dwRate;
! //v_pts+=1.0f/default_fps; //(float)avi_header.video.dwScale/(float)avi_header.video.dwRate;
break;
--- 1643,1648 ----
if(d>0 && d<0.2) v_frame+=d;
} else
! v_frame+=1.0f/default_fps; //(float)sh_video->video.dwScale/(float)sh_video->video.dwRate;
! //v_pts+=1.0f/default_fps; //(float)sh_video->video.dwScale/(float)sh_video->video.dwRate;
break;
***************
*** 1747,1760 ****
//if(in_size>0){
! avi_header.bih.biSizeImage = in_size;
! ret = ICDecompress(avi_header.hic, ICDECOMPRESS_NOTKEYFRAME,
// ret = ICDecompress(avi_header.hic, ICDECOMPRESS_NOTKEYFRAME|(ICDECOMPRESS_HURRYUP|ICDECOMPRESS_PREROL),
! &avi_header.bih, start,
! &avi_header.o_bih, avi_header.our_out_buffer);
if(ret){ printf("Error decompressing frame, err=%d\n",ret);break; }
//}
t2=GetTimer();t=t2-t;video_time_usage+=t*0.000001f;
! video_out->draw_frame((uint8_t **)&avi_header.our_out_buffer);
// video_out->flip_page();
t2=GetTimer()-t2;vout_time_usage+=t2*0.000001f;
--- 1663,1676 ----
//if(in_size>0){
! sh_video->bih.biSizeImage = in_size;
! ret = ICDecompress(sh_video->hic, ICDECOMPRESS_NOTKEYFRAME,
// ret = ICDecompress(avi_header.hic, ICDECOMPRESS_NOTKEYFRAME|(ICDECOMPRESS_HURRYUP|ICDECOMPRESS_PREROL),
! &sh_video->bih, start,
! &sh_video->o_bih, sh_video->our_out_buffer);
if(ret){ printf("Error decompressing frame, err=%d\n",ret);break; }
//}
t2=GetTimer();t=t2-t;video_time_usage+=t*0.000001f;
! video_out->draw_frame((uint8_t **)&sh_video->our_out_buffer);
// video_out->flip_page();
t2=GetTimer()-t2;vout_time_usage+=t2*0.000001f;
***************
*** 1766,1771 ****
if(d>0 && d<0.2) v_frame+=d;
} else
! v_frame+=1.0f/default_fps; //(float)avi_header.video.dwScale/(float)avi_header.video.dwRate;
! //v_pts+=1.0f/default_fps; //(float)avi_header.video.dwScale/(float)avi_header.video.dwRate;
break;
--- 1682,1687 ----
if(d>0 && d<0.2) v_frame+=d;
} else
! v_frame+=1.0f/default_fps; //(float)sh_video->video.dwScale/(float)sh_video->video.dwRate;
! //v_pts+=1.0f/default_fps; //(float)sh_video->video.dwScale/(float)sh_video->video.dwRate;
break;
***************
*** 1945,1950 ****
if(has_audio){
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
} else
--- 1861,1866 ----
if(has_audio){
if(pts_from_bps && (file_format==DEMUXER_TYPE_AVI)){
! // a_pts=(float)ds_tell(d_audio)/sh_audio->wf.nAvgBytesPerSec-(buffer_delay+audio_delay);
! a_pts=(float)ds_tell(d_audio)/sh_audio->wf.nAvgBytesPerSec-(buffer_delay);
delay_corrected=1; // hack
} else
***************
*** 2126,2130 ****
if(avi_stream_id(id)==d_video->id){ // video frame
if((--rel_seek_frames)<0 && avi_header.idx[video_chunk_pos].dwFlags&AVIIF_KEYFRAME) break;
! v_pts+=(float)avi_header.video.dwScale/(float)avi_header.video.dwRate;
++skip_audio_bytes;
}
--- 2042,2046 ----
if(avi_stream_id(id)==d_video->id){ // video frame
if((--rel_seek_frames)<0 && avi_header.idx[video_chunk_pos].dwFlags&AVIIF_KEYFRAME) break;
! v_pts+=(float)sh_video->video.dwScale/(float)sh_video->video.dwRate;
++skip_audio_bytes;
}
***************
*** 2138,2142 ****
if(avi_stream_id(id)==d_video->id){ // video frame
if((++rel_seek_frames)>0 && avi_header.idx[video_chunk_pos].dwFlags&AVIIF_KEYFRAME) break;
! v_pts-=(float)avi_header.video.dwScale/(float)avi_header.video.dwRate;
--skip_audio_bytes;
}
--- 2054,2058 ----
if(avi_stream_id(id)==d_video->id){ // video frame
if((++rel_seek_frames)>0 && avi_header.idx[video_chunk_pos].dwFlags&AVIIF_KEYFRAME) break;
! v_pts-=(float)sh_video->video.dwScale/(float)sh_video->video.dwRate;
--skip_audio_bytes;
}
***************
*** 2155,2159 ****
// if(LOWORD(id)==aviTWOCC('0','0')){ // video frame
if(avi_stream_id(id)==d_video->id){ // video frame
! avi_video_pts+=(float)avi_header.video.dwScale/(float)avi_header.video.dwRate;
}
}
--- 2071,2075 ----
// if(LOWORD(id)==aviTWOCC('0','0')){ // video frame
if(avi_stream_id(id)==d_video->id){ // video frame
! avi_video_pts+=(float)sh_video->video.dwScale/(float)sh_video->video.dwRate;
}
}
***************
*** 2173,2183 ****
// calc new audio position in audio stream: (using avg.bps value)
! curr_audio_pos=(avi_video_pts) * ((WAVEFORMATEX*)avi_header.wf_ext)->nAvgBytesPerSec;
if(curr_audio_pos<0)curr_audio_pos=0;
#if 1
curr_audio_pos&=~15; // requires for PCM formats!!!
#else
! curr_audio_pos/=((WAVEFORMATEX*)avi_header.wf_ext)->nBlockAlign;
! curr_audio_pos*=((WAVEFORMATEX*)avi_header.wf_ext)->nBlockAlign;
avi_header.audio_seekable=1;
#endif
--- 2089,2099 ----
// calc new audio position in audio stream: (using avg.bps value)
! curr_audio_pos=(avi_video_pts) * sh_audio->wf.nAvgBytesPerSec;
if(curr_audio_pos<0)curr_audio_pos=0;
#if 1
curr_audio_pos&=~15; // requires for PCM formats!!!
#else
! curr_audio_pos/=sh_audio->wf.nBlockAlign;
! curr_audio_pos*=sh_audio->wf.nBlockAlign;
avi_header.audio_seekable=1;
#endif
***************
*** 2215,2226 ****
#if 0
// curr_audio_pos=apos; // selected audio codec can't seek in chunk
! skip_audio_secs=(float)skip_audio_bytes/(float)((WAVEFORMATEX*)avi_header.wf_ext)->nAvgBytesPerSec;
//printf("Seek_AUDIO: %d bytes --> %5.3f secs\n",skip_audio_bytes,skip_audio_secs);
skip_audio_bytes=0;
#else
! int d=skip_audio_bytes % ((WAVEFORMATEX*)avi_header.wf_ext)->nBlockAlign;
skip_audio_bytes-=d;
// curr_audio_pos-=d;
! skip_audio_secs=(float)d/(float)((WAVEFORMATEX*)avi_header.wf_ext)->nAvgBytesPerSec;
//printf("Seek_AUDIO: %d bytes --> %5.3f secs\n",d,skip_audio_secs);
#endif
--- 2131,2142 ----
#if 0
// curr_audio_pos=apos; // selected audio codec can't seek in chunk
! skip_audio_secs=(float)skip_audio_bytes/(float)sh_audio->wf.nAvgBytesPerSec;
//printf("Seek_AUDIO: %d bytes --> %5.3f secs\n",skip_audio_bytes,skip_audio_secs);
skip_audio_bytes=0;
#else
! int d=skip_audio_bytes % sh_audio->wf.nBlockAlign;
skip_audio_bytes-=d;
// curr_audio_pos-=d;
! skip_audio_secs=(float)d/(float)sh_audio->wf.nAvgBytesPerSec;
//printf("Seek_AUDIO: %d bytes --> %5.3f secs\n",d,skip_audio_secs);
#endif
***************
*** 2239,2243 ****
++skip_video_frames;
// requires for correct audio pts calculation (demuxer):
! avi_video_pts-=(float)avi_header.video.dwScale/(float)avi_header.video.dwRate;
}
++i;
--- 2155,2159 ----
++skip_video_frames;
// requires for correct audio pts calculation (demuxer):
! avi_video_pts-=(float)sh_video->video.dwScale/(float)sh_video->video.dwRate;
}
++i;
***************
*** 2320,2328 ****
ac3_bitstream_reset(); // reset AC3 bitstream buffer
// if(verbose){ printf("Resyncing AC3 audio...");fflush(stdout);}
! ac3_frame=ac3_decode_frame(); // resync
// if(verbose) printf(" OK!\n");
break;
case 4:
! a_in_buffer_len=0; // reset ACM audio buffer
break;
}
--- 2236,2245 ----
ac3_bitstream_reset(); // reset AC3 bitstream buffer
// if(verbose){ printf("Resyncing AC3 audio...");fflush(stdout);}
! sh_audio->ac3_frame=ac3_decode_frame(); // resync
// if(verbose) printf(" OK!\n");
break;
case 4:
! case 7:
! sh_audio->a_in_buffer_len=0; // reset ACM/DShow audio buffer
break;
}
***************
*** 2337,2341 ****
switch(has_audio){
case 1: MP3_DecodeFrame(NULL,-2);break; // skip MPEG frame
! case 3: ac3_frame=ac3_decode_frame();break; // skip AC3 frame
default: ds_fill_buffer(d_audio); // skip PCM frame
}
--- 2254,2258 ----
switch(has_audio){
case 1: MP3_DecodeFrame(NULL,-2);break; // skip MPEG frame
! case 3: sh_audio->ac3_frame=ac3_decode_frame();break; // skip AC3 frame
default: ds_fill_buffer(d_audio); // skip PCM frame
}
_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog(a)lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog
1
0
Update of /cvsroot/mplayer/main/libvo
In directory usw-pr-cvs1:/tmp/cvs-serv7609/libvo
Modified Files:
vo_svga.c
Log Message:
Mode detect bugfix.
Index: vo_svga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_svga.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** vo_svga.c 2001/04/05 19:44:54 1.3
--- vo_svga.c 2001/04/05 20:42:24 1.4
***************
*** 53,56 ****
--- 53,57 ----
static uint8_t vid_modes[VID_MODE_NUM];
+ static vid_mode_nums[VID_MODE_NUM] = {17,18,19,34,20,21,22,35,23,24,25,36};
static uint8_t vid_mode;
***************
*** 66,70 ****
vga_disabledriverreport();
for (i = 0; i < VID_MODE_NUM; i++) {
! if (vga_hasmode(i) > 0)
vid_modes[i] = 1;
else vid_modes[i] = 0;
--- 67,71 ----
vga_disabledriverreport();
for (i = 0; i < VID_MODE_NUM; i++) {
! if (vga_hasmode(vid_mode_nums[i]) > 0)
vid_modes[i] = 1;
else vid_modes[i] = 0;
_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog(a)lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog
1
0
Update of /cvsroot/mplayer/main
In directory usw-pr-cvs1:/tmp/cvs-serv1178
Modified Files:
configure
Log Message:
vga<->vgagl swapped
Index: configure
===================================================================
RCS file: /cvsroot/mplayer/main/configure,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** configure 2001/04/05 19:02:02 1.14
--- configure 2001/04/05 20:03:26 1.15
***************
*** 362,366 ****
$_cc $TMPC -o $TMPO $_x11libdir/ -lGL &> /dev/null && _gl=yes
$_cc $TMPC -o $TMPO $_x11libdir/ -lXxf86vm &> /dev/null && _vm=yes
! $_cc $TMPC -o $TMPO -lvga -lvgagl &> /dev/null && _svga=yes
$_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext &> /dev/null && _x11=yes
$_cc $TMPC -o $TMPO $_x11libdir -lXv &> /dev/null && _xv=yes
--- 362,366 ----
$_cc $TMPC -o $TMPO $_x11libdir/ -lGL &> /dev/null && _gl=yes
$_cc $TMPC -o $TMPO $_x11libdir/ -lXxf86vm &> /dev/null && _vm=yes
! $_cc $TMPC -o $TMPO -lvgagl -lvga &> /dev/null && _svga=yes
$_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext &> /dev/null && _x11=yes
$_cc $TMPC -o $TMPO $_x11libdir -lXv &> /dev/null && _xv=yes
***************
*** 611,615 ****
if [ $_svga = yes ]; then
! _svgalib='-lvga -lvgagl'
fi
--- 611,615 ----
if [ $_svga = yes ]; then
! _svgalib='-lvgagl -lvga'
fi
_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog(a)lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog
1
0