143 | 143 |
}
|
144 | 144 |
|
145 | 145 |
static int _read_data(void *opaque, u8_t *buffer, int buf_size) {
|
|
146 |
size_t bytes;
|
|
147 |
|
146 | 148 |
LOCK_S;
|
147 | 149 |
|
148 | |
size_t bytes = min(_buf_used(streambuf), _buf_cont_read(streambuf));
|
|
150 |
bytes = min(_buf_used(streambuf), _buf_cont_read(streambuf));
|
149 | 151 |
ff->end_of_stream = (stream.state <= DISCONNECT && bytes == 0);
|
150 | 152 |
bytes = min(bytes, buf_size);
|
151 | 153 |
|
|
589 | 591 |
ff->avcodec_alloc_frame = dlsym(handle_codec, "avcodec_alloc_frame");
|
590 | 592 |
ff->avcodec_free_frame = dlsym(handle_codec, "avcodec_free_frame");
|
591 | 593 |
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");
|
592 | 596 |
|
593 | 597 |
if ((err = dlerror()) != NULL) {
|
594 | 598 |
LOG_INFO("dlerror: %s", err);
|
|
604 | 608 |
ff->avformat_open_input = dlsym(handle_format, "avformat_open_input");
|
605 | 609 |
ff->avformat_find_stream_info = dlsym(handle_format, "avformat_find_stream_info");
|
606 | 610 |
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");
|
609 | 611 |
ff->av_read_frame = dlsym(handle_format, "av_read_frame");
|
610 | 612 |
ff->av_find_input_format= dlsym(handle_format, "av_find_input_format");
|
611 | 613 |
ff->av_register_all = dlsym(handle_format, "av_register_all");
|