These consts are only used in the switch(planar) case located in avisynth_create_stream_video and nowhere else in the demuxer, so move them into that function directly.
Unified · Split
| @@ -118,17 +118,6 @@ typedef struct AviSynthContext { · 117 unmodified lines | ||
| 118 | 118 | struct AviSynthLibrary avs_library; |
| 119 | 119 | } AviSynthContext; |
| 120 | 120 | |
| 121 | −static const int avs_planes_packed[1] = { 0 }; | |
| 122 | −static const int avs_planes_grey[1] = { AVS_PLANAR_Y }; | |
| 123 | −static const int avs_planes_yuv[3] = { AVS_PLANAR_Y, AVS_PLANAR_U, | |
| 124 | − AVS_PLANAR_V }; | |
| 125 | −static const int avs_planes_rgb[3] = { AVS_PLANAR_G, AVS_PLANAR_B, | |
| 126 | − AVS_PLANAR_R }; | |
| 127 | −static const int avs_planes_yuva[4] = { AVS_PLANAR_Y, AVS_PLANAR_U, | |
| 128 | − AVS_PLANAR_V, AVS_PLANAR_A }; | |
| 129 | −static const int avs_planes_rgba[4] = { AVS_PLANAR_G, AVS_PLANAR_B, | |
| 130 | − AVS_PLANAR_R, AVS_PLANAR_A }; | |
| 131 | − | |
| 132 | 121 | static av_cold int avisynth_load_library(AviSynthContext *avs) |
| 133 | 122 | { |
| 134 | 123 | avs->avs_library.library = dlopen(AVISYNTH_LIB, RTLD_NOW | RTLD_LOCAL); |
| @@ -225,6 +214,17 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st) · 90 unmodified lines | ||
| 225 | 214 | int sar_num = 1; |
| 226 | 215 | int sar_den = 1; |
| 227 | 216 | |
| 217 | + static const int avs_planes_packed[1] = { 0 }; | |
| 218 | + static const int avs_planes_grey[1] = { AVS_PLANAR_Y }; | |
| 219 | + static const int avs_planes_yuv[3] = { AVS_PLANAR_Y, AVS_PLANAR_U, | |
| 220 | + AVS_PLANAR_V }; | |
| 221 | + static const int avs_planes_rgb[3] = { AVS_PLANAR_G, AVS_PLANAR_B, | |
| 222 | + AVS_PLANAR_R }; | |
| 223 | + static const int avs_planes_yuva[4] = { AVS_PLANAR_Y, AVS_PLANAR_U, | |
| 224 | + AVS_PLANAR_V, AVS_PLANAR_A }; | |
| 225 | + static const int avs_planes_rgba[4] = { AVS_PLANAR_G, AVS_PLANAR_B, | |
| 226 | + AVS_PLANAR_R, AVS_PLANAR_A }; | |
| 227 | + | |
| 228 | 228 | st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; |
| 229 | 229 | st->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO; |
| 230 | 230 | st->codecpar->width = avs->vi->width; |