* @param depth File allocation table depth
* @return NULL on error
*/
-static AVIOContext * wtvfile_open_sector(int first_sector, uint64_t length, int depth, AVFormatContext *s)
+static AVIOContext * wtvfile_open_sector(unsigned first_sector, uint64_t length, int depth, AVFormatContext *s)
{
AVIOContext *pb;
WtvFile *wf;
buf += dir_length;
}
- return 0;
+ return NULL;
}
#define wtvfile_open(s, buf, buf_size, filename) \
static const ff_asf_guid mediasubtype_mpeg2_sections =
{0x79,0x85,0x9F,0x4A,0xF8,0x6B,0x92,0x43,0x8A,0x6D,0xD2,0xDD,0x09,0xFA,0x78,0x61};
-static int read_probe(AVProbeData *p)
+static int read_probe(const AVProbeData *p)
{
return ff_guidcmp(p->buf, ff_wtv_guid) ? 0 : AVPROBE_SCORE_MAX;
}
wtv->last_valid_pts = wtv->pts;
if (wtv->epoch == AV_NOPTS_VALUE || wtv->pts < wtv->epoch)
wtv->epoch = wtv->pts;
- if (mode == SEEK_TO_PTS && wtv->pts >= seekts) {
- avio_skip(pb, WTV_PAD8(len) - consumed);
- return 0;
- }
+ if (mode == SEEK_TO_PTS && wtv->pts >= seekts) {
+ avio_skip(pb, WTV_PAD8(len) - consumed);
+ return 0;
+ }
}
}
} else if (!ff_guidcmp(g, ff_data_guid)) {
static int read_header(AVFormatContext *s)
{
WtvContext *wtv = s->priv_data;
- int root_sector, root_size;
+ unsigned root_sector;
+ int root_size;
uint8_t root[WTV_SECTOR_SIZE];
AVIOContext *pb;
int64_t timeline_pos;
}
ret = parse_chunks(s, SEEK_TO_DATA, 0, 0);
- if (ret < 0)
+ if (ret < 0) {
+ wtvfile_close(wtv->pb);
return ret;
+ }
avio_seek(wtv->pb, -32, SEEK_CUR);
timeline_pos = avio_tell(s->pb); // save before opening another file