* "Real" compatible demuxer.
* Copyright (c) 2000, 2001 Fabrice Bellard
*
- * This file is part of FFmpeg.
+ * This file is part of Libav.
*
- * FFmpeg is free software; you can redistribute it and/or
+ * Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
- * FFmpeg is distributed in the hope that it will be useful,
+ * Libav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
if (version == 3) {
int header_size = avio_rb16(pb);
int64_t startpos = avio_tell(pb);
- avio_seek(pb, 14, SEEK_CUR);
+ avio_skip(pb, 14);
rm_read_metadata(s, 0);
if ((startpos + header_size) >= avio_tell(pb) + 2) {
// fourcc (should always be "lpcJ")
}
// Skip extra header crap (this should never happen)
if ((startpos + header_size) > avio_tell(pb))
- avio_seek(pb, header_size + startpos - avio_tell(pb), SEEK_CUR);
+ avio_skip(pb, header_size + startpos - avio_tell(pb));
st->codec->sample_rate = 8000;
st->codec->channels = 1;
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
int flavor, sub_packet_h, coded_framesize, sub_packet_size;
int codecdata_length;
/* old version (4) */
- avio_seek(pb, 2, SEEK_CUR); /* unused */
+ avio_skip(pb, 2); /* unused */
avio_rb32(pb); /* .ra4 */
avio_rb32(pb); /* data size */
avio_rb16(pb); /* version2 */
if (rm_read_audio_stream_info(s, pb, st, rst, 0))
return -1;
} else {
- int fps, fps2;
+ int fps;
if (avio_rl32(pb) != MKTAG('V', 'I', 'D', 'O')) {
fail1:
av_log(st->codec, AV_LOG_ERROR, "Unsupported video codec\n");
fps= avio_rb16(pb);
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
avio_rb32(pb);
- fps2= avio_rb16(pb);
+ avio_skip(pb, 2);
avio_rb16(pb);
if ((ret = rm_read_extradata(pb, st->codec, codec_data_size - (avio_tell(pb) - codec_pos))) < 0)
skip:
/* skip codec info */
size = avio_tell(pb) - codec_pos;
- avio_seek(pb, codec_data_size - size, SEEK_CUR);
+ avio_skip(pb, codec_data_size - size);
return 0;
}
size = avio_rb32(pb);
if (size < 20)
return -1;
- avio_seek(pb, 2, SEEK_CUR);
+ avio_skip(pb, 2);
n_pkts = avio_rb32(pb);
str_id = avio_rb16(pb);
next_off = avio_rb32(pb);
goto skip;
for (n = 0; n < n_pkts; n++) {
- avio_seek(pb, 2, SEEK_CUR);
+ avio_skip(pb, 2);
pts = avio_rb32(pb);
pos = avio_rb32(pb);
- avio_seek(pb, 4, SEEK_CUR); /* packet no. */
+ avio_skip(pb, 4); /* packet no. */
av_add_index_entry(st, pos, pts, 0, 0, AVINDEX_KEYFRAME);
}
avio_rb32(pb); /* number of headers */
for(;;) {
- if (url_feof(pb))
+ if (pb->eof_reached)
return -1;
tag = avio_rl32(pb);
tag_size = avio_rb32(pb);
avio_rb16(pb);
-#if 0
- printf("tag=%c%c%c%c (%08x) size=%d\n",
- (tag) & 0xff,
- (tag >> 8) & 0xff,
- (tag >> 16) & 0xff,
- (tag >> 24) & 0xff,
- tag,
- tag_size);
-#endif
+ av_dlog(s, "tag=%c%c%c%c (%08x) size=%d\n",
+ (tag ) & 0xff,
+ (tag >> 8) & 0xff,
+ (tag >> 16) & 0xff,
+ (tag >> 24) & 0xff,
+ tag,
+ tag_size);
if (tag_size < 10 && tag != MKTAG('D', 'A', 'T', 'A'))
return -1;
switch(tag) {
goto header_end;
default:
/* unknown tag: skip it */
- avio_seek(pb, tag_size - 10, SEEK_CUR);
+ avio_skip(pb, tag_size - 10);
break;
}
}
if (!data_off)
data_off = avio_tell(pb) - 18;
- if (indx_off && !url_is_streamed(pb) && !(s->flags & AVFMT_FLAG_IGNIDX) &&
+ if (indx_off && pb->seekable && !(s->flags & AVFMT_FLAG_IGNIDX) &&
avio_seek(pb, indx_off, SEEK_SET) >= 0) {
rm_read_index(s);
avio_seek(pb, data_off + 18, SEEK_SET);
AVStream *st;
uint32_t state=0xFFFFFFFF;
- while(!url_feof(pb)){
+ while(!pb->eof_reached){
int len, num, i;
*pos= avio_tell(pb) - 3;
if(rm->remaining_len > 0){
if(state == MKBETAG('I', 'N', 'D', 'X')){
int n_pkts, expected_len;
len = avio_rb32(pb);
- avio_seek(pb, 2, SEEK_CUR);
+ avio_skip(pb, 2);
n_pkts = avio_rb32(pb);
expected_len = 20 + n_pkts * 14;
if (len == 20)
if (i == s->nb_streams) {
skip:
/* skip packet if unknown number */
- avio_seek(pb, len, SEEK_CUR);
+ avio_skip(pb, len);
rm->remaining_len = 0;
continue;
}
st = s->streams[i];
}
- if(len<0 || url_feof(s->pb))
+ if(len<0 || s->pb->eof_reached)
return AVERROR(EIO);
res = ff_rm_parse_packet (s, s->pb, st, st->priv_data, len, pkt,
break;
}
- avio_seek(s->pb, len, SEEK_CUR);
+ avio_skip(s->pb, len);
}
*ppos = pos;
return dts;