<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <meta name="generator" content="pandoc" />
  <title></title>
  <style type="text/css">code{white-space: pre;}</style>
</head>
<body>
<p>Hi Marc,</p>
<p>It is advised to not <em>copy+paste</em> patches directly into your email client since it might format the patch wrong (which is what happened for the patch in which this email is a reply to.</p>
<p>The lines have been wrapped, causing the patch to be ill-formed, as can be easily recognized by following the below link:</p>
<ul>
<li>https://patches.videolan.org/patch/14941/</li>
</ul>
<p>On 2016-11-07 00:32, Marc K. wrote:</p>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;color:#500050">
<pre><code> Previously, cover art of upnp media was only shown in the browser, but
 not in the player.

 Signed-off-by: Marc K <morckx@gmail.com>
 ---
  .../src/org/videolan/vlc/gui/helpers/AudioUtil.java  | 20
 ++++++++++++++++++--
  1 file changed, 18 insertions(+), 2 deletions(-)

 diff --git a/vlc-
 android/src/org/videolan/vlc/gui/helpers/AudioUtil.java b/vlc-
 android/src/org/videolan/vlc/gui/helpers/AudioUtil.java
 index 846f996..6dd2fb0 100644
 --- a/vlc-android/src/org/videolan/vlc/gui/helpers/AudioUtil.java
 +++ b/vlc-android/src/org/videolan/vlc/gui/helpers/AudioUtil.java
 @@ -42,11 +42,13 @@ import org.videolan.vlc.R;
  import org.videolan.vlc.VLCApplication;
  import org.videolan.vlc.media.MediaUtils;
  import org.videolan.vlc.util.AndroidDevices;
 +import org.videolan.vlc.util.HttpImageLoader;
  import org.videolan.vlc.util.MurmurHash;
  import org.videolan.vlc.util.Permissions;
  import org.videolan.vlc.util.Util;
  
  import java.io.BufferedOutputStream;
 +import java.io.InputStream;
  import java.io.File;
  import java.io.FileOutputStream;
  import java.io.FilenameFilter;
 @@ -227,6 +229,22 @@ public class AudioUtil {
              }
  
              return artworkURL;
 +        } else if (artworkURL != null && artworkURL.startsWith("http:/
 /")) {
 +            try {
 +                /* Hack: The album art cannot actually be loaded
 synchronously via http.
 +                 * HttpImageLoader.downloadBitmap, however, will load
 it from the icons map
 +                 * if it was previously shown as thumbnail.
 +                 */
 +                Bitmap albumArt =
 HttpImageLoader.downloadBitmap(artworkURL);
 +                if (albumArt != null) {
 +                    File outputFile = File.createTempFile("cover-",
 ".jpg", context.getCacheDir());
 +                    FileOutputStream fos = new
 FileOutputStream(outputFile);
 +                    if (albumArt.compress(CompressFormat.JPEG, 90,
 fos))
 +                        return(outputFile.getPath());
 +                }
 +            } catch (IOException e) {
 +                e.printStackTrace();
 +            }
          }
          return null;
      }
 @@ -322,8 +340,6 @@ public class AudioUtil {
                  if (cacheFile.exists()) {
                      if (cacheFile.length() > 0)
                          coverPath = cachePath;
 -                    else
 -                        return null;
                  }
              }
  
 -- 
 2.9.3

 _______________________________________________
 Android mailing list
 Android@videolan.org
 https://mailman.videolan.org/listinfo/android</code></pre>
</blockquote>
</body>
</html>