"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "metadata.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.

metadata.c  (minidlna-1.1.4):metadata.c  (minidlna-1.1.5)
skipping to change at line 187 skipping to change at line 187
if( !nfo ) if( !nfo )
return; return;
nread = fread(&buf, 1, sizeof(buf), nfo); nread = fread(&buf, 1, sizeof(buf), nfo);
ParseNameValue(buf, nread, &xml, 0); ParseNameValue(buf, nread, &xml, 0);
//printf("\ttype: %s\n", GetValueFromNameValueList(&xml, "rootElement")); //printf("\ttype: %s\n", GetValueFromNameValueList(&xml, "rootElement"));
val = GetValueFromNameValueList(&xml, "title"); val = GetValueFromNameValueList(&xml, "title");
if( val ) if( val )
{ {
char *esc_tag = unescape_tag(val, 1); char *esc_tag, *title;
val2 = GetValueFromNameValueList(&xml, "episodetitle"); val2 = GetValueFromNameValueList(&xml, "episodetitle");
if( val2 ) { if( val2 )
char *esc_tag2 = unescape_tag(val2, 1); xasprintf(&title, "%s - %s", val, val2);
xasprintf(&m->title, "%s - %s", esc_tag, esc_tag2); else
free(esc_tag2); title = strdup(val);
} else { esc_tag = unescape_tag(title, 1);
m->title = escape_tag(esc_tag, 1); m->title = escape_tag(esc_tag, 1);
}
free(esc_tag); free(esc_tag);
free(title);
} }
val = GetValueFromNameValueList(&xml, "plot"); val = GetValueFromNameValueList(&xml, "plot");
if( val ) { if( val ) {
char *esc_tag = unescape_tag(val, 1); char *esc_tag = unescape_tag(val, 1);
m->comment = escape_tag(esc_tag, 1); m->comment = escape_tag(esc_tag, 1);
free(esc_tag); free(esc_tag);
} }
val = GetValueFromNameValueList(&xml, "capturedate"); val = GetValueFromNameValueList(&xml, "capturedate");
skipping to change at line 384 skipping to change at line 384
if( (esc_tag = escape_tag(m.title, 0)) ) if( (esc_tag = escape_tag(m.title, 0)) )
{ {
free_flags |= FLAG_TITLE; free_flags |= FLAG_TITLE;
m.title = esc_tag; m.title = esc_tag;
} }
} }
else else
{ {
m.title = name; m.title = name;
} }
for( i=ROLE_START; i<N_ROLE; i++ ) for( i = ROLE_START; i < N_ROLE; i++ )
{ {
if( song.contributor[i] && *song.contributor[i] ) if( song.contributor[i] && *song.contributor[i] )
{ {
m.creator = trim(song.contributor[i]); m.creator = trim(song.contributor[i]);
if( strlen(m.creator) > 48 ) if( strlen(m.creator) > 48 )
{ {
m.creator = strdup("Various Artists"); m.creator = strdup("Various Artists");
free_flags |= FLAG_CREATOR; free_flags |= FLAG_CREATOR;
} }
else if( (esc_tag = escape_tag(m.creator, 0)) ) else if( (esc_tag = escape_tag(m.creator, 0)) )
{ {
m.creator = esc_tag; m.creator = esc_tag;
free_flags |= FLAG_CREATOR; free_flags |= FLAG_CREATOR;
} }
m.artist = m.creator; m.artist = m.creator;
break; break;
} }
} }
/* If there is a band associated with the album, use it for virtual conta /* If there is a album artist or band associated with the album,
iners. */ use it for virtual containers. */
if( (i != ROLE_BAND) && (i != ROLE_ALBUMARTIST) ) if( i < ROLE_ALBUMARTIST )
{ {
if( song.contributor[ROLE_BAND] && *song.contributor[ROLE_BAND] ) for( i = ROLE_ALBUMARTIST; i <= ROLE_BAND; i++ )
{
if( song.contributor[i] && *song.contributor[i] )
break;
}
if( i <= ROLE_BAND )
{ {
i = ROLE_BAND;
m.artist = trim(song.contributor[i]); m.artist = trim(song.contributor[i]);
if( strlen(m.artist) > 48 ) if( strlen(m.artist) > 48 )
{ {
m.artist = strdup("Various Artists"); m.artist = strdup("Various Artists");
free_flags |= FLAG_ARTIST; free_flags |= FLAG_ARTIST;
} }
else if( (esc_tag = escape_tag(m.artist, 0)) ) else if( (esc_tag = escape_tag(m.artist, 0)) )
{ {
m.artist = esc_tag; m.artist = esc_tag;
free_flags |= FLAG_ARTIST; free_flags |= FLAG_ARTIST;
skipping to change at line 692 skipping to change at line 697
if( ret != 0 ) if( ret != 0 )
{ {
char err[128]; char err[128];
av_strerror(ret, err, sizeof(err)); av_strerror(ret, err, sizeof(err));
DPRINTF(E_WARN, L_METADATA, "Opening %s failed! [%s]\n", path, er r); DPRINTF(E_WARN, L_METADATA, "Opening %s failed! [%s]\n", path, er r);
return 0; return 0;
} }
//dump_format(ctx, 0, NULL, 0); //dump_format(ctx, 0, NULL, 0);
for( i=0; i<ctx->nb_streams; i++) for( i=0; i<ctx->nb_streams; i++)
{ {
if( audio_stream == -1 && if( ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO &&
ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO ) audio_stream == -1 )
{ {
audio_stream = i; audio_stream = i;
ac = ctx->streams[audio_stream]->codec; ac = ctx->streams[audio_stream]->codec;
continue; continue;
} }
else if( video_stream == -1 && else if( ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
!lav_is_thumbnail_stream(ctx->streams[i], &m.thumb_data, &m.thumb_size) && !lav_is_thumbnail_stream(ctx->streams[i], &m.thumb_data, &m.thumb_size) &&
ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO ) video_stream == -1 )
{ {
video_stream = i; video_stream = i;
vc = ctx->streams[video_stream]->codec; vc = ctx->streams[video_stream]->codec;
continue; continue;
} }
} }
path_cpy = strdup(path); path_cpy = strdup(path);
basepath = basename(path_cpy); basepath = basename(path_cpy);
if( !vc ) if( !vc )
{ {
 End of changes. 10 change blocks. 
18 lines changed or deleted 22 lines changed or added

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