[2/6] libopencore-amr: Convert commented out debug logging into av_dlog

Message ID 1302682613-20359-2-git-send-email-martin@martin.st
State Committed
Commit 9b9c6405fd293bb7820256f474406bdb771647a7
Headers show

Commit Message

Martin Storsjö April 13, 2011, 8:16 a.m.
Also add the avctx as logging context
---
 libavcodec/libopencore-amr.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

Comments

Diego Biurrun April 13, 2011, 9:42 a.m. | #1
On Wed, Apr 13, 2011 at 11:16:49AM +0300, Martin Storsjö wrote:
> Also add the avctx as logging context

Please end your sentences in periods, even in log messages.

patch OK

Diego
Martin Storsjö April 13, 2011, 10:01 a.m. | #2
On Wed, 13 Apr 2011, Diego Biurrun wrote:

> On Wed, Apr 13, 2011 at 11:16:49AM +0300, Martin Storsjö wrote:
> > Also add the avctx as logging context
> 
> Please end your sentences in periods, even in log messages.

Yeah, noticed after sending the mails, fixed locally already.

// Martin

Patch

diff --git a/libavcodec/libopencore-amr.c b/libavcodec/libopencore-amr.c
index e93fb3d..2945905 100644
--- a/libavcodec/libopencore-amr.c
+++ b/libavcodec/libopencore-amr.c
@@ -116,8 +116,8 @@  static int amr_nb_decode_frame(AVCodecContext *avctx, void *data,
     enum Mode dec_mode;
     int packet_size;
 
-    /* av_log(NULL, AV_LOG_DEBUG, "amr_decode_frame buf=%p buf_size=%d frameCount=%d!!\n",
-              buf, buf_size, s->frameCount); */
+    av_dlog(avctx, "amr_decode_frame buf=%p buf_size=%d frameCount=%d!!\n",
+            buf, buf_size, s->frameCount);
 
     dec_mode = (buf[0] >> 3) & 0x000F;
     packet_size = block_size[dec_mode] + 1;
@@ -129,8 +129,8 @@  static int amr_nb_decode_frame(AVCodecContext *avctx, void *data,
     }
 
     s->frameCount++;
-    /* av_log(NULL, AV_LOG_DEBUG, "packet_size=%d buf= 0x%X %X %X %X\n",
-              packet_size, buf[0], buf[1], buf[2], buf[3]); */
+    av_dlog(avctx, "packet_size=%d buf= 0x%X %X %X %X\n",
+              packet_size, buf[0], buf[1], buf[2], buf[3]);
     /* call decoder */
     Decoder_Interface_Decode(s->decState, buf, data, 0);
     *data_size = 160 * 2;
@@ -206,8 +206,8 @@  static int amr_nb_encode_frame(AVCodecContext *avctx,
 
     written = Encoder_Interface_Encode(s->enstate, s->enc_bitrate, data,
                                        frame, 0);
-    /* av_log(NULL, AV_LOG_DEBUG, "amr_nb_encode_frame encoded %u bytes, bitrate %u, first byte was %#02x\n",
-              written, s->enc_bitrate, frame[0] ); */
+    av_dlog(avctx, "amr_nb_encode_frame encoded %u bytes, bitrate %u, first byte was %#02x\n",
+            written, s->enc_bitrate, frame[0]);
 
     return written;
 }