summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
authorrtognimp <rtognimp@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-01-22 00:06:59 +0000
committerrtognimp <rtognimp@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-01-22 00:06:59 +0000
commit3cee5fc6918b40309b514726f06f9d722bfad48e (patch)
tree1547efbb4ece32c71224617ff9df685901c4195d /libmpdemux
parent09b8a53e164afcc435ab48a4c5228efed0221928 (diff)
downloadmpv-3cee5fc6918b40309b514726f06f9d722bfad48e.tar.bz2
mpv-3cee5fc6918b40309b514726f06f9d722bfad48e.tar.xz
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
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/demux_real.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/libmpdemux/demux_real.c b/libmpdemux/demux_real.c
index 86c16b89cd..111998b507 100644
--- a/libmpdemux/demux_real.c
+++ b/libmpdemux/demux_real.c
@@ -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);
/* emulate BITMAPINFOHEADER */
- sh->bih = malloc(sizeof(BITMAPINFOHEADER)+12);
- memset(sh->bih, 0, sizeof(BITMAPINFOHEADER)+12);
+ sh->bih = malloc(sizeof(BITMAPINFOHEADER)+16);
+ memset(sh->bih, 0, sizeof(BITMAPINFOHEADER)+16);
sh->bih->biSize = 48;
sh->disp_w = sh->bih->biWidth = 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)){
- // read secondary WxH for the cmsg24[] (see vd_realvid.c)
- ((unsigned short*)(sh->bih+1))[4]=4*(unsigned short)stream_read_char(demuxer->stream); //widht
- ((unsigned short*)(sh->bih+1))[5]=4*(unsigned short)stream_read_char(demuxer->stream); //height
+ // read data for the cmsg24[] (see vd_realvid.c)
+ unsigned int cnt = codec_data_size - (stream_tell(demuxer->stream) - codec_pos);
+ 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*/