comparison src/ffmpeg/ffmpeg.c @ 818:07107d476f32 trunk

[svn] - remove some more stuff - build libavcodec directly into the module
author nenolod
date Mon, 12 Mar 2007 13:49:56 -0700
parents 2eaaa3aa182b
children 485ba2ba5976
comparison
equal deleted inserted replaced
817:b3b7a4e480b2 818:07107d476f32
38 #include <audacious/titlestring.h> 38 #include <audacious/titlestring.h>
39 #include <audacious/vfs.h> 39 #include <audacious/vfs.h>
40 #include <audacious/strings.h> 40 #include <audacious/strings.h>
41 #include <audacious/i18n.h> 41 #include <audacious/i18n.h>
42 42
43 #include "config.h"
44
43 #include "avcodec.h" 45 #include "avcodec.h"
44 #include "avformat.h" 46 #include "avformat.h"
47 #include "avutil.h"
45 48
46 #define ABOUT_TXT "Adapted for use in audacious by Tony Vroon (chainsaw@gentoo.org) from\n \ 49 #define ABOUT_TXT "Adapted for use in audacious by Tony Vroon (chainsaw@gentoo.org) from\n \
47 the BEEP-WMA plugin which is Copyright (C) 2004,2005 Mokrushin I.V. aka McMCC (mcmcc@mail.ru)\n \ 50 the BEEP-WMA plugin which is Copyright (C) 2004,2005 Mokrushin I.V. aka McMCC (mcmcc@mail.ru)\n \
48 and the BMP-WMA plugin which is Copyright (C) 2004 Roman Bogorodskiy <bogorodskiy@inbox.ru>.\n \ 51 and the BMP-WMA plugin which is Copyright (C) 2004 Roman Bogorodskiy <bogorodskiy@inbox.ru>.\n \
49 This plugin based on source code " LIBAVCODEC_IDENT "\nby Fabrice Bellard from \ 52 This plugin based on source code " LIBAVCODEC_IDENT "\nby Fabrice Bellard from \
361 (*title_real) = xmms_get_titlestring(xmms_get_gentitle_format(), tuple); 364 (*title_real) = xmms_get_titlestring(xmms_get_gentitle_format(), tuple);
362 } 365 }
363 366
364 static void wma_playbuff(InputPlayback *playback, int out_size) 367 static void wma_playbuff(InputPlayback *playback, int out_size)
365 { 368 {
366 FifoBuffer f; 369 AVFifoBuffer f;
367 int sst_buff; 370 int sst_buff;
368 371
369 fifo_init(&f, out_size*2); 372 av_fifo_init(&f, out_size*2);
370 fifo_write(&f, wma_outbuf, out_size, &f.wptr); 373 av_fifo_write(&f, wma_outbuf, out_size);
371 while(!fifo_read(&f, wma_s_outbuf, wma_st_buff, &f.rptr) && wma_decode) 374 while(!av_fifo_read(&f, wma_s_outbuf, wma_st_buff) && wma_decode)
372 { 375 {
373 sst_buff = wma_st_buff; 376 sst_buff = wma_st_buff;
374 if(wma_pause) memset(wma_s_outbuf, 0, sst_buff); 377 if(wma_pause) memset(wma_s_outbuf, 0, sst_buff);
375 while(playback->output->buffer_free() < wma_st_buff) xmms_usleep(20000); 378 while(playback->output->buffer_free() < wma_st_buff) xmms_usleep(20000);
376 produce_audio(playback->output->written_time(), FMT_S16_NE, 379 produce_audio(playback->output->written_time(), FMT_S16_NE,
377 c->channels, sst_buff, (short *)wma_s_outbuf, NULL); 380 c->channels, sst_buff, (short *)wma_s_outbuf, NULL);
378 memset(wma_s_outbuf, 0, sst_buff); 381 memset(wma_s_outbuf, 0, sst_buff);
379 } 382 }
380 fifo_free(&f); 383 av_fifo_free(&f);
381 return; 384 return;
382 } 385 }
383 386
384 static void *wma_play_loop(void *arg) 387 static void *wma_play_loop(void *arg)
385 { 388 {
391 g_static_mutex_lock(&wma_mutex); 394 g_static_mutex_lock(&wma_mutex);
392 while(wma_decode){ 395 while(wma_decode){
393 396
394 if(wma_seekpos != -1) 397 if(wma_seekpos != -1)
395 { 398 {
396 av_seek_frame(ic, wma_idx, wma_seekpos * 1000000LL); 399 av_seek_frame(ic, wma_idx, wma_seekpos * 1000000LL, 0);
397 playback->output->flush(wma_seekpos * 1000); 400 playback->output->flush(wma_seekpos * 1000);
398 wma_seekpos = -1; 401 wma_seekpos = -1;
399 } 402 }
400 403
401 if(av_read_frame(ic, &pkt) < 0) break; 404 if(av_read_frame(ic, &pkt) < 0) break;