diff options
author | Uoti Urpala <uau@mplayer2.org> | 2011-07-30 04:03:47 +0300 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2011-07-30 04:03:47 +0300 |
commit | a2d74a6b200f25a721eb20a6fae4106e8275e6e5 (patch) | |
tree | c3849b16b0299b7e330aaad3679a5430ddd23c22 /stream | |
parent | 85f0577cd9f520ccae29a0b85b4976df3b27db39 (diff) | |
download | mpv-a2d74a6b200f25a721eb20a6fae4106e8275e6e5.tar.bz2 mpv-a2d74a6b200f25a721eb20a6fae4106e8275e6e5.tar.xz |
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.
Diffstat (limited to 'stream')
-rw-r--r-- | stream/stream_cdda.c | 8 |
1 files changed, 5 insertions, 3 deletions
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 <stdio.h> #include <stdlib.h> +#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;i<cdd->tracks;i++) { char track_name[80]; long sec=cdda_track_firstsector(cdd,i+1); |