summaryrefslogtreecommitdiff
path: root/plugins/ffmpeg/ffmpeg.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/ffmpeg/ffmpeg.c')
-rw-r--r--plugins/ffmpeg/ffmpeg.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/plugins/ffmpeg/ffmpeg.c b/plugins/ffmpeg/ffmpeg.c
index 020f2a1c..8082b1d2 100644
--- a/plugins/ffmpeg/ffmpeg.c
+++ b/plugins/ffmpeg/ffmpeg.c
@@ -693,15 +693,18 @@ ffmpeg_init_exts (void) {
}
static int
-ffmpeg_on_configchanged (DB_event_t *ev, uintptr_t data) {
- ffmpeg_init_exts ();
+ffmpeg_message (uint32_t id, uintptr_t ctx, uint32_t p1, uint32_t p2) {
+ switch (id) {
+ case DB_EV_CONFIGCHANGED:
+ ffmpeg_init_exts ();
+ break;
+ }
return 0;
}
static int
ffmpeg_start (void) {
ffmpeg_init_exts ();
- deadbeef->ev_subscribe (DB_PLUGIN (&plugin), DB_EV_CONFIGCHANGED, DB_CALLBACK (ffmpeg_on_configchanged), 0);
avcodec_init ();
av_register_all ();
av_register_protocol (&vfswrapper);
@@ -710,7 +713,6 @@ ffmpeg_start (void) {
static int
ffmpeg_stop (void) {
- deadbeef->ev_unsubscribe (DB_PLUGIN (&plugin), DB_EV_CONFIGCHANGED, DB_CALLBACK (ffmpeg_on_configchanged), 0);
for (int i = 0; exts[i]; i++) {
free (exts[i]);
}
@@ -806,6 +808,7 @@ static DB_decoder_t plugin = {
.plugin.start = ffmpeg_start,
.plugin.stop = ffmpeg_stop,
.plugin.configdialog = settings_dlg,
+ .plugin.message = ffmpeg_message,
.open = ffmpeg_open,
.init = ffmpeg_init,
.free = ffmpeg_free,