/*
 * Copyright (C) 2014 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.google.android.exoplayer.hls;

import com.google.android.exoplayer.chunk.Format;
import com.google.android.exoplayer.chunk.FormatWrapper;
import com.google.android.exoplayer.util.MimeTypes;

/**
 * Variant stream reference.
 */
public final class Variant implements FormatWrapper {

  public final String url;
  public final Format format;

  public Variant(int index, String name, String url, int bitrate, String codecs, int width, int height) {
    this.url = url;
    if (name != null) {
      format = new Format(name, MimeTypes.APPLICATION_M3U8, width, height, -1, -1,
              -1, bitrate, null, codecs);
    } else {
      format = new Format(Integer.toString(index), MimeTypes.APPLICATION_M3U8, width, height, -1, -1,
              -1, bitrate, null, codecs);
    }
  }

  @Override
  public Format getFormat() {
    return format;
  }

}

@@ -964,16 +964,44 @@
  format;
+%0A  public final String name;
 %0A%0A  publ
@@ -1128,168 +1128,26 @@
     
-if (
+this.
 name 
-!
 = n
-ull) %7B%0A      format = new Format(name, MimeTypes.APPLICATION_M3U8, width, height, -1, -1,%0A              -1, bitrate, null, codecs);%0A    %7D else %7B%0A  
+ame;%0A
     
@@ -1254,18 +1254,16 @@
         
-  
 -1, bitr
@@ -1286,14 +1286,8 @@
 s);%0A
-    %7D%0A
   %7D%0A
@@ -1353,10 +1353,60 @@
 t;%0A  %7D%0A%0A
+  public String getName() %7B%0A    return name;%0A  %7D%0A%0A
 %7D%0A

Store HLS trackname in the Variant class instead of Format class