History

avcodec/opus_silk: Use void* instead of AVCodecContext* as logctx

Andreas Rheinhardt committed 3 years ago

Commit 40aa4511 parent 12e9c682 files · +6 −7Browse files

Unified · Split

2 files
  1. libavcodec/opus_silk.c +5 −5
  2. libavcodec/opus_silk.h +1 −2
libavcodec/opus_silk.c+5−5
@@ -48,7 +48,7 @@ typedef struct SilkFrame { · 47 unmodified lines
4848 } SilkFrame;
4949
5050 struct SilkContext {
51− AVCodecContext *avctx;
51+ void *logctx;
5252 int output_channels;
5353
5454 int midonly;
@@ -799,7 +799,7 @@ int ff_silk_decode_superframe(SilkContext *s, OpusRangeCoder *rc, · 744 unmodified lines
799799
800800 if (bandwidth > OPUS_BANDWIDTH_WIDEBAND ||
801801 coded_channels > 2 || duration_ms > 60) {
802− av_log(s->avctx, AV_LOG_ERROR, "Invalid parameters passed "
802+ av_log(s->logctx, AV_LOG_ERROR, "Invalid parameters passed "
803803 "to the SILK decoder.\n");
804804 return AVERROR(EINVAL);
805805 }
@@ -879,12 +879,12 @@ void ff_silk_flush(SilkContext *s) · 73 unmodified lines
879879 memset(s->prev_stereo_weights, 0, sizeof(s->prev_stereo_weights));
880880 }
881881
882−int ff_silk_init(AVCodecContext *avctx, SilkContext **ps, int output_channels)
882+int ff_silk_init(void *logctx, SilkContext **ps, int output_channels)
883883 {
884884 SilkContext *s;
885885
886886 if (output_channels != 1 && output_channels != 2) {
887− av_log(avctx, AV_LOG_ERROR, "Invalid number of output channels: %d\n",
887+ av_log(logctx, AV_LOG_ERROR, "Invalid number of output channels: %d\n",
888888 output_channels);
889889 return AVERROR(EINVAL);
890890 }
@@ -893,7 +893,7 @@ int ff_silk_init(AVCodecContext *avctx, SilkContext **ps, int output_channels) · 2 unmodified lines
893893 if (!s)
894894 return AVERROR(ENOMEM);
895895
896− s->avctx = avctx;
896+ s->logctx = logctx;
897897 s->output_channels = output_channels;
898898
899899 ff_silk_flush(s);
libavcodec/opus_silk.h+1−2
@@ -23,7 +23,6 @@ · 22 unmodified lines
2323 #ifndef AVCODEC_OPUS_SILK_H
2424 #define AVCODEC_OPUS_SILK_H
2525
26−#include "avcodec.h"
2726 #include "opus.h"
2827 #include "opus_rc.h"
2928
@@ -32,7 +31,7 @@ · 2 unmodified lines
3231
3332 typedef struct SilkContext SilkContext;
3433
35−int ff_silk_init(AVCodecContext *avctx, SilkContext **ps, int output_channels);
34+int ff_silk_init(void *logctx, SilkContext **ps, int output_channels);
3635 void ff_silk_free(SilkContext **ps);
3736 void ff_silk_flush(SilkContext *s);
3837

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t