* FFM (ffserver live feed) demuxer
* Copyright (c) 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
*/
len = ffm->packet_end - ffm->packet_ptr;
if (size <= len)
return 1;
- pos = url_ftell(s->pb);
+ pos = avio_tell(s->pb);
if (!ffm->write_index) {
if (pos == ffm->file_size)
return AVERROR_EOF;
{
av_log(s, AV_LOG_ERROR, "resyncing\n");
while (state != PACKET_ID) {
- if (url_feof(s->pb)) {
+ if (s->pb->eof_reached) {
av_log(s, AV_LOG_ERROR, "cannot find FFM syncword\n");
return -1;
}
if (len > size)
len = size;
if (len == 0) {
- if (url_ftell(pb) == ffm->file_size)
+ if (avio_tell(pb) == ffm->file_size)
avio_seek(pb, ffm->packet_size, SEEK_SET);
retry_read:
id = avio_rb16(pb); /* PACKET_ID */
if (ffm->first_packet || (frame_offset & 0x8000)) {
if (!frame_offset) {
/* This packet has no frame headers in it */
- if (url_ftell(pb) >= ffm->packet_size * 3) {
+ if (avio_tell(pb) >= ffm->packet_size * 3) {
avio_seek(pb, -ffm->packet_size * 2, SEEK_CUR);
goto retry_read;
}
int64_t dts;
ffm_seek1(s, pos);
- avio_seek(pb, 4, SEEK_CUR);
+ avio_skip(pb, 4);
dts = avio_rb64(pb);
#ifdef DEBUG_SEEK
av_log(s, AV_LOG_DEBUG, "dts=%0.6f\n", dts / 1000000.0);
//int64_t orig_write_index = ffm->write_index;
int64_t pos_min, pos_max;
int64_t pts_start;
- int64_t ptr = url_ftell(pb);
+ int64_t ptr = avio_tell(pb);
pos_min = 0;
goto fail;
ffm->write_index = avio_rb64(pb);
/* get also filesize */
- if (!url_is_streamed(pb)) {
- ffm->file_size = url_fsize(pb);
+ if (pb->seekable) {
+ ffm->file_size = avio_size(pb);
if (ffm->write_index)
adjust_write_index(s);
} else {
}
/* get until end of block reached */
- while ((url_ftell(pb) % ffm->packet_size) != 0)
+ while ((avio_tell(pb) % ffm->packet_size) != 0)
avio_r8(pb);
/* init packet demux */
return ret;
av_dlog(s, "pos=%08"PRIx64" spos=%"PRIx64", write_index=%"PRIx64" size=%"PRIx64"\n",
- url_ftell(s->pb), s->pb->pos, ffm->write_index, ffm->file_size);
+ avio_tell(s->pb), s->pb->pos, ffm->write_index, ffm->file_size);
if (ffm_read_data(s, ffm->header, FRAME_HEADER_SIZE, 1) !=
FRAME_HEADER_SIZE)
return -1;
ffm->read_state = READ_HEADER;
return -1;
}
- pkt->pos = url_ftell(s->pb);
+ pkt->pos = avio_tell(s->pb);
if (ffm->header[1] & FLAG_KEY_FRAME)
pkt->flags |= AV_PKT_FLAG_KEY;