[Ffmpeg-devel] [PATCH] use avcodec_decode_audio2 in ffplay.c

Limin Wang lance.lmwang
Wed Mar 7 11:16:38 CET 2007


Hi,

As 'avcodec_decode_audio' is deprecated, the patch try to replace it with
avcodec_decode_audio2.


Thanks,
Limin
-------------- next part --------------
Index: ffplay.c
===================================================================
--- ffplay.c	(revision 8286)
+++ ffplay.c	(working copy)
@@ -1556,7 +1556,8 @@
     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 = (AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2;
+            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) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 481 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070307/bd3d6b5d/attachment.pgp>



More information about the ffmpeg-devel mailing list