History

avformat/movenc: dont mark multichannel as mono tracks as containing the center channel

Fixes Ticket3727

Michael Niedermayer committed 12 years ago

Commit 68215721 parent ec247962 files · +29 −0Browse files

Unified · Split

2 files
  1. libavformat/movenc.c +28 −0
  2. libavformat/movenc.h +1 −0
libavformat/movenc.c+28−0
@@ -432,6 +432,9 @@ static int mov_write_chan_tag(AVIOContext *pb, MOVTrack *track) · 431 unmodified lines
432 return 0;432 return 0;
433 }433 }
434 434
435 if (track->multichannel_as_mono)
436 return 0;
437
435 avio_wb32(pb, 0); // Size438 avio_wb32(pb, 0); // Size
436 ffio_wfourcc(pb, "chan"); // Type439 ffio_wfourcc(pb, "chan"); // Type
437 avio_w8(pb, 0); // Version440 avio_w8(pb, 0); // Version
@@ -4120,6 +4123,31 @@ static int mov_write_header(AVFormatContext *s) · 3682 unmodified lines
4120 }4123 }
4121 }4124 }
4122 4125
4126 for (i = 0; i < s->nb_streams; i++) {
4127 int j;
4128 AVStream *st= s->streams[i];
4129 MOVTrack *track= &mov->tracks[i];
4130
4131 if (st->codec->codec_type != AVMEDIA_TYPE_AUDIO ||
4132 track->enc->channel_layout != AV_CH_LAYOUT_MONO)
4133 continue;
4134
4135 for (j = 0; j < s->nb_streams; j++) {
4136 AVStream *stj= s->streams[j];
4137 MOVTrack *trackj= &mov->tracks[j];
4138 if (j == i)
4139 continue;
4140
4141 if (stj->codec->codec_type != AVMEDIA_TYPE_AUDIO ||
4142 trackj->enc->channel_layout != AV_CH_LAYOUT_MONO ||
4143 trackj->language != track->language ||
4144 trackj->tag != track->tag
4145 )
4146 continue;
4147 track->multichannel_as_mono++;
4148 }
4149 }
4150
4123 enable_tracks(s);4151 enable_tracks(s);
4124 4152
4125 4153
libavformat/movenc.h+1−0
@@ -100,6 +100,7 @@ typedef struct MOVTrack { · 99 unmodified lines
100 int tag; ///< stsd fourcc100 int tag; ///< stsd fourcc
101 AVStream *st;101 AVStream *st;
102 AVCodecContext *enc;102 AVCodecContext *enc;
103 int multichannel_as_mono;
103 104
104 int vos_len;105 int vos_len;
105 uint8_t *vos_data;106 uint8_t *vos_data;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t