Mercurial > mplayer.hg
changeset 4624:080882dddb2e
fixedsize video samples fixed (dvntsc-qt.mov)
author | arpi |
---|---|
date | Sun, 10 Feb 2002 00:45:56 +0000 |
parents | 513f4e2a2153 |
children | c8e09e9b830b |
files | libmpdemux/demux_mov.c |
diffstat | 1 files changed, 17 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/libmpdemux/demux_mov.c Sun Feb 10 00:43:31 2002 +0000 +++ b/libmpdemux/demux_mov.c Sun Feb 10 00:45:56 2002 +0000 @@ -53,6 +53,13 @@ unsigned int dur; } mov_durmap_t; +#define MOV_TRAK_UNKNOWN 0 +#define MOV_TRAK_VIDEO 1 +#define MOV_TRAK_AUDIO 2 +#define MOV_TRAK_FLASH 3 +#define MOV_TRAK_GENERIC 4 +#define MOV_TRAK_CODE 5 + typedef struct { int id; int type; @@ -132,6 +139,15 @@ s+=trak->chunks[j].size; } + // workaround for fixed-size video frames (dv and uncompressed) + if(!trak->samples_size && trak->type==MOV_TRAK_VIDEO){ + trak->samples_size=s; + trak->samples=malloc(sizeof(mov_sample_t)*s); + for(i=0;i<s;i++) + trak->samples[i].size=trak->samplesize; + trak->samplesize=0; + } + if(!trak->samples_size){ // constant sampesize if(trak->durmap_size==1 || (trak->durmap_size==2 && trak->durmap[1].num==1)){ @@ -169,13 +185,6 @@ #define MOV_MAX_TRACKS 256 -#define MOV_TRAK_UNKNOWN 0 -#define MOV_TRAK_VIDEO 1 -#define MOV_TRAK_AUDIO 2 -#define MOV_TRAK_FLASH 3 -#define MOV_TRAK_GENERIC 4 -#define MOV_TRAK_CODE 5 - typedef struct { off_t moov_start; off_t moov_end; @@ -945,7 +954,7 @@ else x=trak->chunks[trak->pos].size; // printf("X = %d\n", x); - if(trak->stdata_len>=36){ + 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 // x*=(trak->stdata[34]<<8)+trak->stdata[35]; // bytes/packet