comparison src/ffmpeg/ffmpeg.c @ 835:485ba2ba5976 trunk

[svn] - working WMA playback. thanks to chainsaw for providing a ton and a half of WMA files.
author nenolod
date Mon, 12 Mar 2007 16:02:16 -0700
parents 07107d476f32
children 7efd0747b362
comparison
equal deleted inserted replaced
834:a9732dc1b92a 835:485ba2ba5976
204 AVCodec *codec2; 204 AVCodec *codec2;
205 205
206 if(av_open_input_file(&ic2, str_twenty_to_space(filename), NULL, 0, NULL) < 0) return 0; 206 if(av_open_input_file(&ic2, str_twenty_to_space(filename), NULL, 0, NULL) < 0) return 0;
207 207
208 for(wma_idx2 = 0; wma_idx2 < ic2->nb_streams; wma_idx2++) { 208 for(wma_idx2 = 0; wma_idx2 < ic2->nb_streams; wma_idx2++) {
209 c2 = &ic2->streams[wma_idx2]->codec; 209 c2 = ic2->streams[wma_idx2]->codec;
210 if(c2->codec_type == CODEC_TYPE_AUDIO) break; 210 if(c2->codec_type == CODEC_TYPE_AUDIO) break;
211 } 211 }
212 212
213 av_find_stream_info(ic2); 213 av_find_stream_info(ic2);
214 214
228 AVCodec *codec2; 228 AVCodec *codec2;
229 229
230 if(av_open_input_vfsfile(&ic2, filename, fd, NULL, 0, NULL) < 0) return 0; 230 if(av_open_input_vfsfile(&ic2, filename, fd, NULL, 0, NULL) < 0) return 0;
231 231
232 for(wma_idx2 = 0; wma_idx2 < ic2->nb_streams; wma_idx2++) { 232 for(wma_idx2 = 0; wma_idx2 < ic2->nb_streams; wma_idx2++) {
233 c2 = &ic2->streams[wma_idx2]->codec; 233 c2 = ic2->streams[wma_idx2]->codec;
234 if(c2->codec_type == CODEC_TYPE_AUDIO) break; 234 if(c2->codec_type == CODEC_TYPE_AUDIO) break;
235 } 235 }
236 236
237 av_find_stream_info(ic2); 237 av_find_stream_info(ic2);
238 238
279 { 279 {
280 TitleInput *tuple = NULL; 280 TitleInput *tuple = NULL;
281 AVFormatContext *in = NULL; 281 AVFormatContext *in = NULL;
282 gchar *filename_proxy = g_strdup(filename); 282 gchar *filename_proxy = g_strdup(filename);
283 283
284 if (av_open_input_file(&in, str_twenty_to_space(filename), NULL, 0, NULL) < 0) 284 if(av_open_input_file(&ic2, str_twenty_to_space(filename), NULL, 0, NULL) < 0)
285 return NULL; 285 return NULL;
286 286
287 tuple = bmp_title_input_new(); 287 tuple = bmp_title_input_new();
288 288
289 tuple->file_name = g_path_get_basename(filename_proxy); 289 tuple->file_name = g_path_get_basename(filename_proxy);
440 AVCodec *codec; 440 AVCodec *codec;
441 441
442 if(av_open_input_file(&ic, str_twenty_to_space(filename), NULL, 0, NULL) < 0) return; 442 if(av_open_input_file(&ic, str_twenty_to_space(filename), NULL, 0, NULL) < 0) return;
443 443
444 for(wma_idx = 0; wma_idx < ic->nb_streams; wma_idx++) { 444 for(wma_idx = 0; wma_idx < ic->nb_streams; wma_idx++) {
445 c = &ic->streams[wma_idx]->codec; 445 c = ic->streams[wma_idx]->codec;
446 if(c->codec_type == CODEC_TYPE_AUDIO) break; 446 if(c->codec_type == CODEC_TYPE_AUDIO) break;
447 } 447 }
448 448
449 av_find_stream_info(ic); 449 av_find_stream_info(ic);
450 450
451 codec = avcodec_find_decoder(c->codec_id); 451 codec = avcodec_find_decoder(c->codec_id);
452 452
453 if(!codec) return; 453 if(!codec) return;
454 454
455 if(avcodec_open(c, codec) < 0) return; 455 if(avcodec_open(c, codec) < 0) return;
456 456
457 wsong_title = get_song_title(ic, filename); 457 wsong_title = get_song_title(ic, filename);
458 wsong_time = get_song_time(ic); 458 wsong_time = get_song_time(ic);
459 459