mirror of
https://github.com/mpv-player/mpv
synced 2024-12-20 13:52:10 +00:00
100l... ogg-in-avi (type 0xFFFE) fix
sizeof(WAVEFORMATEX) is 18, since i've fixed struct align, so 2*sizeof(WAVEFORMATEX) is !=40 any more. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9164 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
40f4145098
commit
a5fe487b50
@ -837,15 +837,16 @@ demuxer_t* init_avi_with_ogg(demuxer_t* demuxer) {
|
|||||||
int plen;
|
int plen;
|
||||||
|
|
||||||
/// Check that the cbSize is enouth big for the following reads
|
/// Check that the cbSize is enouth big for the following reads
|
||||||
if(sh_audio->wf->cbSize < 3*sizeof(uint32_t)) {
|
if(sh_audio->wf->cbSize < 22+3*sizeof(uint32_t)) {
|
||||||
mp_msg(MSGT_DEMUX,MSGL_ERR,"AVI OGG : Initial audio header is too small !!!!!\n");
|
mp_msg(MSGT_DEMUX,MSGL_ERR,"AVI OGG : Initial audio header is too small !!!!!\n");
|
||||||
goto fallback;
|
goto fallback;
|
||||||
}
|
}
|
||||||
/// Get the size of the 3 header packet
|
/// Get the size of the 3 header packet
|
||||||
memcpy(hdrsizes, ((unsigned char*)sh_audio->wf)+2*sizeof(WAVEFORMATEX), 3*sizeof(uint32_t));
|
memcpy(hdrsizes, ((unsigned char*)sh_audio->wf)+22+sizeof(WAVEFORMATEX), 3*sizeof(uint32_t));
|
||||||
|
// printf("\n!!!!!! hdr sizes: %d %d %d \n",hdrsizes[0],hdrsizes[1],hdrsizes[2]);
|
||||||
|
|
||||||
/// Check the size
|
/// Check the size
|
||||||
if(sh_audio->wf->cbSize < 3*sizeof(uint32_t) + sizeof(uint32_t)+hdrsizes[0]+hdrsizes[1] + hdrsizes[2]) {
|
if(sh_audio->wf->cbSize < 22+3*sizeof(uint32_t)+hdrsizes[0]+hdrsizes[1] + hdrsizes[2]) {
|
||||||
mp_msg(MSGT_DEMUX,MSGL_ERR,"AVI OGG : Audio header is too small !!!!!\n");
|
mp_msg(MSGT_DEMUX,MSGL_ERR,"AVI OGG : Audio header is too small !!!!!\n");
|
||||||
goto fallback;
|
goto fallback;
|
||||||
}
|
}
|
||||||
@ -885,15 +886,15 @@ demuxer_t* init_avi_with_ogg(demuxer_t* demuxer) {
|
|||||||
/// Add the header packets in the ogg demuxer audio stream
|
/// Add the header packets in the ogg demuxer audio stream
|
||||||
// Initial header
|
// Initial header
|
||||||
dp = new_demux_packet(hdrsizes[0]);
|
dp = new_demux_packet(hdrsizes[0]);
|
||||||
memcpy(dp->buffer,((unsigned char*)sh_audio->wf)+2*sizeof(WAVEFORMATEX)+3*sizeof(uint32_t),hdrsizes[0]);
|
memcpy(dp->buffer,((unsigned char*)sh_audio->wf)+22+sizeof(WAVEFORMATEX)+3*sizeof(uint32_t),hdrsizes[0]);
|
||||||
ds_add_packet(od->audio,dp);
|
ds_add_packet(od->audio,dp);
|
||||||
/// Comments
|
/// Comments
|
||||||
dp = new_demux_packet(hdrsizes[1]);
|
dp = new_demux_packet(hdrsizes[1]);
|
||||||
memcpy(dp->buffer,((unsigned char*)sh_audio->wf)+2*sizeof(WAVEFORMATEX)+3*sizeof(uint32_t)+hdrsizes[0],hdrsizes[1]);
|
memcpy(dp->buffer,((unsigned char*)sh_audio->wf)+22+sizeof(WAVEFORMATEX)+3*sizeof(uint32_t)+hdrsizes[0],hdrsizes[1]);
|
||||||
ds_add_packet(od->audio,dp);
|
ds_add_packet(od->audio,dp);
|
||||||
/// Code book
|
/// Code book
|
||||||
dp = new_demux_packet(hdrsizes[2]);
|
dp = new_demux_packet(hdrsizes[2]);
|
||||||
memcpy(dp->buffer,((unsigned char*)sh_audio->wf)+2*sizeof(WAVEFORMATEX)+3*sizeof(uint32_t)+hdrsizes[0]+hdrsizes[1],hdrsizes[2]);
|
memcpy(dp->buffer,((unsigned char*)sh_audio->wf)+22+sizeof(WAVEFORMATEX)+3*sizeof(uint32_t)+hdrsizes[0]+hdrsizes[1],hdrsizes[2]);
|
||||||
ds_add_packet(od->audio,dp);
|
ds_add_packet(od->audio,dp);
|
||||||
|
|
||||||
// Finish setting up the ogg demuxer
|
// Finish setting up the ogg demuxer
|
||||||
|
Loading…
Reference in New Issue
Block a user