if(signature == RLV3_TAG && back_size > 0)
st->codecpar->extradata_size += back_size;
- if(ff_get_extradata(s, st->codecpar, pb, st->codecpar->extradata_size) < 0)
- return AVERROR(ENOMEM);
+ ret = ff_get_extradata(s, st->codecpar, pb, st->codecpar->extradata_size);
+ if (ret < 0)
+ return ret;
/** setup audio stream if present */
if(sound_rate){
/** read offset and size tables */
for(i=0; i < frame_count;i++) {
- if (avio_feof(pb))
- return AVERROR_INVALIDDATA;
+ if (avio_feof(pb)) {
+ ret = AVERROR_INVALIDDATA;
+ goto end;
+ }
chunk_size[i] = avio_rl32(pb);
}
for(i=0; i < frame_count;i++) {
- if (avio_feof(pb))
- return AVERROR_INVALIDDATA;
+ if (avio_feof(pb)) {
+ ret = AVERROR_INVALIDDATA;
+ goto end;
+ }
chunk_offset[i] = avio_rl32(pb);
}
for(i=0; i < frame_count;i++) {
- if (avio_feof(pb))
- return AVERROR_INVALIDDATA;
+ if (avio_feof(pb)) {
+ ret = AVERROR_INVALIDDATA;
+ goto end;
+ }
audio_size[i] = avio_rl32(pb) & 0xFFFF;
}
++video_frame_counter;
}
-
+end:
av_free(chunk_size);
av_free(audio_size);
av_free(chunk_offset);
/** check if there is a valid video or audio entry that can be used */
for(i=0; i<s->nb_streams; i++){
- if(rl2->index_pos[i] < s->streams[i]->nb_index_entries
- && s->streams[i]->index_entries[ rl2->index_pos[i] ].pos < pos){
- sample = &s->streams[i]->index_entries[ rl2->index_pos[i] ];
+ if(rl2->index_pos[i] < s->streams[i]->internal->nb_index_entries
+ && s->streams[i]->internal->index_entries[ rl2->index_pos[i] ].pos < pos){
+ sample = &s->streams[i]->internal->index_entries[ rl2->index_pos[i] ];
pos= sample->pos;
stream_id= i;
}
/** fill the packet */
ret = av_get_packet(pb, pkt, sample->size);
if(ret != sample->size){
- av_packet_unref(pkt);
return AVERROR(EIO);
}
return -1;
rl2->index_pos[stream_index] = index;
- timestamp = st->index_entries[index].timestamp;
+ timestamp = st->internal->index_entries[index].timestamp;
for(i=0; i < s->nb_streams; i++){
AVStream *st2 = s->streams[i];
return 0;
}
-AVInputFormat ff_rl2_demuxer = {
+const AVInputFormat ff_rl2_demuxer = {
.name = "rl2",
.long_name = NULL_IF_CONFIG_SMALL("RL2"),
.priv_data_size = sizeof(Rl2DemuxContext),