You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avformat/matroskadec: Move reading color space to a better place
Namely to a place after the AVStream has already been created, so that it can be directly attached to it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -2817,7 +2817,6 @@ static int matroska_parse_tracks(AVFormatContext *s)
|
|||||||
MatroskaTrackEncoding *encodings = encodings_list->elem;
|
MatroskaTrackEncoding *encodings = encodings_list->elem;
|
||||||
AVCodecParameters *par;
|
AVCodecParameters *par;
|
||||||
int extradata_offset = 0;
|
int extradata_offset = 0;
|
||||||
uint32_t fourcc = 0;
|
|
||||||
AVStream *st;
|
AVStream *st;
|
||||||
FFStream *sti;
|
FFStream *sti;
|
||||||
char* key_id_base64 = NULL;
|
char* key_id_base64 = NULL;
|
||||||
@@ -2867,8 +2866,6 @@ static int matroska_parse_tracks(AVFormatContext *s)
|
|||||||
track->video.display_width = track->video.pixel_width;
|
track->video.display_width = track->video.pixel_width;
|
||||||
if (track->video.display_height == -1)
|
if (track->video.display_height == -1)
|
||||||
track->video.display_height = track->video.pixel_height;
|
track->video.display_height = track->video.pixel_height;
|
||||||
if (track->video.color_space.size == 4)
|
|
||||||
fourcc = AV_RL32(track->video.color_space.data);
|
|
||||||
} else if (track->type == MATROSKA_TRACK_TYPE_AUDIO) {
|
} else if (track->type == MATROSKA_TRACK_TYPE_AUDIO) {
|
||||||
if (!track->audio.out_samplerate)
|
if (!track->audio.out_samplerate)
|
||||||
track->audio.out_samplerate = track->audio.samplerate;
|
track->audio.out_samplerate = track->audio.samplerate;
|
||||||
@@ -2955,7 +2952,6 @@ static int matroska_parse_tracks(AVFormatContext *s)
|
|||||||
par = st->codecpar;
|
par = st->codecpar;
|
||||||
|
|
||||||
par->codec_id = codec_id;
|
par->codec_id = codec_id;
|
||||||
par->codec_tag = fourcc;
|
|
||||||
|
|
||||||
if (track->flag_default)
|
if (track->flag_default)
|
||||||
st->disposition |= AV_DISPOSITION_DEFAULT;
|
st->disposition |= AV_DISPOSITION_DEFAULT;
|
||||||
@@ -3003,6 +2999,9 @@ static int matroska_parse_tracks(AVFormatContext *s)
|
|||||||
if (ret == SKIP_TRACK)
|
if (ret == SKIP_TRACK)
|
||||||
continue;
|
continue;
|
||||||
} else if (track->type == MATROSKA_TRACK_TYPE_VIDEO) {
|
} else if (track->type == MATROSKA_TRACK_TYPE_VIDEO) {
|
||||||
|
if (track->video.color_space.size == 4)
|
||||||
|
par->codec_tag = AV_RL32(track->video.color_space.data);
|
||||||
|
|
||||||
ret = mkv_parse_video_codec(track, par, matroska,
|
ret = mkv_parse_video_codec(track, par, matroska,
|
||||||
&extradata_offset);
|
&extradata_offset);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
Reference in New Issue
Block a user