summaryrefslogtreecommitdiffstats
path: root/libmpdemux/demux_mov.c
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-02-10 00:45:56 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-02-10 00:45:56 +0000
commit0d18dddced901c3a17c1229504e2990d6f61786b (patch)
tree5a1f44e86f00e25ad6da868e938d68be9da6f820 /libmpdemux/demux_mov.c
parent7acf931299daaa7feaf35e7a89e8ee61c5a18383 (diff)
downloadmpv-0d18dddced901c3a17c1229504e2990d6f61786b.tar.bz2
mpv-0d18dddced901c3a17c1229504e2990d6f61786b.tar.xz
fixedsize video samples fixed (dvntsc-qt.mov)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4625 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux/demux_mov.c')
-rw-r--r--libmpdemux/demux_mov.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/libmpdemux/demux_mov.c b/libmpdemux/demux_mov.c
index 7aacd44b4f..436e69f7f9 100644
--- a/libmpdemux/demux_mov.c
+++ b/libmpdemux/demux_mov.c
@@ -53,6 +53,13 @@ typedef struct {
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 @@ void mov_build_index(mov_track_t* trak){
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 @@ void mov_build_index(mov_track_t* trak){
#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 @@ if(trak->samplesize){
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