"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "utils.c" between
minidlna-1.2.1.tar.gz and minidlna-1.3.0.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.

utils.c  (minidlna-1.2.1):utils.c  (minidlna-1.3.0)
skipping to change at line 350 skipping to change at line 350
else if( strcmp(mime+6, "flac") == 0 ) else if( strcmp(mime+6, "flac") == 0 )
return "flac"; return "flac";
else if( strcmp(mime+6, "x-wav") == 0 ) else if( strcmp(mime+6, "x-wav") == 0 )
return "wav"; return "wav";
else if( strncmp(mime+6, "L16", 3) == 0 ) else if( strncmp(mime+6, "L16", 3) == 0 )
return "pcm"; return "pcm";
else if( strcmp(mime+6, "3gpp") == 0 ) else if( strcmp(mime+6, "3gpp") == 0 )
return "3gp"; return "3gp";
else if( strcmp(mime, "application/ogg") == 0 ) else if( strcmp(mime, "application/ogg") == 0 )
return "ogg"; return "ogg";
else if( strcmp(mime+6, "x-dsd") == 0 )
return "dsd";
break; break;
case 'v': case 'v':
if( strcmp(mime+6, "avi") == 0 ) if( strcmp(mime+6, "avi") == 0 )
return "avi"; return "avi";
else if( strcmp(mime+6, "divx") == 0 ) else if( strcmp(mime+6, "divx") == 0 )
return "avi"; return "avi";
else if( strcmp(mime+6, "x-msvideo") == 0 ) else if( strcmp(mime+6, "x-msvideo") == 0 )
return "avi"; return "avi";
else if( strcmp(mime+6, "mpeg") == 0 ) else if( strcmp(mime+6, "mpeg") == 0 )
return "mpg"; return "mpg";
skipping to change at line 417 skipping to change at line 419
int int
is_audio(const char * file) is_audio(const char * file)
{ {
return (ends_with(file, ".mp3") || ends_with(file, ".flac") || return (ends_with(file, ".mp3") || ends_with(file, ".flac") ||
ends_with(file, ".wma") || ends_with(file, ".asf") || ends_with(file, ".wma") || ends_with(file, ".asf") ||
ends_with(file, ".fla") || ends_with(file, ".flc") || ends_with(file, ".fla") || ends_with(file, ".flc") ||
ends_with(file, ".m4a") || ends_with(file, ".aac") || ends_with(file, ".m4a") || ends_with(file, ".aac") ||
ends_with(file, ".mp4") || ends_with(file, ".m4p") || ends_with(file, ".mp4") || ends_with(file, ".m4p") ||
ends_with(file, ".wav") || ends_with(file, ".ogg") || ends_with(file, ".wav") || ends_with(file, ".ogg") ||
ends_with(file, ".pcm") || ends_with(file, ".3gp")); ends_with(file, ".pcm") || ends_with(file, ".3gp") ||
ends_with(file, ".dsf") || ends_with(file, ".dff"));
} }
int int
is_image(const char * file) is_image(const char * file)
{ {
return (ends_with(file, ".jpg") || ends_with(file, ".jpeg")); return (ends_with(file, ".jpg") || ends_with(file, ".jpeg"));
} }
int int
is_playlist(const char * file) is_playlist(const char * file)
skipping to change at line 534 skipping to change at line 537
struct media_dir_s *media_dir; struct media_dir_s *media_dir;
for (media_dir = media_dirs; media_dir; media_dir = media_dir->next) for (media_dir = media_dirs; media_dir; media_dir = media_dir->next)
{ {
if (strncmp(path, media_dir->path, strlen(media_dir->path)) == 0) if (strncmp(path, media_dir->path, strlen(media_dir->path)) == 0)
return media_dir->types; return media_dir->types;
} }
return ALL_MEDIA; return ALL_MEDIA;
} }
/*
* Add and subtract routines for timevals.
* N.B.: subtract routine doesn't deal with
* results which are before the beginning,
* it just gets very confused in this case.
* Caveat emptor.
*/
static void timevalfix(struct timeval *);
void
timevaladd(struct timeval *t1, const struct timeval *t2)
{
t1->tv_sec += t2->tv_sec;
t1->tv_usec += t2->tv_usec;
timevalfix(t1);
}
void
timevalsub(struct timeval *t1, const struct timeval *t2)
{
t1->tv_sec -= t2->tv_sec;
t1->tv_usec -= t2->tv_usec;
timevalfix(t1);
}
static void
timevalfix(struct timeval *t1)
{
if (t1->tv_usec < 0) {
t1->tv_sec--;
t1->tv_usec += 1000000;
}
if (t1->tv_usec >= 1000000) {
t1->tv_sec++;
t1->tv_usec -= 1000000;
}
}
 End of changes. 3 change blocks. 
1 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)