Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
7c147900
Commit
7c147900
authored
12 years ago
by
Martin Storsjö
Browse files
Options
Downloads
Patches
Plain Diff
ismindex: Factorize code for printing chunk duration lists
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
f05e9beb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/ismindex.c
+19
-22
19 additions, 22 deletions
tools/ismindex.c
with
19 additions
and
22 deletions
tools/ismindex.c
+
19
−
22
View file @
7c147900
...
@@ -405,6 +405,23 @@ static void output_server_manifest(struct Tracks *tracks,
...
@@ -405,6 +405,23 @@ static void output_server_manifest(struct Tracks *tracks,
fclose
(
out
);
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
,
static
void
output_client_manifest
(
struct
Tracks
*
tracks
,
const
char
*
basename
,
int
split
)
const
char
*
basename
,
int
split
)
{
{
...
@@ -450,17 +467,7 @@ static void output_client_manifest(struct Tracks *tracks,
...
@@ -450,17 +467,7 @@ static void output_client_manifest(struct Tracks *tracks,
fprintf
(
stderr
,
"Mismatched number of video chunks in %s and %s
\n
"
,
fprintf
(
stderr
,
"Mismatched number of video chunks in %s and %s
\n
"
,
track
->
name
,
first_track
->
name
);
track
->
name
,
first_track
->
name
);
}
}
track
=
first_track
;
print_track_chunks
(
out
,
tracks
,
tracks
->
video_track
,
"video"
);
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
);
}
fprintf
(
out
,
"
\t
</StreamIndex>
\n
"
);
fprintf
(
out
,
"
\t
</StreamIndex>
\n
"
);
}
}
if
(
tracks
->
audio_track
>=
0
)
{
if
(
tracks
->
audio_track
>=
0
)
{
...
@@ -491,17 +498,7 @@ static void output_client_manifest(struct Tracks *tracks,
...
@@ -491,17 +498,7 @@ static void output_client_manifest(struct Tracks *tracks,
fprintf
(
stderr
,
"Mismatched number of audio chunks in %s and %s
\n
"
,
fprintf
(
stderr
,
"Mismatched number of audio chunks in %s and %s
\n
"
,
track
->
name
,
first_track
->
name
);
track
->
name
,
first_track
->
name
);
}
}
track
=
first_track
;
print_track_chunks
(
out
,
tracks
,
tracks
->
audio_track
,
"audio"
);
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
);
}
fprintf
(
out
,
"
\t
</StreamIndex>
\n
"
);
fprintf
(
out
,
"
\t
</StreamIndex>
\n
"
);
}
}
fprintf
(
out
,
"</SmoothStreamingMedia>
\n
"
);
fprintf
(
out
,
"</SmoothStreamingMedia>
\n
"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment