Mercurial > mplayer.hg
comparison libmpdemux/demux_mov.c @ 25359:4bb08145bf66
Set correct image format for 24bit "raw " in mov files.
Patch by Chas Williams, chas A cmf D nrl D navy D mil
author | cehoyos |
---|---|
date | Fri, 14 Dec 2007 07:14:33 +0000 |
parents | 7e5e6eff5a4f |
children | 574ff7687644 |
comparison
equal
deleted
inserted
replaced
25358:89b3a18bfa66 | 25359:4bb08145bf66 |
---|---|
37 #include "help_mp.h" | 37 #include "help_mp.h" |
38 | 38 |
39 #include "stream/stream.h" | 39 #include "stream/stream.h" |
40 #include "demuxer.h" | 40 #include "demuxer.h" |
41 #include "stheader.h" | 41 #include "stheader.h" |
42 | |
43 #include "libmpcodecs/img_format.h" | |
42 | 44 |
43 #include "libvo/sub.h" | 45 #include "libvo/sub.h" |
44 | 46 |
45 #include "qtpalette.h" | 47 #include "qtpalette.h" |
46 #include "parse_mp4.h" // .MP4 specific stuff | 48 #include "parse_mp4.h" // .MP4 specific stuff |
927 static int gen_sh_video(sh_video_t* sh, mov_track_t* trak, int timescale) { | 929 static int gen_sh_video(sh_video_t* sh, mov_track_t* trak, int timescale) { |
928 int depth, i, entry; | 930 int depth, i, entry; |
929 int flag, start, count_flag, end, palette_count, gray; | 931 int flag, start, count_flag, end, palette_count, gray; |
930 int hdr_ptr = 76; // the byte just after depth | 932 int hdr_ptr = 76; // the byte just after depth |
931 unsigned char *palette_map; | 933 unsigned char *palette_map; |
934 | |
935 depth = trak->stdata[75] | (trak->stdata[74] << 8); | |
936 if (trak->fourcc == mmioFOURCC('r', 'a', 'w', ' ')) { | |
937 sh->format = IMGFMT_RGB | depth; | |
938 } else | |
932 sh->format=trak->fourcc; | 939 sh->format=trak->fourcc; |
933 | 940 |
934 // crude video delay from editlist0 hack ::atm | 941 // crude video delay from editlist0 hack ::atm |
935 if(trak->editlist_size>=1) { | 942 if(trak->editlist_size>=1) { |
936 if(trak->editlist[0].pos == -1) { | 943 if(trak->editlist[0].pos == -1) { |
944 mp_msg(MSGT_DEMUXER, MSGL_WARN, | 951 mp_msg(MSGT_DEMUXER, MSGL_WARN, |
945 "MOV: Invalid (%d bytes instead of >= 78) video trak desc\n", | 952 "MOV: Invalid (%d bytes instead of >= 78) video trak desc\n", |
946 trak->stdata_len); | 953 trak->stdata_len); |
947 return 0; | 954 return 0; |
948 } | 955 } |
949 depth = trak->stdata[75] | (trak->stdata[74] << 8); | |
950 // stdata[]: | 956 // stdata[]: |
951 // 8 short version | 957 // 8 short version |
952 // 10 short revision | 958 // 10 short revision |
953 // 12 int vendor_id | 959 // 12 int vendor_id |
954 // 16 int temporal_quality | 960 // 16 int temporal_quality |