Play RV30 with 8-elements cmsg24

Fixes rv30_cmsg24_test.rmvb (now in samples)


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14569 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
rtognimp 2005-01-22 00:06:59 +00:00
parent 09b8a53e16
commit 3cee5fc691
2 changed files with 19 additions and 6 deletions

View File

@ -253,7 +253,10 @@ static int init(sh_video_t *sh){
} }
// setup rv30 codec (codec sub-type and image dimensions): // setup rv30 codec (codec sub-type and image dimensions):
if((sh->format<=0x30335652) && (extrahdr[1]>=0x20200002)){ if((sh->format<=0x30335652) && (extrahdr[1]>=0x20200002)){
uint32_t cmsg24[4]={sh->disp_w,sh->disp_h,((unsigned short *)extrahdr)[4],((unsigned short *)extrahdr)[5]}; // We could read nonsense data while filling this, but input is big enough so no sig11
uint32_t cmsg24[8]={sh->disp_w,sh->disp_h,((unsigned char *)extrahdr)[8]*4,((unsigned char *)extrahdr)[9]*4,
((unsigned char *)extrahdr)[10]*4,((unsigned char *)extrahdr)[11]*4,
((unsigned char *)extrahdr)[12]*4,((unsigned char *)extrahdr)[13]*4};
cmsg_data_t cmsg_data={0x24,1+((extrahdr[0]>>16)&7), &cmsg24[0]}; cmsg_data_t cmsg_data={0x24,1+((extrahdr[0]>>16)&7), &cmsg24[0]};
#ifdef USE_WIN32DLL #ifdef USE_WIN32DLL

View File

@ -1447,8 +1447,8 @@ void demux_open_real(demuxer_t* demuxer)
mp_msg(MSGT_DEMUX,MSGL_V,"video fourcc: %.4s (%x)\n", (char *)&sh->format, sh->format); mp_msg(MSGT_DEMUX,MSGL_V,"video fourcc: %.4s (%x)\n", (char *)&sh->format, sh->format);
/* emulate BITMAPINFOHEADER */ /* emulate BITMAPINFOHEADER */
sh->bih = malloc(sizeof(BITMAPINFOHEADER)+12); sh->bih = malloc(sizeof(BITMAPINFOHEADER)+16);
memset(sh->bih, 0, sizeof(BITMAPINFOHEADER)+12); memset(sh->bih, 0, sizeof(BITMAPINFOHEADER)+16);
sh->bih->biSize = 48; sh->bih->biSize = 48;
sh->disp_w = sh->bih->biWidth = stream_read_word(demuxer->stream); sh->disp_w = sh->bih->biWidth = stream_read_word(demuxer->stream);
sh->disp_h = sh->bih->biHeight = stream_read_word(demuxer->stream); sh->disp_h = sh->bih->biHeight = stream_read_word(demuxer->stream);
@ -1517,9 +1517,19 @@ void demux_open_real(demuxer_t* demuxer)
} }
if((sh->format<=0x30335652) && (tmp>=0x20200002)){ if((sh->format<=0x30335652) && (tmp>=0x20200002)){
// read secondary WxH for the cmsg24[] (see vd_realvid.c) // read data for the cmsg24[] (see vd_realvid.c)
((unsigned short*)(sh->bih+1))[4]=4*(unsigned short)stream_read_char(demuxer->stream); //widht unsigned int cnt = codec_data_size - (stream_tell(demuxer->stream) - codec_pos);
((unsigned short*)(sh->bih+1))[5]=4*(unsigned short)stream_read_char(demuxer->stream); //height if (cnt < 2) {
mp_msg(MSGT_DEMUX, MSGL_ERR,"realvid: cmsg24 data too short (size %u)\n", cnt);
} else {
int ii;
if (cnt > 6) {
mp_msg(MSGT_DEMUX, MSGL_WARN,"realvid: cmsg24 data too big, please report (size %u)\n", cnt);
cnt = 6;
}
for (ii = 0; ii < cnt; ii++)
((unsigned char*)(sh->bih+1))[8+ii]=(unsigned short)stream_read_char(demuxer->stream);
}
} }
/* Select video stream with highest bitrate if multirate file*/ /* Select video stream with highest bitrate if multirate file*/