You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
lavf: Initialize the stream info timestamps in avformat_new_stream
These are normally initialized to AV_NOPTS_VALUE at the start of avformat_find_stream_info, but if a new stream is found while this function is running (e.g. like in mpegts), the newly added AVStreams didn't have these values properly initalized, leading to avformat_find_stream_info terminating too soon (when the first timestamps are far from 0). Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
@@ -2746,6 +2746,12 @@ AVStream *avformat_new_stream(AVFormatContext *s, AVCodec *c)
|
|||||||
|
|
||||||
st->sample_aspect_ratio = (AVRational){0,1};
|
st->sample_aspect_ratio = (AVRational){0,1};
|
||||||
|
|
||||||
|
#if FF_API_R_FRAME_RATE
|
||||||
|
st->info->last_dts = AV_NOPTS_VALUE;
|
||||||
|
#endif
|
||||||
|
st->info->fps_first_dts = AV_NOPTS_VALUE;
|
||||||
|
st->info->fps_last_dts = AV_NOPTS_VALUE;
|
||||||
|
|
||||||
s->streams[s->nb_streams++] = st;
|
s->streams[s->nb_streams++] = st;
|
||||||
return st;
|
return st;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user