mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-28 02:02:46 +00:00
avformat/dsddec: create audio stream before processing id3
This ensures stream[0] is always the audio stream (an assumption made in dsf_read_packet). Signed-off-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
941b2240f2
commit
0a13487b1a
@ -70,6 +70,11 @@ static int dsf_read_header(AVFormatContext *s)
|
|||||||
if (avio_rl64(pb) != 28)
|
if (avio_rl64(pb) != 28)
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
|
/* create primary stream before any id3 coverart streams */
|
||||||
|
st = avformat_new_stream(s, NULL);
|
||||||
|
if (!st)
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
|
|
||||||
avio_skip(pb, 8);
|
avio_skip(pb, 8);
|
||||||
id3pos = avio_rl64(pb);
|
id3pos = avio_rl64(pb);
|
||||||
if (pb->seekable) {
|
if (pb->seekable) {
|
||||||
@ -92,10 +97,6 @@ static int dsf_read_header(AVFormatContext *s)
|
|||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
st = avformat_new_stream(s, NULL);
|
|
||||||
if (!st)
|
|
||||||
return AVERROR(ENOMEM);
|
|
||||||
|
|
||||||
channel_type = avio_rl32(pb);
|
channel_type = avio_rl32(pb);
|
||||||
if (channel_type < FF_ARRAY_ELEMS(dsf_channel_layout))
|
if (channel_type < FF_ARRAY_ELEMS(dsf_channel_layout))
|
||||||
st->codec->channel_layout = dsf_channel_layout[channel_type];
|
st->codec->channel_layout = dsf_channel_layout[channel_type];
|
||||||
|
Loading…
Reference in New Issue
Block a user