+ // either v52 or v53 should be ok
+ soh = dlopen("libavcodec.so.52", RTLD_NOW);
+ if (soh == NULL)
+ soh = dlopen("libavcodec.so.53", RTLD_NOW);
+ if (soh == NULL) {
+ lprintf("mp3dec: load libavcodec.so: %s\n", dlerror());
+ return -1;
+ }
+
+ avcodec_register_all = dlsym(soh, "avcodec_register_all");
+ avcodec_find_decoder = dlsym(soh, "avcodec_find_decoder");
+ avcodec_alloc_context = dlsym(soh, "avcodec_alloc_context");
+ avcodec_open = dlsym(soh, "avcodec_open");
+ av_free = dlsym(soh, "av_free");
+ p_av_init_packet = dlsym(soh, "av_init_packet");
+ p_avcodec_decode_audio3 = dlsym(soh, "avcodec_decode_audio3");
+
+ if (avcodec_register_all == NULL || avcodec_find_decoder == NULL
+ || avcodec_alloc_context == NULL || avcodec_open == NULL
+ || av_free == NULL
+ || p_av_init_packet == NULL || p_avcodec_decode_audio3 == NULL)
+ {
+ lprintf("mp3dec: missing symbol(s) in libavcodec.so\n");
+ dlclose(soh);
+ return -1;
+ }
+