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
48} SilkFrame;48} SilkFrame;
49 49
50struct SilkContext {50struct SilkContext {
51 AVCodecContext *avctx;51 void *logctx;
52 int output_channels;52 int output_channels;
53 53
54 int midonly;54 int midonly;
@@ -799,7 +799,7 @@ int ff_silk_decode_superframe(SilkContext *s, OpusRangeCoder *rc, · 744 unmodified lines
799 799
800 if (bandwidth > OPUS_BANDWIDTH_WIDEBAND ||800 if (bandwidth > OPUS_BANDWIDTH_WIDEBAND ||
801 coded_channels > 2 || duration_ms > 60) {801 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 "
803 "to the SILK decoder.\n");803 "to the SILK decoder.\n");
804 return AVERROR(EINVAL);804 return AVERROR(EINVAL);
805 }805 }
@@ -879,12 +879,12 @@ void ff_silk_flush(SilkContext *s) · 73 unmodified lines
879 memset(s->prev_stereo_weights, 0, sizeof(s->prev_stereo_weights));879 memset(s->prev_stereo_weights, 0, sizeof(s->prev_stereo_weights));
880}880}
881 881
882int ff_silk_init(AVCodecContext *avctx, SilkContext **ps, int output_channels)882int ff_silk_init(void *logctx, SilkContext **ps, int output_channels)
883{883{
884 SilkContext *s;884 SilkContext *s;
885 885
886 if (output_channels != 1 && output_channels != 2) {886 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",
888 output_channels);888 output_channels);
889 return AVERROR(EINVAL);889 return AVERROR(EINVAL);
890 }890 }
@@ -893,7 +893,7 @@ int ff_silk_init(AVCodecContext *avctx, SilkContext **ps, int output_channels) · 2 unmodified lines
893 if (!s)893 if (!s)
894 return AVERROR(ENOMEM);894 return AVERROR(ENOMEM);
895 895
896 s->avctx = avctx;896 s->logctx = logctx;
897 s->output_channels = output_channels;897 s->output_channels = output_channels;
898 898
899 ff_silk_flush(s);899 ff_silk_flush(s);
libavcodec/opus_silk.h+1−2
@@ -23,7 +23,6 @@ · 22 unmodified lines
23#ifndef AVCODEC_OPUS_SILK_H23#ifndef AVCODEC_OPUS_SILK_H
24#define AVCODEC_OPUS_SILK_H24#define AVCODEC_OPUS_SILK_H
25 25
26#include "avcodec.h"
27#include "opus.h"26#include "opus.h"
28#include "opus_rc.h"27#include "opus_rc.h"
29 28
@@ -32,7 +31,7 @@ · 2 unmodified lines
32 31
33typedef struct SilkContext SilkContext;32typedef struct SilkContext SilkContext;
34 33
35int ff_silk_init(AVCodecContext *avctx, SilkContext **ps, int output_channels);34int ff_silk_init(void *logctx, SilkContext **ps, int output_channels);
36void ff_silk_free(SilkContext **ps);35void ff_silk_free(SilkContext **ps);
37void ff_silk_flush(SilkContext *s);36void ff_silk_flush(SilkContext *s);
38 37

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