Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/azatoth/minidlna.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Maggard <jmaggard@users.sourceforce.net>2012-03-14 21:57:21 +0400
committerJustin Maggard <jmaggard@users.sourceforce.net>2012-03-14 21:57:21 +0400
commit8f7faf9a56de0eab49a8bcac140a473feb3630a4 (patch)
tree430ddd11b7f7d4dc67b300af16e333039ab6c55e /tagutils
parente4a71022c5a85ad29aa4d472d40551dd6245fe65 (diff)
* Use an asprintf wrapper, to report errors and NULLify the result.
Diffstat (limited to 'tagutils')
-rw-r--r--tagutils/tagutils-aac.c6
-rw-r--r--tagutils/tagutils-asf.c8
-rw-r--r--tagutils/tagutils-mp3.c2
-rw-r--r--tagutils/tagutils-pcm.c4
-rw-r--r--tagutils/tagutils.c1
5 files changed, 11 insertions, 10 deletions
diff --git a/tagutils/tagutils-aac.c b/tagutils/tagutils-aac.c
index 4224d5f..3f1590a 100644
--- a/tagutils/tagutils-aac.c
+++ b/tagutils/tagutils-aac.c
@@ -407,11 +407,11 @@ bad_esds:
}
/* AAC @ Level 1/2 */
if( psong->channels <= 2 && psong->bitrate <= 320000 )
- asprintf(&(psong->dlna_pn), "AAC_ISO_320");
+ xasprintf(&(psong->dlna_pn), "AAC_ISO_320");
else if( psong->channels <= 2 && psong->bitrate <= 576000 )
- asprintf(&(psong->dlna_pn), "AAC_ISO");
+ xasprintf(&(psong->dlna_pn), "AAC_ISO");
else if( psong->channels <= 6 && psong->bitrate <= 1440000 )
- asprintf(&(psong->dlna_pn), "AAC_MULT5_ISO");
+ xasprintf(&(psong->dlna_pn), "AAC_MULT5_ISO");
else
DPRINTF(E_DEBUG, L_METADATA, "Unhandled AAC: %d channels, %d bitrate\n",
psong->channels, psong->bitrate);
diff --git a/tagutils/tagutils-asf.c b/tagutils/tagutils-asf.c
index 11da1ae..8ab5c07 100644
--- a/tagutils/tagutils-asf.c
+++ b/tagutils/tagutils-asf.c
@@ -47,15 +47,15 @@ _pick_dlna_profile(struct song_metadata *psong, uint16_t format)
{
case WMA:
if( psong->max_bitrate < 193000 )
- asprintf(&(psong->dlna_pn), "WMABASE");
+ xasprintf(&(psong->dlna_pn), "WMABASE");
else if( psong->max_bitrate < 385000 )
- asprintf(&(psong->dlna_pn), "WMAFULL");
+ xasprintf(&(psong->dlna_pn), "WMAFULL");
break;
case WMAPRO:
- asprintf(&(psong->dlna_pn), "WMAPRO");
+ xasprintf(&(psong->dlna_pn), "WMAPRO");
break;
case WMALSL:
- asprintf(&(psong->dlna_pn), "WMALSL%s",
+ xasprintf(&(psong->dlna_pn), "WMALSL%s",
psong->channels > 2 ? "_MULT5" : "");
default:
break;
diff --git a/tagutils/tagutils-mp3.c b/tagutils/tagutils-mp3.c
index 701bca1..c87a065 100644
--- a/tagutils/tagutils-mp3.c
+++ b/tagutils/tagutils-mp3.c
@@ -770,7 +770,7 @@ _get_mp3fileinfo(char *file, struct song_metadata *psong)
//DEBUG DPRINTF(E_INFO, L_SCANNER, "Got fileinfo successfully for file=%s song_length=%d\n", file, psong->song_length);
psong->blockalignment = 1;
- asprintf(&(psong->dlna_pn), "MP3");
+ xasprintf(&(psong->dlna_pn), "MP3");
return 0;
}
diff --git a/tagutils/tagutils-pcm.c b/tagutils/tagutils-pcm.c
index ce64ed5..ed044ea 100644
--- a/tagutils/tagutils-pcm.c
+++ b/tagutils/tagutils-pcm.c
@@ -42,8 +42,8 @@ _get_pcmfileinfo(char *filename, struct song_metadata *psong)
psong->song_length = (sec * 1000) + ms;
psong->lossless = 1;
- asprintf(&(psong->mime), "audio/L16;rate=%d;channels=%d", psong->samplerate, psong->channels);
- asprintf(&(psong->dlna_pn), "LPCM");
+ xasprintf(&(psong->mime), "audio/L16;rate=%d;channels=%d", psong->samplerate, psong->channels);
+ xasprintf(&(psong->dlna_pn), "LPCM");
return 0;
}
diff --git a/tagutils/tagutils.c b/tagutils/tagutils.c
index 9813bfc..e86eb29 100644
--- a/tagutils/tagutils.c
+++ b/tagutils/tagutils.c
@@ -46,6 +46,7 @@
#include "misc.h"
#include "textutils.h"
#include "../metadata.h"
+#include "../utils.h"
#include "../log.h"
struct id3header {