Lines Matching defs:openmpt
82 OpenMPTContext *openmpt = s->priv_data;
105 openmpt->module = openmpt_module_create_from_memory2(buf, size, openmpt_logfunc, s, NULL, NULL, &error, NULL, NULL);
107 if (!openmpt->module) {
116 openmpt->module = openmpt_module_create_from_memory(buf, size, openmpt_logfunc, s, NULL);
118 if (!openmpt->module)
122 if (openmpt->subsong >= openmpt_module_get_num_subsongs(openmpt->module)) {
123 av_log(s, AV_LOG_ERROR, "Invalid subsong index: %d\n", openmpt->subsong);
127 if (openmpt->subsong != -2) {
128 if (openmpt->subsong >= 0) {
129 av_dict_set_int(&s->metadata, "track", openmpt->subsong + 1, 0);
131 ret = openmpt_module_select_subsong(openmpt->module, openmpt->subsong);
133 av_log(s, AV_LOG_ERROR, "Could not select requested subsong: %d", openmpt->subsong);
138 openmpt->duration = openmpt_module_get_duration_seconds(openmpt->module);
140 add_meta(s, "artist", openmpt_module_get_metadata(openmpt->module, "artist"));
141 add_meta(s, "title", openmpt_module_get_metadata(openmpt->module, "title"));
142 add_meta(s, "encoder", openmpt_module_get_metadata(openmpt->module, "tracker"));
143 add_meta(s, "comment", openmpt_module_get_metadata(openmpt->module, "message"));
144 add_meta(s, "date", openmpt_module_get_metadata(openmpt->module, "date"));
150 st->duration = llrint(openmpt->duration*AV_TIME_BASE);
154 st->codecpar->sample_rate = openmpt->sample_rate;
155 ret = av_channel_layout_copy(&st->codecpar->ch_layout, &openmpt->ch_layout);
166 OpenMPTContext *openmpt = s->priv_data;
167 int n_samples = AUDIO_PKT_SIZE / (openmpt->ch_layout.nb_channels ? openmpt->ch_layout.nb_channels*4 : 4);
173 switch (openmpt->ch_layout.nb_channels) {
175 ret = openmpt_module_read_float_mono(openmpt->module, openmpt->sample_rate,
179 ret = openmpt_module_read_interleaved_float_stereo(openmpt->module, openmpt->sample_rate,
183 ret = openmpt_module_read_interleaved_float_quad(openmpt->module, openmpt->sample_rate,
187 av_log(s, AV_LOG_ERROR, "Unsupported number of channels: %d", openmpt->ch_layout.nb_channels);
196 pkt->size = ret * (openmpt->ch_layout.nb_channels * 4);
203 OpenMPTContext *openmpt = s->priv_data;
204 if (openmpt->module) {
205 openmpt_module_destroy(openmpt->module);
206 openmpt->module = NULL;
213 OpenMPTContext *openmpt = s->priv_data;
214 openmpt_module_set_position_seconds(openmpt->module, (double)ts/AV_TIME_BASE);