Revision 1305a9d5 libavformat/asf.c

View differences:

libavformat/asf.c
1141 1141
	    DO_2BITS(asf->packet_property, asf->packet_replic_size, 0);
1142 1142
//printf("key:%d stream:%d seq:%d offset:%d replic_size:%d\n", asf->packet_key_frame, asf->stream_index, asf->packet_seq, //asf->packet_frag_offset, asf->packet_replic_size);
1143 1143
	    if (asf->packet_replic_size > 1) {
1144
                assert(asf->packet_replic_size >= 8);
1144 1145
                // it should be always at least 8 bytes - FIXME validate
1145 1146
		asf->packet_obj_size = get_le32(pb);
1146 1147
		asf->packet_frag_timestamp = get_le32(pb); // timestamp
1147 1148
		if (asf->packet_replic_size > 8)
1148 1149
		    url_fskip(pb, asf->packet_replic_size - 8);
1149 1150
		rsize += asf->packet_replic_size; // FIXME - check validity
1150
	    } else {
1151
	    } else if (asf->packet_replic_size==1){
1151 1152
		// multipacket - frag_offset is begining timestamp
1152 1153
		asf->packet_time_start = asf->packet_frag_offset;
1153 1154
                asf->packet_frag_offset = 0;
1154 1155
		asf->packet_frag_timestamp = asf->packet_timestamp;
1155 1156

  
1156
		if (asf->packet_replic_size == 1) {
1157
		    asf->packet_time_delta = get_byte(pb);
1158
		    rsize++;
1159
		}
1160
	    }
1157
                asf->packet_time_delta = get_byte(pb);
1158
		rsize++;
1159
	    }else{
1160
                assert(asf->packet_replic_size==0);
1161
            }
1161 1162
	    if (asf->packet_flags & 0x01) {
1162 1163
		DO_2BITS(asf->packet_segsizetype >> 6, asf->packet_frag_size, 0); // 0 is illegal
1163 1164
#undef DO_2BITS
......
1232 1233
	    asf_st->seq = asf->packet_seq;
1233 1234
	    asf_st->pkt.pts = asf->packet_frag_timestamp - asf->hdr.preroll;
1234 1235
	    asf_st->pkt.stream_index = asf->stream_index;
1235
            asf_st->packet_pos= asf->packet_pos;
1236
//printf("new packet: stream:%d key:%d packet_key:%d audio:%d\n", 
1236
            asf_st->packet_pos= asf->packet_pos;            
1237
//printf("new packet: stream:%d key:%d packet_key:%d audio:%d size:%d\n", 
1237 1238
//asf->stream_index, asf->packet_key_frame, asf_st->pkt.flags & PKT_FLAG_KEY,
1238
//s->streams[asf->stream_index]->codec.codec_type == CODEC_TYPE_AUDIO);
1239
//s->streams[asf->stream_index]->codec.codec_type == CODEC_TYPE_AUDIO, asf->packet_obj_size);
1239 1240
	    if (s->streams[asf->stream_index]->codec.codec_type == CODEC_TYPE_AUDIO) 
1240 1241
		asf->packet_key_frame = 1;
1241 1242
	    if (asf->packet_key_frame)

Also available in: Unified diff