mirror of
https://github.com/mpv-player/mpv.git
synced 2026-10-28 23:13:18 +08:00
compressed mov audio fixed
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2420 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
@@ -548,10 +548,14 @@ int demux_mov_fill_buffer(demuxer_t *demuxer,demux_stream_t* ds){
|
||||
|
||||
if(trak->samplesize){
|
||||
// read chunk:
|
||||
int x;
|
||||
if(trak->pos>=trak->chunks_size) return 0; // EOF
|
||||
stream_seek(demuxer->stream,trak->chunks[trak->pos].pos);
|
||||
pts=(float)(trak->chunks[trak->pos].sample*trak->duration)/(float)trak->timescale;
|
||||
ds_read_packet(ds,demuxer->stream,trak->chunks[trak->pos].size*trak->samplesize,pts,trak->chunks[trak->pos].pos,0);
|
||||
x=trak->chunks[trak->pos].size*trak->samplesize;
|
||||
x/=ds->ss_div; x*=ds->ss_mul; // compression ratio fix
|
||||
ds_read_packet(ds,demuxer->stream,x,pts,trak->chunks[trak->pos].pos,0);
|
||||
if(ds==demuxer->audio) printf("sample %d bytes pts %5.3f\n",trak->chunks[trak->pos].size*trak->samplesize,pts);
|
||||
} else {
|
||||
// read sample:
|
||||
if(trak->pos>=trak->samples_size) return 0; // EOF
|
||||
|
||||
@@ -39,6 +39,8 @@ demux_stream_t* new_demuxer_stream(struct demuxer_st *demuxer,int id){
|
||||
//----------------
|
||||
ds->asf_seq=-1;
|
||||
ds->asf_packet=NULL;
|
||||
//----------------
|
||||
ds->ss_mul=ds->ss_div=1;
|
||||
//----------------
|
||||
ds->sh=NULL;
|
||||
return ds;
|
||||
|
||||
@@ -50,6 +50,8 @@ typedef struct {
|
||||
// ---- asf -----
|
||||
demux_packet_t *asf_packet; // read asf fragments here
|
||||
int asf_seq;
|
||||
// ---- mov -----
|
||||
unsigned int ss_mul,ss_div;
|
||||
// ---- stream header ----
|
||||
void* sh;
|
||||
} demux_stream_t;
|
||||
|
||||
Reference in New Issue
Block a user