@@ -1630,6 +1630,17 @@ enum AVPacketSideDataType {
* AVAudioTrackChannelLayout.
*/
AV_PKT_DATA_AUDIO_TRACK_CHANNEL_LAYOUT,
+
+ /**
+ * Assign alternate groups for tracks. An example of alternate
+ * groups would be audio tracks (or video tracks) that are
+ * alternative to each other. Each alternative track shares the
+ * same non-zero alternate group.
+ *
+ * The content is:
+ * uint: The alternate group of this track
+ */
+ AV_PKT_DATA_TRACK_ALTERNATE_GROUP,
};
#define AV_PKT_DATA_QUALITY_FACTOR AV_PKT_DATA_QUALITY_STATS //DEPRECATED
@@ -2565,6 +2565,8 @@ static int mov_write_tkhd_tag(AVIOContext *pb, MOVMuxContext *mov,
int flags = MOV_TKHD_FLAG_IN_MOVIE;
int rotation = 0;
int group = 0;
+ int *alternate_group = NULL;
+ int alternate_group_size;
uint32_t *display_matrix = NULL;
int display_matrix_size, i;
@@ -2581,6 +2583,13 @@ static int mov_write_tkhd_tag(AVIOContext *pb, MOVMuxContext *mov,
display_matrix = NULL;
}
+ if (st) {
+ alternate_group = (int*) av_stream_get_side_data(st, AV_PKT_DATA_TRACK_ALTERNATE_GROUP,
+ &alternate_group_size);
+ if (alternate_group && alternate_group_size >= sizeof(int))
+ group = *alternate_group;
+ }
+
if (track->flags & MOV_TRACK_ENABLED)
flags |= MOV_TKHD_FLAG_ENABLED;