void seekabilizer::g_seekabilize(service_ptr_t<file> & p_reader,t_size p_buffer_size,abort_callback & p_abort) { if (p_reader.is_valid() && p_reader->is_remote() && p_buffer_size > 0) { service_ptr_t<seekabilizer> instance = new service_impl_t<seekabilizer>(); instance->initialize(p_reader,p_buffer_size,p_abort); p_reader = instance.get_ptr(); } }
void tag_processor::read_id3v2_trailing(const service_ptr_t<file> & p_file,file_info & p_info,abort_callback & p_abort) { file_info_impl id3v2, trailing; bool have_id3v2 = true, have_trailing = true; try { read_id3v2(p_file,id3v2,p_abort); } catch(exception_io_data) { have_id3v2 = false; } if (!have_id3v2 || !p_file->is_remote()) try { read_trailing(p_file,trailing,p_abort); } catch(exception_io_data) { have_trailing = false; } if (!have_id3v2 && !have_trailing) throw exception_tag_not_found(); if (have_id3v2) { p_info._set_tag(id3v2); if (have_trailing) p_info._add_tag(trailing); } else { p_info._set_tag(trailing); } }