diff options
author | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-10-31 23:16:27 +0000 |
---|---|---|
committer | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-10-31 23:16:27 +0000 |
commit | 2605ca58e18e81f2586b93e67e63b6a8bea413b3 (patch) | |
tree | 2ef8e960e5208b86eb23c15eeee0660c2743c315 /libmpdemux | |
parent | fcb0620032f646ca6b1958ed059ae46784cd4e9f (diff) | |
download | mpv-2605ca58e18e81f2586b93e67e63b6a8bea413b3.tar.bz2 mpv-2605ca58e18e81f2586b93e67e63b6a8bea413b3.tar.xz |
set up nBlockAlign, nBytesPerSec correctly if extended audio header avail.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8010 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/demux_mov.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libmpdemux/demux_mov.c b/libmpdemux/demux_mov.c index b8ab7c936b..6580ca0cd7 100644 --- a/libmpdemux/demux_mov.c +++ b/libmpdemux/demux_mov.c @@ -865,7 +865,15 @@ static void lschunks(demuxer_t* demuxer,int level,off_t endpos,mov_track_t* trak sh->wf->wBitsPerSample=(trak->stdata[18]<<8)+trak->stdata[19]; // sh->wf->nSamplesPerSec=trak->timescale; sh->wf->nSamplesPerSec=(trak->stdata[24]<<8)+trak->stdata[25]; - sh->wf->nAvgBytesPerSec=sh->wf->nChannels*sh->wf->wBitsPerSample*sh->wf->nSamplesPerSec/8; + if(trak->stdata_len >= 44 && trak->stdata[9]>=1){ + //Audio header: samp/pack=4096 bytes/pack=743 bytes/frame=1486 bytes/samp=2 + sh->wf->nAvgBytesPerSec=(sh->wf->nChannels*sh->wf->nSamplesPerSec* + char2int(trak->stdata,32)+char2int(trak->stdata,28)/2) + /char2int(trak->stdata,28); + sh->wf->nBlockAlign=char2int(trak->stdata,36); + } else { + sh->wf->nAvgBytesPerSec=sh->wf->nChannels*sh->wf->wBitsPerSample*sh->wf->nSamplesPerSec/8; + } // Selection: if(demuxer->audio->id==-1 || demuxer->audio->id==priv->track_db){ // (auto)selected audio track: |