mirror of
https://mirror.skon.top/https://github.com/FFmpeg/FFmpeg
synced 2026-04-20 12:50:49 +08:00
avformat/demux: update Stream Groups in avformat_find_stream_info() from parsed values
Dimensions are not available at the container level for LCEVC in mpegts, so derive them from the parsed values taken from the enhancement stream. Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
@@ -3163,6 +3163,25 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
|
||||
sti->avctx_inited = 0;
|
||||
}
|
||||
|
||||
/* update the stream group parameters from the stream contexts if needed */
|
||||
for (unsigned i = 0; i < ic->nb_stream_groups; i++) {
|
||||
AVStreamGroup *const stg = ic->stream_groups[i];
|
||||
AVStreamGroupLCEVC *lcevc;
|
||||
const AVStream *st;
|
||||
|
||||
if (stg->type != AV_STREAM_GROUP_PARAMS_LCEVC)
|
||||
continue;
|
||||
|
||||
/* For LCEVC in mpegts, the parser is needed to get the enhancement layer
|
||||
* dimensions */
|
||||
lcevc = stg->params.lcevc;
|
||||
if (lcevc->width && lcevc->height)
|
||||
continue;
|
||||
st = stg->streams[lcevc->lcevc_index];
|
||||
lcevc->width = st->codecpar->width;
|
||||
lcevc->height = st->codecpar->height;
|
||||
}
|
||||
|
||||
find_stream_info_err:
|
||||
for (unsigned i = 0; i < ic->nb_streams; i++) {
|
||||
AVStream *const st = ic->streams[i];
|
||||
|
||||
Reference in New Issue
Block a user