On Wed, 3 Sep 2014, Mika Raento wrote:
--- tools/ismindex.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)diff --git a/tools/ismindex.c b/tools/ismindex.c index d91925e..997066b 100644 --- a/tools/ismindex.c +++ b/tools/ismindex.c @@ -325,6 +325,12 @@ static int handle_file(struct Tracks *tracks, const char *file, int split, for (i = 0; i < ctx->nb_streams; i++) { struct Track **temp; AVStream *st = ctx->streams[i]; + + if (st->codec->bit_rate == 0) { + fprintf(stderr, "Skipping track %d as it has zero bitrate\n", i); + continue; + } + track = av_mallocz(sizeof(*track)); if (!track) { err = AVERROR(ENOMEM); @@ -504,10 +510,6 @@ static void output_client_manifest(struct Tracks *tracks, const char *basename, track = tracks->tracks[i]; if (!track->is_video) continue; - if (track->bitrate == 0) { - fprintf(stderr, "Skipping video track %d as it has zero bitrate\n", i); - continue; - } fprintf(out, "\t\t<QualityLevel Index=\"%d\" Bitrate=\"%d\" " "FourCC=\"%s\" MaxWidth=\"%d\" MaxHeight=\"%d\" " @@ -520,10 +522,6 @@ static void output_client_manifest(struct Tracks *tracks, const char *basename, if (track->chunks != first_track->chunks) fprintf(stderr, "Mismatched number of video chunks in %s (id: %d, chunks %d) and %s (id: %d, chunks %d)\n", track->name, track->track_id, track->chunks, first_track->name, first_track->track_id, first_track->chunks); - if (track->chunks > first_track->chunks) { - first_track = track; - tracks->video_track = i; - } } print_track_chunks(out, tracks, tracks->video_track, "video"); fprintf(out, "\t</StreamIndex>\n"); -- 1.8.5.2 (Apple Git-48)
This looks good, but should be squashed into patch 1/2 (there's no point in adding code in one commit if it's going to be moved and removed in the next one).
I squashed them locally, added the file name in the warning message as well, and changed the commit message subject from "recover from completely or partially empty streams" to just "recover from completely empty streams", since the part about partially empty streams was removed now.
If that sounds ok to you I'll push that soon. // Martin _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
