]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/hls.c
mpegvideo_enc/rv10: width and hieghtmust be multiple of 16
[ffmpeg] / libavformat / hls.c
index ef5803ba4b4a836fbe01d55ed8f931833ce35089..f515dfb7f128462df6377f749bc77a07f97878f4 100644 (file)
@@ -504,6 +504,7 @@ static int hls_read_header(AVFormatContext *s)
         struct variant *v = c->variants[i];
         AVInputFormat *in_fmt = NULL;
         char bitrate_str[20];
+        AVProgram *program = NULL;
         if (v->n_segments == 0)
             continue;
 
@@ -549,6 +550,13 @@ static int hls_read_header(AVFormatContext *s)
         if (ret < 0)
             goto fail;
         snprintf(bitrate_str, sizeof(bitrate_str), "%d", v->bandwidth);
+
+        /* Create new AVprogram for variant i */
+        program = av_new_program(s, i);
+        if (!program)
+            goto fail;
+        av_dict_set(&program->metadata, "variant_bitrate", bitrate_str, 0);
+
         /* Create new AVStreams for each stream in this variant */
         for (j = 0; j < v->ctx->nb_streams; j++) {
             AVStream *st = avformat_new_stream(s, NULL);
@@ -556,6 +564,7 @@ static int hls_read_header(AVFormatContext *s)
                 ret = AVERROR(ENOMEM);
                 goto fail;
             }
+            ff_program_add_stream_index(s, i, stream_offset + j);
             st->id = i;
             avcodec_copy_context(st->codec, v->ctx->streams[j]->codec);
             if (v->bandwidth)