Codebase list squeezelite / 59aee37
fix error in ffmpeg dll loading, support ffmpeg on windows (works with Zeranoe FFmpeg builds) Adrian Smith 10 years ago
2 changed file(s) with 9 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
143143 }
144144
145145 static int _read_data(void *opaque, u8_t *buffer, int buf_size) {
146 size_t bytes;
147
146148 LOCK_S;
147149
148 size_t bytes = min(_buf_used(streambuf), _buf_cont_read(streambuf));
150 bytes = min(_buf_used(streambuf), _buf_cont_read(streambuf));
149151 ff->end_of_stream = (stream.state <= DISCONNECT && bytes == 0);
150152 bytes = min(bytes, buf_size);
151153
589591 ff->avcodec_alloc_frame = dlsym(handle_codec, "avcodec_alloc_frame");
590592 ff->avcodec_free_frame = dlsym(handle_codec, "avcodec_free_frame");
591593 ff->avcodec_decode_audio4 = dlsym(handle_codec, "avcodec_decode_audio4");
594 ff->av_init_packet = dlsym(handle_codec, "av_init_packet");
595 ff->av_free_packet = dlsym(handle_codec, "av_free_packet");
592596
593597 if ((err = dlerror()) != NULL) {
594598 LOG_INFO("dlerror: %s", err);
604608 ff->avformat_open_input = dlsym(handle_format, "avformat_open_input");
605609 ff->avformat_find_stream_info = dlsym(handle_format, "avformat_find_stream_info");
606610 ff->avio_alloc_context = dlsym(handle_format, "avio_alloc_context");
607 ff->av_init_packet = dlsym(handle_format, "av_init_packet");
608 ff->av_free_packet = dlsym(handle_format, "av_free_packet");
609611 ff->av_read_frame = dlsym(handle_format, "av_read_frame");
610612 ff->av_find_input_format= dlsym(handle_format, "av_find_input_format");
611613 ff->av_register_all = dlsym(handle_format, "av_register_all");
7171 #define PROCESS 0
7272 #endif
7373
74 #if defined(FFMPEG) && !WIN
74 #if defined(FFMPEG)
7575 #undef FFMPEG
7676 #define FFMPEG 1
7777 #else
111111 #define LIBVORBIS "libvorbisfile.dll"
112112 #define LIBTREMOR "libvorbisidec.dll"
113113 #define LIBFAAD "libfaad2.dll"
114 #define LIBAVUTIL "avutil-%d.dll"
115 #define LIBAVCODEC "avcodec-%d.dll"
116 #define LIBAVFORMAT "avformat-%d.dll"
114117 #endif
115118
116119 // config options