mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avformat/vivo: Favor setting fps from explicit fractions
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
7b24615565
commit
bf1e93bdc9
@ -121,7 +121,7 @@ static int vivo_get_packet_header(AVFormatContext *s)
|
||||
static int vivo_read_header(AVFormatContext *s)
|
||||
{
|
||||
VivoContext *vivo = s->priv_data;
|
||||
AVRational fps = { 1, 25};
|
||||
AVRational fps = { 0 };
|
||||
AVStream *ast, *vst;
|
||||
unsigned char *line, *line_end, *key, *value;
|
||||
long value_int;
|
||||
@ -212,13 +212,16 @@ static int vivo_read_header(AVFormatContext *s)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
value_used = 1;
|
||||
fps = av_inv_q(av_d2q(d, 10000));
|
||||
if (!fps.num && !fps.den)
|
||||
fps = av_inv_q(av_d2q(d, 10000));
|
||||
}
|
||||
|
||||
if (!value_used)
|
||||
av_dict_set(&s->metadata, key, value, 0);
|
||||
}
|
||||
}
|
||||
if (!fps.num || !fps.den)
|
||||
fps = (AVRational){ 1, 25 };
|
||||
|
||||
avpriv_set_pts_info(ast, 64, 1, ast->codecpar->sample_rate);
|
||||
avpriv_set_pts_info(vst, 64, fps.num, fps.den);
|
||||
|
Loading…
Reference in New Issue
Block a user