avformat/paf: read frame rate from header @0x88

Signed-off-by: Gregory Montoir <cyx@users.sourceforge.net>
This commit is contained in:
Gregory Montoir 2019-02-22 12:59:04 +08:00 committed by Paul B Mahol
parent 00b579890d
commit 3f92496d9e
1 changed files with 5 additions and 3 deletions

View File

@ -94,7 +94,7 @@ static int read_header(AVFormatContext *s)
PAFDemuxContext *p = s->priv_data;
AVIOContext *pb = s->pb;
AVStream *ast, *vst;
int ret = 0;
int frame_ms, ret = 0;
avio_skip(pb, 132);
@ -106,7 +106,9 @@ static int read_header(AVFormatContext *s)
vst->nb_frames =
vst->duration =
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->height = avio_rl32(pb);
@ -115,7 +117,7 @@ static int read_header(AVFormatContext *s)
vst->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
vst->codecpar->codec_tag = 0;
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);
if (!ast)