comparison mov.c @ 956:18bb4485996c libavformat

useless code removal by (Baptiste COUDURIER <baptiste.coudurier smartjog com)
author michael
date Mon, 13 Feb 2006 10:40:41 +0000
parents 8e5de2f2eece
children b0a6f09d8d38
comparison
equal deleted inserted replaced
955:8e5de2f2eece 956:18bb4485996c
883 883
884 /* These are set in mov_read_stts and might already be set! 884 /* These are set in mov_read_stts and might already be set!
885 st->codec->time_base.den = 25; 885 st->codec->time_base.den = 25;
886 st->codec->time_base.num = 1; 886 st->codec->time_base.num = 1;
887 */ 887 */
888 #if 0
889 while (size >= 8) {
890 MOV_atom_t a;
891 int64_t start_pos;
892
893 a.size = get_be32(pb);
894 a.type = get_le32(pb);
895 size -= 8;
896 #ifdef DEBUG
897 av_log(NULL, AV_LOG_DEBUG, "VIDEO: atom_type=%c%c%c%c atom.size=%Ld size_left=%d\n",
898 (a.type >> 0) & 0xff,
899 (a.type >> 8) & 0xff,
900 (a.type >> 16) & 0xff,
901 (a.type >> 24) & 0xff,
902 a.size, size);
903 #endif
904 start_pos = url_ftell(pb);
905
906 switch(a.type) {
907 case MKTAG('e', 's', 'd', 's'):
908 {
909 int tag, len;
910 /* Well, broken but suffisant for some MP4 streams */
911 get_be32(pb); /* version + flags */
912 len = mov_mp4_read_descr(pb, &tag);
913 if (tag == 0x03) {
914 /* MP4ESDescrTag */
915 get_be16(pb); /* ID */
916 get_byte(pb); /* priority */
917 len = mov_mp4_read_descr(pb, &tag);
918 if (tag != 0x04)
919 goto fail;
920 /* MP4DecConfigDescrTag */
921 get_byte(pb); /* objectTypeId */
922 get_be32(pb); /* streamType + buffer size */
923 get_be32(pb); /* max bit rate */
924 get_be32(pb); /* avg bit rate */
925 len = mov_mp4_read_descr(pb, &tag);
926 if (tag != 0x05)
927 goto fail;
928 /* MP4DecSpecificDescrTag */
929 sc->header_data = av_mallocz(len);
930 if (sc->header_data) {
931 get_buffer(pb, sc->header_data, len);
932 sc->header_len = len;
933 }
934 }
935 /* in any case, skip garbage */
936 }
937 break;
938 default:
939 break;
940 }
941 fail:
942 dprintf("ATOMENEWSIZE %Ld %d\n", atom.size, url_ftell(pb) - start_pos);
943 if (atom.size > 8) {
944 url_fskip(pb, (atom.size - 8) -
945 ((url_ftell(pb) - start_pos)));
946 size -= atom.size - 8;
947 }
948 }
949 if (size > 0) {
950 /* unknown extension */
951 url_fskip(pb, size);
952 }
953 #else
954 888
955 /* figure out the palette situation */ 889 /* figure out the palette situation */
956 color_depth = st->codec->bits_per_sample & 0x1F; 890 color_depth = st->codec->bits_per_sample & 0x1F;
957 color_greyscale = st->codec->bits_per_sample & 0x20; 891 color_greyscale = st->codec->bits_per_sample & 0x20;
958 892
1025 a.size = size - (url_ftell(pb) - start_pos); 959 a.size = size - (url_ftell(pb) - start_pos);
1026 if (a.size > 8) 960 if (a.size > 8)
1027 mov_read_default(c, pb, a); 961 mov_read_default(c, pb, a);
1028 else if (a.size > 0) 962 else if (a.size > 0)
1029 url_fskip(pb, a.size); 963 url_fskip(pb, a.size);
1030 #endif
1031 } else { 964 } else {
1032 st->codec->codec_id = codec_get_id(mov_audio_tags, format); 965 st->codec->codec_id = codec_get_id(mov_audio_tags, format);
1033 if(st->codec->codec_id==CODEC_ID_AMR_NB || st->codec->codec_id==CODEC_ID_AMR_WB) //from TS26.244 966 if(st->codec->codec_id==CODEC_ID_AMR_NB || st->codec->codec_id==CODEC_ID_AMR_WB) //from TS26.244
1034 { 967 {
1035 dprintf("AMR audio identified %d!!\n", st->codec->codec_id); 968 dprintf("AMR audio identified %d!!\n", st->codec->codec_id);
1677 int i, j, nb, err; 1610 int i, j, nb, err;
1678 MOV_atom_t atom = { 0, 0, 0 }; 1611 MOV_atom_t atom = { 0, 0, 0 };
1679 1612
1680 mov->fc = s; 1613 mov->fc = s;
1681 mov->parse_table = mov_default_parse_table; 1614 mov->parse_table = mov_default_parse_table;
1682 #if 0 1615
1683 /* XXX: I think we should auto detect */
1684 if(s->iformat->name[1] == 'p')
1685 mov->mp4 = 1;
1686 #endif
1687 if(!url_is_streamed(pb)) /* .mov and .mp4 aren't streamable anyway (only progressive download if moov is before mdat) */ 1616 if(!url_is_streamed(pb)) /* .mov and .mp4 aren't streamable anyway (only progressive download if moov is before mdat) */
1688 atom.size = url_fsize(pb); 1617 atom.size = url_fsize(pb);
1689 else 1618 else
1690 atom.size = 0x7FFFFFFFFFFFFFFFLL; 1619 atom.size = 0x7FFFFFFFFFFFFFFFLL;
1691 1620