From a2d74a6b200f25a721eb20a6fae4106e8275e6e5 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Sat, 30 Jul 2011 04:03:47 +0300 Subject: stream_cdda: fix incorrectly allocated option field After commit 39e373aa8d ("options: allocate dynamic options with talloc") dynamically allocated options must be allocated with talloc. stream_cdda allocated a string used with the option machinery using strdup(). Fix. Also silence a warning. --- stream/stream_cdda.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'stream') diff --git a/stream/stream_cdda.c b/stream/stream_cdda.c index 53ac76cf25..317292faec 100644 --- a/stream/stream_cdda.c +++ b/stream/stream_cdda.c @@ -27,6 +27,8 @@ #include #include +#include "talloc.h" + #include "stream.h" #include "m_option.h" #include "m_struct.h" @@ -302,9 +304,9 @@ static int open_cdda(stream_t *st,int m, void* opts, int* file_format) { if(!p->device) { if (cdrom_device) - p->device = strdup(cdrom_device); + p->device = talloc_strdup(NULL, cdrom_device); else - p->device = strdup(DEFAULT_CDROM_DEVICE); + p->device = talloc_strdup(NULL, DEFAULT_CDROM_DEVICE); } #ifdef CONFIG_CDDB @@ -355,7 +357,7 @@ static int open_cdda(stream_t *st,int m, void* opts, int* file_format) { } cd_info = cd_info_new(); - mp_tmsg(MSGT_OPEN,MSGL_INFO,"Found audio CD with %ld tracks.\n",cdda_tracks(cdd)); + mp_tmsg(MSGT_OPEN,MSGL_INFO,"Found audio CD with %d tracks.\n", (int)cdda_tracks(cdd)); for(i=0;itracks;i++) { char track_name[80]; long sec=cdda_track_firstsector(cdd,i+1); -- cgit v1.2.3