Skip to content

Commit

Permalink
sidxindex: Write mimeType=audio/mp4 for audio-only representations
Browse files Browse the repository at this point in the history
This fixes playback with dash.js, when the input is one separate
mp4 file per track.

Signed-off-by: Martin Storsjö <[email protected]>
  • Loading branch information
mstorsjo committed Nov 24, 2014
1 parent 208f3ab commit 6f26f14
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/sidxindex.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ static int output_mpd(struct Tracks *tracks, const char *filename)
for (i = 0; i < nb_tracks[set]; ) {
struct Track *first_track = adaptation_sets[set][i];
int width = 0, height = 0, sample_rate = 0, channels = 0, bitrate = 0;
fprintf(out, "\t\t\t<Representation id=\"%d\" mimeType=\"video/mp4\" codecs=\"", i);
fprintf(out, "\t\t\t<Representation id=\"%d\" codecs=\"", i);
for (j = i; j < nb_tracks[set]; j++) {
struct Track *track = adaptation_sets[set][j];
if (strcmp(track->name, first_track->name))
Expand All @@ -345,7 +345,8 @@ static int output_mpd(struct Tracks *tracks, const char *filename)
fprintf(out, ",");
fprintf(out, "%s", track->codec_str);
}
fprintf(out, "\" bandwidth=\"%d\"", bitrate);
fprintf(out, "\" mimeType=\"%s/mp4\" bandwidth=\"%d\"",
width ? "video" : "audio", bitrate);
if (width > 0 && height > 0)
fprintf(out, " width=\"%d\" height=\"%d\"", width, height);
if (sample_rate > 0)
Expand Down

0 comments on commit 6f26f14

Please sign in to comment.