|
|
@ -94,7 +94,7 @@ static int read_header(AVFormatContext *s) |
|
|
|
PAFDemuxContext *p = s->priv_data; |
|
|
|
PAFDemuxContext *p = s->priv_data; |
|
|
|
AVIOContext *pb = s->pb; |
|
|
|
AVIOContext *pb = s->pb; |
|
|
|
AVStream *ast, *vst; |
|
|
|
AVStream *ast, *vst; |
|
|
|
int ret = 0; |
|
|
|
int frame_ms, ret = 0; |
|
|
|
|
|
|
|
|
|
|
|
avio_skip(pb, 132); |
|
|
|
avio_skip(pb, 132); |
|
|
|
|
|
|
|
|
|
|
@ -106,7 +106,9 @@ static int read_header(AVFormatContext *s) |
|
|
|
vst->nb_frames = |
|
|
|
vst->nb_frames = |
|
|
|
vst->duration = |
|
|
|
vst->duration = |
|
|
|
p->nb_frames = avio_rl32(pb); |
|
|
|
p->nb_frames = avio_rl32(pb); |
|
|
|
avio_skip(pb, 4); |
|
|
|
frame_ms = avio_rl32(pb); |
|
|
|
|
|
|
|
if (frame_ms < 1) |
|
|
|
|
|
|
|
return AVERROR_INVALIDDATA; |
|
|
|
|
|
|
|
|
|
|
|
vst->codecpar->width = avio_rl32(pb); |
|
|
|
vst->codecpar->width = avio_rl32(pb); |
|
|
|
vst->codecpar->height = avio_rl32(pb); |
|
|
|
vst->codecpar->height = avio_rl32(pb); |
|
|
@ -115,7 +117,7 @@ static int read_header(AVFormatContext *s) |
|
|
|
vst->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; |
|
|
|
vst->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; |
|
|
|
vst->codecpar->codec_tag = 0; |
|
|
|
vst->codecpar->codec_tag = 0; |
|
|
|
vst->codecpar->codec_id = AV_CODEC_ID_PAF_VIDEO; |
|
|
|
vst->codecpar->codec_id = AV_CODEC_ID_PAF_VIDEO; |
|
|
|
avpriv_set_pts_info(vst, 64, 1, 10); |
|
|
|
avpriv_set_pts_info(vst, 64, frame_ms, 1000); |
|
|
|
|
|
|
|
|
|
|
|
ast = avformat_new_stream(s, 0); |
|
|
|
ast = avformat_new_stream(s, 0); |
|
|
|
if (!ast) |
|
|
|
if (!ast) |
|
|
|