[Ffmpeg-cvslog] r8294 - trunk/ffplay.c

takis subversion
Thu Mar 8 12:58:50 CET 2007


Author: takis
Date: Thu Mar  8 12:58:50 2007
New Revision: 8294

Modified:
   trunk/ffplay.c

Log:
As avcodec_decode_audio() is deprecated, replace it with avcodec_decode_audio2().
Patch by Limin Wang, lance lmwang % gmail com.


Modified: trunk/ffplay.c
==============================================================================
--- trunk/ffplay.c	(original)
+++ trunk/ffplay.c	Thu Mar  8 12:58:50 2007
@@ -1547,7 +1547,7 @@ static int synchronize_audio(VideoState 
 }
 
 /* decode one audio frame and returns its uncompressed size */
-static int audio_decode_frame(VideoState *is, uint8_t *audio_buf, double *pts_ptr)
+static int audio_decode_frame(VideoState *is, uint8_t *audio_buf, int buf_size, double *pts_ptr)
 {
     AVPacket *pkt = &is->audio_pkt;
     int n, len1, data_size;
@@ -1556,7 +1556,8 @@ static int audio_decode_frame(VideoState
     for(;;) {
         /* NOTE: the audio packet can contain several frames */
         while (is->audio_pkt_size > 0) {
-            len1 = avcodec_decode_audio(is->audio_st->codec,
+            data_size = buf_size;
+            len1 = avcodec_decode_audio2(is->audio_st->codec,
                                         (int16_t *)audio_buf, &data_size,
                                         is->audio_pkt_data, is->audio_pkt_size);
             if (len1 < 0) {
@@ -1632,7 +1633,7 @@ void sdl_audio_callback(void *opaque, Ui
 
     while (len > 0) {
         if (is->audio_buf_index >= is->audio_buf_size) {
-           audio_size = audio_decode_frame(is, is->audio_buf, &pts);
+           audio_size = audio_decode_frame(is, is->audio_buf, sizeof(is->audio_buf), &pts);
            if (audio_size < 0) {
                 /* if error, just output silence */
                is->audio_buf_size = 1024;




More information about the ffmpeg-cvslog mailing list