1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-31 12:11:52 +00:00

added nmhd, added checking for audio trak in demux_mov_fill_buffer

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4646 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
alex 2002-02-10 18:31:12 +00:00
parent e9063eed00
commit d1446f072f

View File

@ -338,6 +338,11 @@ static void lschunks(demuxer_t* demuxer,int level,off_t endpos,mov_track_t* trak
trak->type=MOV_TRAK_GENERIC;
break;
}
case MOV_FOURCC('n','m','h','d'): {
mp_msg(MSGT_DEMUX,MSGL_V,"MOV: %*sGeneric header!\n",level,"");
trak->type=MOV_TRAK_GENERIC;
break;
}
case MOV_FOURCC('s','t','s','d'): {
int i=stream_read_dword(demuxer->stream); // temp!
int count=stream_read_dword(demuxer->stream);
@ -947,13 +952,16 @@ if(trak->samplesize){
pts=(float)(trak->chunks[trak->pos].sample*trak->duration)/(float)trak->timescale;
if(trak->samplesize!=1)
{
mp_msg(MSGT_DEMUX, MSGL_WARN, "WARNING! Samplesize(%d) != 1\n",
mp_msg(MSGT_DEMUX, MSGL_DBG2, "WARNING! Samplesize(%d) != 1\n",
trak->samplesize);
x=trak->chunks[trak->pos].size*trak->samplesize;
}
else
x=trak->chunks[trak->pos].size;
// printf("X = %d\n", x);
/* the following stuff is audio related */
if (trak->type == MOV_TRAK_AUDIO)
{
if(trak->stdata_len>=36 && trak->stdata[30] && trak->stdata[31]){
// extended stsd header - works for CBR MP3:
x/=(trak->stdata[30]<<8)+trak->stdata[31]; // samples/packet
@ -967,6 +975,7 @@ if(trak->samplesize){
x*=(trak->stdata[18]<<8)+trak->stdata[19];x/=8; // bits/sample
}
}
} /* MOV_TRAK_AUDIO */
ds_read_packet(ds,demuxer->stream,x,pts,trak->chunks[trak->pos].pos,0);
if(ds==demuxer->audio) mp_msg(MSGT_DEMUX, MSGL_DBG2, "sample %d bytes pts %5.3f\n",trak->chunks[trak->pos].size*trak->samplesize,pts);
} else {