uint64_t state=0;
if(pos >= 0)
- url_fseek(bc, pos, SEEK_SET); //note, this may fail if the stream is not seekable, but that should not matter, as in this case we simply start where we are currently
+ url_fseek(bc, pos, SEEK_SET); //note, this may fail if the stream is not seekable, but that should not matter, as in this case we simply start where we currently are
while(!url_feof(bc)){
state= (state<<8) | get_byte(bc);
case 0:
st->codec->codec_type = CODEC_TYPE_VIDEO;
st->codec->codec_id = codec_get_id(codec_bmp_tags, tmp);
- if (st->codec->codec_id == CODEC_ID_NONE)
- av_log(s, AV_LOG_ERROR, "Unknown codec?!\n");
break;
case 1:
st->codec->codec_type = CODEC_TYPE_AUDIO;
st->codec->codec_id = codec_get_id(codec_wav_tags, tmp);
- if (st->codec->codec_id == CODEC_ID_NONE)
- av_log(s, AV_LOG_ERROR, "Unknown codec?!\n");
break;
case 2:
st->codec->codec_type = CODEC_TYPE_SUBTITLE;
-// st->codec->codec_id = codec_get_id(codec_wav_tags, tmp); FIXME
- if (st->codec->codec_id == CODEC_ID_NONE)
- av_log(s, AV_LOG_ERROR, "Unknown codec?!\n");
+ st->codec->codec_id = codec_get_id(ff_nut_subtitle_tags, tmp);
break;
case 3:
st->codec->codec_type = CODEC_TYPE_DATA;
av_log(s, AV_LOG_ERROR, "unknown stream class (%d)\n", class);
return -1;
}
+ if(class<3 && st->codec->codec_id == CODEC_ID_NONE)
+ av_log(s, AV_LOG_ERROR, "Unknown codec?!\n");
+
GET_V(stc->time_base_id , tmp < nut->time_base_count);
GET_V(stc->msb_pts_shift , tmp < 16);
stc->max_pts_distance= ff_get_v(bc);
return 0;
}
+static void set_disposition_bits(AVFormatContext* avf, char* value, int stream_id){
+ int flag = 0, i;
+ for (i=0; ff_nut_dispositions[i].flag; ++i) {
+ if (!strcmp(ff_nut_dispositions[i].str, value))
+ flag = ff_nut_dispositions[i].flag;
+ }
+ if (!flag)
+ av_log(avf, AV_LOG_INFO, "unknown disposition type '%s'\n", value);
+ for (i = 0; i < avf->nb_streams; ++i)
+ if (stream_id == i || stream_id == -1)
+ avf->streams[i]->disposition |= flag;
+}
+
static int decode_info_header(NUTContext *nut){
AVFormatContext *s= nut->avf;
ByteIOContext *bc = s->pb;
type= "v";
}
+ if (stream_id_plus1 < 0 || stream_id_plus1 > s->nb_streams) {
+ av_log(s, AV_LOG_ERROR, "invalid stream id for info packet\n");
+ continue;
+ }
+
if(chapter_id==0 && !strcmp(type, "UTF-8")){
if (!strcmp(name, "Author"))
av_strlcpy(s->author , str_value, sizeof(s->author));
av_strlcpy(s->copyright, str_value, sizeof(s->copyright));
else if(!strcmp(name, "Description"))
av_strlcpy(s->comment , str_value, sizeof(s->comment));
+ else if(!strcmp(name, "Disposition"))
+ set_disposition_bits(s, str_value, stream_id_plus1 - 1);
}
}
next_node[0]->back_ptr, next_node[1]->back_ptr, flags, &ts, nut_read_timestamp);
if(pos2>=0)
pos= pos2;
- //FIXME dir but i think it does not matter
+ //FIXME dir but I think it does not matter
}
dummy.pos= pos;
sp= av_tree_find(nut->syncpoints, &dummy, ff_nut_sp_pos_cmp, NULL);