Commit 360d7170 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '7c147900'

* commit '7c147900':
  ismindex: Factorize code for printing chunk duration lists
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 33ecf7ab 7c147900
......@@ -410,6 +410,23 @@ static void output_server_manifest(struct Tracks *tracks,
fclose(out);
}
static void print_track_chunks(FILE *out, struct Tracks *tracks, int main,
const char *type)
{
int i, j;
struct Track *track = tracks->tracks[main];
for (i = 0; i < track->chunks; i++) {
for (j = main + 1; j < tracks->nb_tracks; j++) {
if (tracks->tracks[j]->is_audio == track->is_audio &&
track->offsets[i].duration != tracks->tracks[j]->offsets[i].duration)
fprintf(stderr, "Mismatched duration of %s chunk %d in %s and %s\n",
type, i, track->name, tracks->tracks[j]->name);
}
fprintf(out, "\t\t<c n=\"%d\" d=\"%d\" />\n",
i, track->offsets[i].duration);
}
}
static void output_client_manifest(struct Tracks *tracks,
const char *basename, int split)
{
......@@ -455,17 +472,7 @@ static void output_client_manifest(struct Tracks *tracks,
fprintf(stderr, "Mismatched number of video chunks in %s and %s\n",
track->name, first_track->name);
}
track = first_track;
for (i = 0; i < track->chunks; i++) {
for (j = tracks->video_track + 1; j < tracks->nb_tracks; j++) {
if (tracks->tracks[j]->is_video &&
track->offsets[i].duration != tracks->tracks[j]->offsets[i].duration)
fprintf(stderr, "Mismatched duration of video chunk %d in %s and %s\n",
i, track->name, tracks->tracks[j]->name);
}
fprintf(out, "\t\t<c n=\"%d\" d=\"%d\" />\n", i,
track->offsets[i].duration);
}
print_track_chunks(out, tracks, tracks->video_track, "video");
fprintf(out, "\t</StreamIndex>\n");
}
if (tracks->audio_track >= 0) {
......@@ -496,17 +503,7 @@ static void output_client_manifest(struct Tracks *tracks,
fprintf(stderr, "Mismatched number of audio chunks in %s and %s\n",
track->name, first_track->name);
}
track = first_track;
for (i = 0; i < track->chunks; i++) {
for (j = tracks->audio_track + 1; j < tracks->nb_tracks; j++) {
if (tracks->tracks[j]->is_audio &&
track->offsets[i].duration != tracks->tracks[j]->offsets[i].duration)
fprintf(stderr, "Mismatched duration of audio chunk %d in %s and %s\n",
i, track->name, tracks->tracks[j]->name);
}
fprintf(out, "\t\t<c n=\"%d\" d=\"%d\" />\n",
i, track->offsets[i].duration);
}
print_track_chunks(out, tracks, tracks->audio_track, "audio");
fprintf(out, "\t</StreamIndex>\n");
}
fprintf(out, "</SmoothStreamingMedia>\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment