diff options
author | Gregory Montoir <cyx@users.sourceforge.net> | 2019-02-22 12:59:04 +0800 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2021-08-10 01:14:04 +0200 |
commit | 3f92496d9eebea1ecaaf45bad5a6aeb192672fe3 (patch) | |
tree | d2d08599477a00407f9aaf760c50dd1f5c2a7d99 /libavformat/paf.c | |
parent | 00b579890d866f0dd2f34bcb8aceb890ab29f582 (diff) | |
download | ffmpeg-3f92496d9eebea1ecaaf45bad5a6aeb192672fe3.tar.gz |
avformat/paf: read frame rate from header @0x88
Signed-off-by: Gregory Montoir <cyx@users.sourceforge.net>
Diffstat (limited to 'libavformat/paf.c')
-rw-r--r-- | libavformat/paf.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libavformat/paf.c b/libavformat/paf.c index 2d2d7f8dd8..140e0567e1 100644 --- a/libavformat/paf.c +++ b/libavformat/paf.c @@ -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) |