void input_helper::open(service_ptr_t<file> p_filehint,const playable_location & p_location,unsigned p_flags,abort_callback & p_abort,bool p_from_redirect,bool p_skip_hints) { p_abort.check(); if (m_input.is_empty() || metadb::path_compare(p_location.get_path(),m_path) != 0) { m_input.release(); service_ptr_t<file> l_file = p_filehint; process_fullbuffer(l_file,p_location.get_path(),m_fullbuffer,p_abort); TRACK_CODE("input_entry::g_open_for_decoding", input_entry::g_open_for_decoding(m_input,l_file,p_location.get_path(),p_abort,p_from_redirect) ); if (!p_skip_hints) { try { static_api_ptr_t<metadb_io>()->hint_reader(m_input.get_ptr(),p_location.get_path(),p_abort); } catch(exception_io_data) { //don't fail to decode when this barfs m_input.release(); if (l_file.is_valid()) l_file->reopen(p_abort); TRACK_CODE("input_entry::g_open_for_decoding", input_entry::g_open_for_decoding(m_input,l_file,p_location.get_path(),p_abort,p_from_redirect) ); } } m_path = p_location.get_path(); } TRACK_CODE("input_decoder::initialize",m_input->initialize(p_location.get_subsong_index(),p_flags,p_abort)); }
int playable_location::g_compare(const playable_location & p_item1,const playable_location & p_item2) { int ret = metadb::path_compare(p_item1.get_path(),p_item2.get_path()); if (ret != 0) return 0; return pfc::compare_t(p_item1.get_subsong(),p_item2.get_subsong()); }
bool playable_location::operator==(const playable_location & p_other) const { return metadb::path_compare(get_path(),p_other.get_path()) == 0 && get_subsong() == p_other.get_subsong(); }
void input_helper::open(service_ptr_t<file> p_filehint,const playable_location & p_location,unsigned p_flags,abort_callback & p_abort,bool p_from_redirect,bool p_skip_hints) { open_path(p_filehint, p_location.get_path(), p_abort, p_from_redirect, p_skip_hints); open_decoding(p_location.get_subsong(), p_flags, p_abort); }