Proper update to libevent 2 (artwork, avio_evbuffer, dmap_common, transcode)

This commit is contained in:
ejurgensen 2014-09-28 22:44:45 +02:00
parent 661a557500
commit 513e38dcda
6 changed files with 30 additions and 9 deletions

View File

@ -43,6 +43,10 @@
#endif
#include "artwork.h"
#ifndef HAVE_LIBEVENT2
# define evbuffer_get_length(x) (x)->off
#endif
#ifdef HAVE_SPOTIFY_H
# include "spotify.h"
#endif
@ -717,8 +721,8 @@ artwork_get(char *filename, int max_w, int max_h, int format, struct evbuffer *e
if (ret < 0)
{
if (EVBUFFER_LENGTH(evbuf) > 0)
evbuffer_drain(evbuf, EVBUFFER_LENGTH(evbuf));
if (evbuffer_get_length(evbuf) > 0)
evbuffer_drain(evbuf, evbuffer_get_length(evbuf));
}
return ret;
@ -838,8 +842,8 @@ artwork_get_embedded_image(char *filename, int max_w, int max_h, int format, str
if (ret < 0)
{
if (EVBUFFER_LENGTH(evbuf) > 0)
evbuffer_drain(evbuf, EVBUFFER_LENGTH(evbuf));
if (evbuffer_get_length(evbuf) > 0)
evbuffer_drain(evbuf, evbuffer_get_length(evbuf));
}
return ret;

View File

@ -8,7 +8,11 @@
#define ART_FMT_PNG 1
#define ART_FMT_JPEG 2
#include <event.h>
#ifdef HAVE_LIBEVENT2
# include <event2/buffer.h>
#else
# include <event.h>
#endif
int
artwork_get_item_filename(char *filename, int max_w, int max_h, int format, struct evbuffer *evbuf);

View File

@ -2,7 +2,11 @@
#ifndef __AVIO_EVBUFFER_H__
#define __AVIO_EVBUFFER_H__
#include <event.h>
#ifdef HAVE_LIBEVENT2
# include <event2/buffer.h>
#else
# include <event.h>
#endif
AVIOContext *
avio_evbuffer_open(struct evbuffer *evbuf);

View File

@ -23,6 +23,10 @@
#include <string.h>
#include <stdint.h>
#ifndef HAVE_LIBEVENT2
# define evbuffer_get_length(x) (x)->off
#endif
#include "db.h"
#include "misc.h"
#include "logger.h"
@ -529,7 +533,7 @@ dmap_encode_file_metadata(struct evbuffer *songlist, struct evbuffer *song, stru
if (want_asdk)
val += 9;
dmap_add_container(songlist, "mlit", EVBUFFER_LENGTH(song) + val);
dmap_add_container(songlist, "mlit", evbuffer_get_length(song) + val);
/* Prepend mikd & asdk if needed */
if (want_mikd)

View File

@ -2,10 +2,11 @@
#ifndef __DMAP_HELPERS_H__
#define __DMAP_HELPERS_H__
#include <event.h>
#ifdef HAVE_LIBEVENT2
# include <event2/buffer.h>
# include <event2/http.h>
#else
# include <event.h>
# include "evhttp/evhttp.h"
#endif

View File

@ -2,7 +2,11 @@
#ifndef __TRANSCODE_H__
#define __TRANSCODE_H__
#include <event.h>
#ifdef HAVE_LIBEVENT2
# include <event2/buffer.h>
#else
# include <event.h>
#endif
struct transcode_ctx;