mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
avformat/movenc: dont mark multichannel as mono tracks as containing the center channel
Fixes Ticket3727 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
ec24796731
commit
6821572499
@ -432,6 +432,9 @@ static int mov_write_chan_tag(AVIOContext *pb, MOVTrack *track)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (track->multichannel_as_mono)
|
||||||
|
return 0;
|
||||||
|
|
||||||
avio_wb32(pb, 0); // Size
|
avio_wb32(pb, 0); // Size
|
||||||
ffio_wfourcc(pb, "chan"); // Type
|
ffio_wfourcc(pb, "chan"); // Type
|
||||||
avio_w8(pb, 0); // Version
|
avio_w8(pb, 0); // Version
|
||||||
@ -4120,6 +4123,31 @@ static int mov_write_header(AVFormatContext *s)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < s->nb_streams; i++) {
|
||||||
|
int j;
|
||||||
|
AVStream *st= s->streams[i];
|
||||||
|
MOVTrack *track= &mov->tracks[i];
|
||||||
|
|
||||||
|
if (st->codec->codec_type != AVMEDIA_TYPE_AUDIO ||
|
||||||
|
track->enc->channel_layout != AV_CH_LAYOUT_MONO)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
for (j = 0; j < s->nb_streams; j++) {
|
||||||
|
AVStream *stj= s->streams[j];
|
||||||
|
MOVTrack *trackj= &mov->tracks[j];
|
||||||
|
if (j == i)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (stj->codec->codec_type != AVMEDIA_TYPE_AUDIO ||
|
||||||
|
trackj->enc->channel_layout != AV_CH_LAYOUT_MONO ||
|
||||||
|
trackj->language != track->language ||
|
||||||
|
trackj->tag != track->tag
|
||||||
|
)
|
||||||
|
continue;
|
||||||
|
track->multichannel_as_mono++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
enable_tracks(s);
|
enable_tracks(s);
|
||||||
|
|
||||||
|
|
||||||
|
@ -100,6 +100,7 @@ typedef struct MOVTrack {
|
|||||||
int tag; ///< stsd fourcc
|
int tag; ///< stsd fourcc
|
||||||
AVStream *st;
|
AVStream *st;
|
||||||
AVCodecContext *enc;
|
AVCodecContext *enc;
|
||||||
|
int multichannel_as_mono;
|
||||||
|
|
||||||
int vos_len;
|
int vos_len;
|
||||||
uint8_t *vos_data;
|
uint8_t *vos_data;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user