[vlc-commits] [Git][videolan/vlc][master] preparser: simplify art fetched error handling
Steve Lhomme (@robUx4)
gitlab at videolan.org
Fri Aug 25 06:06:47 UTC 2023
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
6580f17e by Marvin Scholz at 2023-08-25T05:44:04+00:00
preparser: simplify art fetched error handling
Instead of two nearly-identical exit-cases, just keep track of the
state in an additional variable.
- - - - -
1 changed file:
- src/preparser/fetcher.c
Changes:
=====================================
src/preparser/fetcher.c
=====================================
@@ -303,6 +303,7 @@ static void RunDownloader(void *userdata)
{
vlc_thread_set_name("vlc-run-fetcher");
+ bool fetched = true;
struct task *task = userdata;
input_fetcher_t *fetcher = task->fetcher;
@@ -355,26 +356,18 @@ static void RunDownloader(void *userdata)
free( output_stream.ptr );
AddAlbumCache( fetcher, task->item, true );
+error:
+ fetched = false;
out:
vlc_interrupt_set(NULL);
- if( psz_arturl )
+ if( fetched )
{
var_SetAddress( fetcher->owner, "item-change", task->item );
input_item_SetArtFetched( task->item, true );
}
-
free( psz_arturl );
- NotifyArtFetchEnded(task, psz_arturl != NULL);
- FetcherRemoveTask(fetcher, task);
- TaskDelete(task);
- return;
-
-error:
- vlc_interrupt_set(NULL);
-
- FREENULL( psz_arturl );
- NotifyArtFetchEnded(task, false);
+ NotifyArtFetchEnded(task, fetched);
FetcherRemoveTask(fetcher, task);
TaskDelete(task);
}
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/6580f17e4dcfd5e486765e1b3b8a74faa6be9d2e
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/6580f17e4dcfd5e486765e1b3b8a74faa6be9d2e
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list