changeset 9834:ce317c75222d libavcodec

give s->resample_context to avoid segfault, avclass was moved
author bcoudurier
date Thu, 11 Jun 2009 08:14:50 +0000
parents 2023caf1ccd5
children ff9ae6249d18
files resample.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/resample.c	Thu Jun 11 06:28:06 2009 +0000
+++ b/resample.c	Thu Jun 11 08:14:50 2009 +0000
@@ -257,7 +257,7 @@
             s->buffer_size[0] = input_size;
             s->buffer[0] = av_malloc(s->buffer_size[0]);
             if (!s->buffer[0]) {
-                av_log(s, AV_LOG_ERROR, "Could not allocate buffer\n");
+                av_log(s->resample_context, AV_LOG_ERROR, "Could not allocate buffer\n");
                 return 0;
             }
         }
@@ -266,7 +266,7 @@
 
         if (av_audio_convert(s->convert_ctx[0], obuf, ostride,
                              ibuf, istride, nb_samples*s->input_channels) < 0) {
-            av_log(s, AV_LOG_ERROR, "Audio sample format conversion failed\n");
+            av_log(s->resample_context, AV_LOG_ERROR, "Audio sample format conversion failed\n");
             return 0;
         }
 
@@ -283,7 +283,7 @@
             s->buffer_size[1] = lenout;
             s->buffer[1] = av_malloc(s->buffer_size[1]);
             if (!s->buffer[1]) {
-                av_log(s, AV_LOG_ERROR, "Could not allocate buffer\n");
+                av_log(s->resample_context, AV_LOG_ERROR, "Could not allocate buffer\n");
                 return 0;
             }
         }
@@ -348,7 +348,7 @@
 
         if (av_audio_convert(s->convert_ctx[1], obuf, ostride,
                              ibuf, istride, nb_samples1*s->output_channels) < 0) {
-            av_log(s, AV_LOG_ERROR, "Audio sample format convertion failed\n");
+            av_log(s->resample_context, AV_LOG_ERROR, "Audio sample format convertion failed\n");
             return 0;
         }
     }