OSDN Git Service

ismindex: recover from completely empty streams
authorMika Raento <mika.raento@elisa.fi>
Wed, 3 Sep 2014 06:13:46 +0000 (09:13 +0300)
committerMartin Storsjö <martin@martin.st>
Wed, 3 Sep 2014 09:06:40 +0000 (12:06 +0300)
This creates best-effort results from input that is missing stream
contents, there are warnings printed when this happens.

Signed-off-by: Martin Storsjö <martin@martin.st>
tools/ismindex.c

index f49916a..a6a9763 100644 (file)
@@ -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 in %s as it has zero bitrate\n", i, file);
+            continue;
+        }
+
         track = av_mallocz(sizeof(*track));
         if (!track) {
             err = AVERROR(ENOMEM);