"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tagutils/tagutils-flc.c" between
minidlna-1.1.4.tar.gz and minidlna-1.1.5.tar.gz

About: ReadyMedia (formerly known as MiniDLNA) is a simple media server software, with the aim of being fully compliant with DLNA/UPnP-AV clients.

tagutils-flc.c  (minidlna-1.1.4):tagutils-flc.c  (minidlna-1.1.5)
skipping to change at line 40 skipping to change at line 40
int err = 0; int err = 0;
if(!(iterator = FLAC__metadata_simple_iterator_new())) if(!(iterator = FLAC__metadata_simple_iterator_new()))
{ {
DPRINTF(E_FATAL, L_SCANNER, "Out of memory while FLAC__metadata_s imple_iterator_new()\n"); DPRINTF(E_FATAL, L_SCANNER, "Out of memory while FLAC__metadata_s imple_iterator_new()\n");
return -1; return -1;
} }
if(!FLAC__metadata_simple_iterator_init(iterator, filename, true, true)) if(!FLAC__metadata_simple_iterator_init(iterator, filename, true, true))
{ {
DPRINTF(E_ERROR, L_SCANNER, "Cannot extract tag from %s\n", filen DPRINTF(E_ERROR, L_SCANNER, "Cannot extract tag from %s [%s]\n",
ame); filename,
return -1; FLAC__Metadata_SimpleIteratorStatusString[FLAC__metadata_
simple_iterator_status(iterator)]);
goto _exit;
} }
do { do {
if(!(block = FLAC__metadata_simple_iterator_get_block(iterator))) if(!(block = FLAC__metadata_simple_iterator_get_block(iterator)))
{ {
DPRINTF(E_ERROR, L_SCANNER, "Cannot extract tag from %s\n ", filename); DPRINTF(E_ERROR, L_SCANNER, "Cannot extract tag from %s\n ", filename);
err = -1; err = -1;
goto _exit; goto _exit;
} }
switch(block->type) switch(block->type)
{ {
case FLAC__METADATA_TYPE_STREAMINFO: case FLAC__METADATA_TYPE_STREAMINFO:
if (!block->data.stream_info.sample_rate)
break; /* Info is crap, avoid div-by-zero. */
sec = (unsigned int)(block->data.stream_info.total_sample s / sec = (unsigned int)(block->data.stream_info.total_sample s /
block->data.stream_info.sample_rate) ; block->data.stream_info.sample_rate) ;
ms = (unsigned int)(((block->data.stream_info.total_sampl es % ms = (unsigned int)(((block->data.stream_info.total_sampl es %
block->data.stream_info.sample_rate ) * 1000) / block->data.stream_info.sample_rate ) * 1000) /
block->data.stream_info.sample_rate ); block->data.stream_info.sample_rate );
if ((sec == 0) && (ms == 0)) if ((sec == 0) && (ms == 0))
break; /* Info is crap, escape div-by-zero. */ break; /* Info is crap, escape div-by-zero. */
psong->song_length = (sec * 1000) + ms; psong->song_length = (sec * 1000) + ms;
psong->bitrate = (((uint64_t)(psong->file_size) * 1000) / (psong->song_length / 8)); psong->bitrate = (((uint64_t)(psong->file_size) * 1000) / (psong->song_length / 8));
psong->samplerate = block->data.stream_info.sample_rate; psong->samplerate = block->data.stream_info.sample_rate;
skipping to change at line 78 skipping to change at line 81
case FLAC__METADATA_TYPE_VORBIS_COMMENT: case FLAC__METADATA_TYPE_VORBIS_COMMENT:
for(i = 0; i < block->data.vorbis_comment.num_comments; i ++) for(i = 0; i < block->data.vorbis_comment.num_comments; i ++)
{ {
vc_scan(psong, vc_scan(psong,
(char*)block->data.vorbis_comment.comment s[i].entry, (char*)block->data.vorbis_comment.comment s[i].entry,
block->data.vorbis_comment.comments[i].le ngth); block->data.vorbis_comment.comments[i].le ngth);
} }
break; break;
#if FLAC_API_VERSION_CURRENT >= 10 #if FLAC_API_VERSION_CURRENT >= 10
case FLAC__METADATA_TYPE_PICTURE: case FLAC__METADATA_TYPE_PICTURE:
if (psong->image) {
DPRINTF(E_MAXDEBUG, L_SCANNER, "Ignoring addition
al image [%s]\n", filename);
break;
}
psong->image_size = block->data.picture.data_length; psong->image_size = block->data.picture.data_length;
if((psong->image = malloc(psong->image_size))) if((psong->image = malloc(psong->image_size)))
memcpy(psong->image, block->data.picture.data, ps ong->image_size); memcpy(psong->image, block->data.picture.data, ps ong->image_size);
else else
DPRINTF(E_ERROR, L_SCANNER, "Out of memory [%s]\n ", filename); DPRINTF(E_ERROR, L_SCANNER, "Out of memory [%s]\n ", filename);
break; break;
#endif #endif
default: default:
break; break;
} }
 End of changes. 3 change blocks. 
3 lines changed or deleted 12 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS