asf->packet_size_left -= rsize;
//printf("___objsize____ %d %d rs:%d\n", asf->packet_obj_size, asf->packet_frag_offset, rsize);
- if (asf->stream_index < 0) {
+ if (asf->stream_index < 0 || s->streams[asf->stream_index]->discard) {
asf->packet_time_start = 0;
/* unhandled packet (should not happen) */
url_fskip(pb, asf->packet_frag_size);
asf->packet_size_left -= asf->packet_frag_size;
- av_log(s, AV_LOG_ERROR, "ff asf skip %d %d\n", asf->packet_frag_size, num & 0x7f);
+ if(asf->stream_index < 0)
+ av_log(s, AV_LOG_ERROR, "ff asf skip %d %d\n", asf->packet_frag_size, num & 0x7f);
continue;
}
asf->asf_st = s->streams[asf->stream_index]->priv_data;
st->codec.frame_rate_base= 1;
st->codec.frame_rate= 1000;
}
+ if(st->discard){
+ url_fskip(&s->pb, size);
+ continue;
+ }
break;
}
av_free(origdata);
break;
}
+ if(matroska->ctx->streams[ matroska->tracks[track]->stream_index ]->discard){
+ av_free(origdata);
+ break;
+ }
/* time (relative to cluster time) */
time = ((data[0] << 8) | data[1]) * matroska->time_scale;
}
//av_log(NULL, AV_LOG_DEBUG, "chunk: [%i] %lli -> %lli\n", st_id, mov->next_chunk_offset, offset);
- if(!sc->is_ff_stream) {
+ if(!sc->is_ff_stream || s->streams[sc->ffindex]->discard) {
url_fskip(&s->pb, (offset - mov->next_chunk_offset));
mov->next_chunk_offset = offset;
offset = 0x0FFFFFFFFFFFFFFFLL;
if (codec_id != CODEC_ID_PCM_S16BE)
st->need_parsing = 1;
found:
+ if(st->discard)
+ goto skip;
if (startcode >= 0xa0 && startcode <= 0xbf) {
int b1, freq;
pkt->dts = dts;
pkt->stream_index = st->index;
#if 0
- av_log(s, AV_LOG_DEBUG, "%d: pts=%0.3f dts=%0.3f\n",
- pkt->stream_index, pkt->pts / 90000.0, pkt->dts / 90000.0);
+ av_log(s, AV_LOG_DEBUG, "%d: pts=%0.3f dts=%0.3f size=%d\n",
+ pkt->stream_index, pkt->pts / 90000.0, pkt->dts / 90000.0, pkt->size);
#endif
return 0;
if(size < 0)
return -1;
+ if(s->streams[ stream_id ]->discard){
+ url_fskip(bc, size);
+ return 1;
+ }
+
av_new_packet(pkt, size);
get_buffer(bc, pkt->data, size);
pkt->stream_index = stream_id;
{
NUTContext *nut = s->priv_data;
ByteIOContext *bc = &s->pb;
- int i, frame_code=0;
+ int i, frame_code=0, ret;
for(;;){
int64_t pos= url_ftell(bc);
reset(s, get_v(bc));
frame_code = get_byte(bc);
case 0:
- if(decode_frame(nut, pkt, frame_code, frame_type, pos)>=0)
+ ret= decode_frame(nut, pkt, frame_code, frame_type, pos);
+ if(ret==0)
return 0;
+ else if(ret==1) //ok but discard packet
+ break;
default:
resync:
av_log(s, AV_LOG_DEBUG, "syncing from %lld\n", nut->packet_start[2]+1);
st = s->streams[0];
} else {
int seq=1;
-
+resync:
len=sync(s, ×tamp, &flags, &i, &pos);
if(len<0)
return AVERROR_IO;
len=len2;
rm->remaining_len-= len;
}
+
+ if(st->discard){
+ url_fskip(pb, len);
+ goto resync;
+ }
av_new_packet(pkt, len);
pkt->stream_index = i;
compute_pkt_fields(s, st, NULL, pkt);
s->cur_st = NULL;
return 0;
- } else if (s->cur_len > 0) {
+ } else if (s->cur_len > 0 && !st->discard) {
len = av_parser_parse(st->parser, &st->codec, &pkt->data, &pkt->size,
s->cur_ptr, s->cur_len,
s->cur_pkt.pts, s->cur_pkt.dts);