*/
#include <time.h>
#include "avformat.h"
-#include "dvdata.h"
+#include "libavcodec/dvdata.h"
#include "dv.h"
struct DVDemuxContext {
return NULL;
}
- return (frame[offs] == t ? &frame[offs] : NULL);
+ return frame[offs] == t ? &frame[offs] : NULL;
}
/*
// FIXME: sys may be wrong if last dv_read_packet() failed (buffer is junk)
const DVprofile* sys = dv_codec_profile(c->vst->codec);
int64_t offset;
- int64_t size = url_fsize(&s->pb);
+ int64_t size = url_fsize(s->pb);
int64_t max_offset = ((size-1) / sys->frame_size) * sys->frame_size;
offset = sys->frame_size * timestamp;
if (!c->dv_demux)
return -1;
- if (get_buffer(&s->pb, c->buf, DV_PROFILE_BYTES) <= 0 ||
- url_fseek(&s->pb, -DV_PROFILE_BYTES, SEEK_CUR) < 0)
- return AVERROR_IO;
+ if (get_buffer(s->pb, c->buf, DV_PROFILE_BYTES) <= 0 ||
+ url_fseek(s->pb, -DV_PROFILE_BYTES, SEEK_CUR) < 0)
+ return AVERROR(EIO);
c->dv_demux->sys = dv_frame_profile(c->buf);
s->bit_rate = av_rescale(c->dv_demux->sys->frame_size * 8,
if (size < 0) {
size = c->dv_demux->sys->frame_size;
- if (get_buffer(&s->pb, c->buf, size) <= 0)
- return AVERROR_IO;
+ if (get_buffer(s->pb, c->buf, size) <= 0)
+ return AVERROR(EIO);
size = dv_produce_packet(c->dv_demux, pkt, c->buf, size);
}
dv_offset_reset(c, offset / c->sys->frame_size);
- offset = url_fseek(&s->pb, offset, SEEK_SET);
+ offset = url_fseek(s->pb, offset, SEEK_SET);
return (offset < 0)?offset:0;
}
#ifdef CONFIG_DV_DEMUXER
AVInputFormat dv_demuxer = {
"dv",
- "DV video format",
+ NULL_IF_CONFIG_SMALL("DV video format"),
sizeof(RawDVContext),
NULL,
dv_read_header,