Mercurial > audlegacy-plugins
comparison src/wavpack/libwavpack.cxx @ 115:2e77e3fdd3c1 trunk
[svn] - make sure the tuple data is copied, not referenced (oops)
author | nenolod |
---|---|
date | Tue, 24 Oct 2006 19:50:04 -0700 |
parents | 9bb02321f986 |
children | 16e2c64d8b2b |
comparison
equal
deleted
inserted
replaced
114:9bb02321f986 | 115:2e77e3fdd3c1 |
---|---|
305 ti->file_name = g_strdup(g_basename(fn)); | 305 ti->file_name = g_strdup(g_basename(fn)); |
306 ti->file_ext = "wv"; | 306 ti->file_ext = "wv"; |
307 | 307 |
308 load_tag(&tag, ctx); | 308 load_tag(&tag, ctx); |
309 | 309 |
310 ti->track_name = tag.title; | 310 ti->track_name = g_strdup(tag.title); |
311 ti->performer = tag.artist; | 311 ti->performer = g_strdup(tag.artist); |
312 ti->album_name = tag.album; | 312 ti->album_name = g_strdup(tag.album); |
313 ti->date = tag.year; | 313 ti->date = g_strdup(tag.year); |
314 ti->track_number = atoi(tag.track); | 314 ti->track_number = atoi(tag.track); |
315 if (ti->track_number < 0) | 315 if (ti->track_number < 0) |
316 ti->track_number = 0; | 316 ti->track_number = 0; |
317 ti->year = atoi(tag.year); | 317 ti->year = atoi(tag.year); |
318 if (ti->year < 0) | 318 if (ti->year < 0) |
319 ti->year = 0; | 319 ti->year = 0; |
320 ti->genre = tag.genre; | 320 ti->genre = g_strdup(tag.genre); |
321 ti->comment = tag.comment; | 321 ti->comment = g_strdup(tag.comment); |
322 ti->length = (int)(WavpackGetNumSamples(ctx) / sample_rate) * 1000; | 322 ti->length = (int)(WavpackGetNumSamples(ctx) / sample_rate) * 1000; |
323 | 323 |
324 return ti; | 324 return ti; |
325 } | 325 } |
326 | 326 |
327 static char * | 327 static char * |
328 generate_title(const char *fn, WavpackContext *ctx) | 328 generate_title(const char *fn, WavpackContext *ctx) |
329 { | 329 { |
330 static char *displaytitle = NULL; | 330 static char *displaytitle = NULL; |
331 ape_tag tag; | |
332 TitleInput *ti; | 331 TitleInput *ti; |
333 | 332 |
334 ti = tuple_from_WavpackContext(fn, ctx); | 333 ti = tuple_from_WavpackContext(fn, ctx); |
335 | 334 |
336 displaytitle = xmms_get_titlestring(xmms_get_gentitle_format(), ti); | 335 displaytitle = xmms_get_titlestring(xmms_get_gentitle_format(), ti); |
337 if (!displaytitle || *displaytitle == '\0' | 336 if (!displaytitle || *displaytitle == '\0') |
338 || (strlen(tag.title) == 0 && strlen(tag.artist) == 0)) | 337 displaytitle = g_strdup(fn); |
339 displaytitle = ti->file_name; | |
340 | 338 |
341 bmp_title_input_free(ti); | 339 bmp_title_input_free(ti); |
342 | 340 |
343 return displaytitle; | 341 return displaytitle; |
344 } | 342 } |