diff --git a/libavdevice/sdrindev.c b/libavdevice/sdrindev.c
index 8766fc2f34..d5a8228d21 100644
--- a/libavdevice/sdrindev.c
+++ b/libavdevice/sdrindev.c
@@ -468,10 +468,18 @@ static int sdr_get_device_list(AVFormatContext *ctx, AVDeviceInfoList *device_li
     return ret;
 }
 
+#define OFFSET(x) offsetof(SDRContext, x)
+#define DEC AV_OPT_FLAG_DECODING_PARAM
+
+static const AVOption sdr_options[] = {
+    { "sdr_adcc" ,"sdr automatic dc correction", OFFSET(sdr_adcc), AV_OPT_TYPE_BOOL , {.i64 = -1}, -1, 1, DEC},
+    SDR_COMMON_OPT
+};
+
 static const AVClass sdr_demuxer_class = {
     .class_name = "sdr",
     .item_name  = av_default_item_name,
-    .option     = avpriv_sdr_options,
+    .option     = sdr_options,
     .version    = LIBAVUTIL_VERSION_INT,
     .category   = AV_CLASS_CATEGORY_DEMUXER,
 };
diff --git a/libavformat/sdr.h b/libavformat/sdr.h
index 1bf8fbef79..ad238e7e5f 100644
--- a/libavformat/sdr.h
+++ b/libavformat/sdr.h
@@ -288,8 +288,6 @@ typedef struct BandDescriptor {
     int64_t freq_max;
 } BandDescriptor ;
 
-extern const AVOption avpriv_sdr_options[];
-
 extern ModulationDescriptor ff_sdr_modulation_descs[];
 
 /**
@@ -341,4 +339,60 @@ static inline float len2(AVComplexFloat c)
     return c.re*c.re + c.im*c.im;
 }
 
+#define SDR_COMMON_OPT \
+    { "video_size", "set frame size", OFFSET(width), AV_OPT_TYPE_IMAGE_SIZE, {.str = "0x0"}, 0, 0, DEC },\
+    { "framerate" , "set frame rate", OFFSET(fps), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX,DEC },\
+    { "block_size", "FFT block size", OFFSET(block_size), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, DEC},\
+    { "mode",       ""              , OFFSET(mode), AV_OPT_TYPE_INT,       {.i64 = SingleStationMode}, 0, ModeNB-1, DEC, "mode"},\
+        { "single_mode", "Demodulate 1 station",    0, AV_OPT_TYPE_CONST,  {.i64 = SingleStationMode}, 0, 0, DEC, "mode"},\
+        { "all_mode"   , "Demodulate all station",  0, AV_OPT_TYPE_CONST,  {.i64 =    AllStationMode}, 0, 0, DEC, "mode"},\
+\
+    { "station_freq", "current station/channel/stream frequency", OFFSET(station_freq), AV_OPT_TYPE_INT64, {.i64 = 88000000}, 0, INT64_MAX, DEC},\
+\
+    { "driver"  , "sdr driver name"  , OFFSET(driver_name), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC},\
+    { "rtlsdr_fixes" , "workaround rtlsdr issues", OFFSET(rtlsdr_fixes), AV_OPT_TYPE_INT , {.i64 = -1}, -1, 1, DEC},\
+    { "sdrplay_fixes" , "workaround sdrplay issues", OFFSET(sdrplay_fixes), AV_OPT_TYPE_INT , {.i64 = -1}, -1, 1, DEC},\
+    { "dc_fix" , "Apply DC correction", OFFSET(dc_fix), AV_OPT_TYPE_INT , {.i64 = -1}, -1, 1, DEC},\
+    { "sdr_sr"  , "sdr sample rate"  , OFFSET(sdr_sample_rate ), AV_OPT_TYPE_INT , {.i64 = 0}, 0, INT_MAX, DEC},\
+    { "sdr_freq", "sdr frequency"    , OFFSET(user_wanted_freq), AV_OPT_TYPE_INT64 , {.i64 = 9000000}, 0, INT64_MAX, DEC},\
+    { "gain" , "sdr overall gain",  OFFSET(sdr_gain),  AV_OPT_TYPE_INT , {.i64 =  GAIN_SDR_AGC}, -3, INT_MAX, DEC, "gain"},\
+        { "sdr_agc", "SDR AGC (if supported)", 0, AV_OPT_TYPE_CONST, {.i64 = GAIN_SDR_AGC}, 0, 0, DEC, "gain"},\
+        { "sw_agc", "Software AGC", 0, AV_OPT_TYPE_CONST, {.i64 = GAIN_SW_AGC}, 0, 0, DEC, "gain"},\
+        { "default_gain", "Never touch gain", 0, AV_OPT_TYPE_CONST, {.i64 = GAIN_DEFAULT}, 0, 0, DEC, "gain"},\
+\
+    { "agc_min_headroom",  "AGC min headroom",  OFFSET(agc_min_headroom),  AV_OPT_TYPE_FLOAT, {.dbl = 0.4}, 0, 1.0, DEC},\
+    { "agc_max_headroom",  "AGC max headroom",  OFFSET(agc_max_headroom),  AV_OPT_TYPE_FLOAT, {.dbl = 0.8}, 0, 1.0, DEC},\
+    { "agc_max_headroom_time",  "AGC max headroom time",  OFFSET(agc_max_headroom_time),  AV_OPT_TYPE_FLOAT, {.dbl = 0.1}, 0, INT_MAX, DEC},\
+    { "min_gain", "minimum gain", OFFSET(min_gain   ), AV_OPT_TYPE_FLOAT , {.dbl = 0}, 0, INT_MAX, DEC},\
+    { "max_gain", "maximum gain", OFFSET(max_gain   ), AV_OPT_TYPE_FLOAT , {.dbl = 0}, 0, INT_MAX, DEC},\
+\
+    { "min_freq", "minimum frequency", OFFSET(min_freq   ), AV_OPT_TYPE_INT64 , {.i64 = 0}, 0, INT64_MAX, DEC},\
+    { "max_freq", "maximum frequency", OFFSET(max_freq   ), AV_OPT_TYPE_INT64 , {.i64 = 0}, 0, INT64_MAX, DEC},\
+\
+    { "dumpurl", "url to dump soapy output to"  , OFFSET(dump_url), AV_OPT_TYPE_STRING , {.str = NULL}, 0, 0, DEC},\
+    { "kbd_alpha", "Kaiser Bessel window parameter"  , OFFSET(kbd_alpha), AV_OPT_TYPE_INT , {.i64 = 8}, 1, 16, DEC},\
+\
+    { "am_mode", "AM Demodulation Mode", OFFSET(am_mode  ), AV_OPT_TYPE_INT , {.i64 = AMMidSide}, 0, AMModeNB-1, DEC, "am_mode"},\
+        { "am_leftright", "AM Demodulation Left Right", 0, AV_OPT_TYPE_CONST, {.i64 = AMLeftRight}, 0, 0, DEC, "am_mode"},\
+        { "am_midside", "AM Demodulation Mid Side", 0, AV_OPT_TYPE_CONST,   {.i64 = AMMidSide}, 0, 0, DEC, "am_mode"},\
+        { "am_inphase", "AM Demodulation In Phase", 0, AV_OPT_TYPE_CONST,   {.i64 = AMInPhase}, 0, 0, DEC, "am_mode"},\
+        { "am_envelope","AM Demodulation EnvelopeDC", 0, AV_OPT_TYPE_CONST, {.i64 = AMEnvelope}, 0, 0, DEC, "am_mode"},\
+        { "am_cquam","CQUAM Stereo Demodulation", 0, AV_OPT_TYPE_CONST, {.i64 = AMCQUAM}, 0, 0, DEC, "am_mode"},\
+\
+    { "am_fft_ref", "Use FFT Based carrier for AM demodulation", OFFSET(am_fft_ref), AV_OPT_TYPE_INT , {.i64 = 0}, 0, 1, DEC},\
+\
+    { "fm_emphasis"     , "FM De-Emphasis", OFFSET(emphasis_mode), AV_OPT_TYPE_INT, {.i64 = EMPHASIS_75us}, 0, EMPHASISNB - 1, DEC, "fm_emphasis"},\
+        { "emphasis75us", "FM De-Emphasis 75us", 0, AV_OPT_TYPE_CONST, {.i64 = EMPHASIS_75us}, 0, 0, DEC, "fm_emphasis"},\
+        { "emphasis50us", "FM De-Emphasis 50us", 0, AV_OPT_TYPE_CONST, {.i64 = EMPHASIS_50us}, 0, 0, DEC, "fm_emphasis"},\
+        { "none"        , "No FM De-Emphasis"  , 0, AV_OPT_TYPE_CONST, {.i64 = EMPHASIS_NONE}, 0, 0, DEC, "fm_emphasis"},\
+\
+    { "am_threshold"     , "AM detection threshold", OFFSET(am_threshold), AV_OPT_TYPE_FLOAT, {.dbl = 20}, 0, FLT_MAX, DEC},\
+    { "fm_threshold"     , "FM detection threshold", OFFSET(fm_threshold), AV_OPT_TYPE_FLOAT, {.dbl = 50}, 0, FLT_MAX, DEC},\
+    { "am_multiple"      , "AM frequency mutiple",   OFFSET(am_multiple ), AV_OPT_TYPE_FLOAT, {.dbl =  0}, 0, FLT_MAX, DEC},\
+    { "fm_multiple"      , "FM frequency mutiple",   OFFSET(fm_multiple ), AV_OPT_TYPE_FLOAT, {.dbl =  0}, 0, FLT_MAX, DEC},\
+    { "am_multiple_tolerance", "AM frequency mutiple tolerance", OFFSET(am_multiple_tolerance), AV_OPT_TYPE_FLOAT, {.dbl =  60}, 0, FLT_MAX, DEC},\
+\
+    { NULL },
+
+
 #endif /* AVFORMAT_SDR_H */
diff --git a/libavformat/sdrdemux.c b/libavformat/sdrdemux.c
index 84dd90af80..227fa0f656 100644
--- a/libavformat/sdrdemux.c
+++ b/libavformat/sdrdemux.c
@@ -2321,68 +2321,14 @@ static int sdrfile_probe(const AVProbeData *p)
 #define OFFSET(x) offsetof(SDRContext, x)
 #define DEC AV_OPT_FLAG_DECODING_PARAM
 
-const AVOption avpriv_sdr_options[] = {
-    { "video_size", "set frame size", OFFSET(width), AV_OPT_TYPE_IMAGE_SIZE, {.str = "0x0"}, 0, 0, DEC },
-    { "framerate" , "set frame rate", OFFSET(fps), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX,DEC },
-    { "block_size", "FFT block size", OFFSET(block_size), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, DEC},
-    { "mode",       ""              , OFFSET(mode), AV_OPT_TYPE_INT,       {.i64 = SingleStationMode}, 0, ModeNB-1, DEC, "mode"},
-        { "single_mode", "Demodulate 1 station",    0, AV_OPT_TYPE_CONST,  {.i64 = SingleStationMode}, 0, 0, DEC, "mode"},
-        { "all_mode"   , "Demodulate all station",  0, AV_OPT_TYPE_CONST,  {.i64 =    AllStationMode}, 0, 0, DEC, "mode"},
-
-    { "station_freq", "current station/channel/stream frequency", OFFSET(station_freq), AV_OPT_TYPE_INT64, {.i64 = 88000000}, 0, INT64_MAX, DEC},
-
-    { "driver"  , "sdr driver name"  , OFFSET(driver_name), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC},
-    { "rtlsdr_fixes" , "workaround rtlsdr issues", OFFSET(rtlsdr_fixes), AV_OPT_TYPE_INT , {.i64 = -1}, -1, 1, DEC},
-    { "sdrplay_fixes" , "workaround sdrplay issues", OFFSET(sdrplay_fixes), AV_OPT_TYPE_INT , {.i64 = -1}, -1, 1, DEC},
-    { "dc_fix" , "Apply DC correction", OFFSET(dc_fix), AV_OPT_TYPE_INT , {.i64 = -1}, -1, 1, DEC},
-    { "sdr_sr"  , "sdr sample rate"  , OFFSET(sdr_sample_rate ), AV_OPT_TYPE_INT , {.i64 = 0}, 0, INT_MAX, DEC},
-    { "sdr_freq", "sdr frequency"    , OFFSET(user_wanted_freq), AV_OPT_TYPE_INT64 , {.i64 = 9000000}, 0, INT64_MAX, DEC},
-    { "gain" , "sdr overall gain",  OFFSET(sdr_gain),  AV_OPT_TYPE_INT , {.i64 =  GAIN_SDR_AGC}, -3, INT_MAX, DEC, "gain"},
-        { "sdr_agc", "SDR AGC (if supported)", 0, AV_OPT_TYPE_CONST, {.i64 = GAIN_SDR_AGC}, 0, 0, DEC, "gain"},
-        { "sw_agc", "Software AGC", 0, AV_OPT_TYPE_CONST, {.i64 = GAIN_SW_AGC}, 0, 0, DEC, "gain"},
-        { "default_gain", "Never touch gain", 0, AV_OPT_TYPE_CONST, {.i64 = GAIN_DEFAULT}, 0, 0, DEC, "gain"},
-
-    { "agc_min_headroom",  "AGC min headroom",  OFFSET(agc_min_headroom),  AV_OPT_TYPE_FLOAT, {.dbl = 0.4}, 0, 1.0, DEC},
-    { "agc_max_headroom",  "AGC max headroom",  OFFSET(agc_max_headroom),  AV_OPT_TYPE_FLOAT, {.dbl = 0.8}, 0, 1.0, DEC},
-    { "agc_max_headroom_time",  "AGC max headroom time",  OFFSET(agc_max_headroom_time),  AV_OPT_TYPE_FLOAT, {.dbl = 0.1}, 0, INT_MAX, DEC},
-    { "min_gain", "minimum gain", OFFSET(min_gain   ), AV_OPT_TYPE_FLOAT , {.dbl = 0}, 0, INT_MAX, DEC},
-    { "max_gain", "maximum gain", OFFSET(max_gain   ), AV_OPT_TYPE_FLOAT , {.dbl = 0}, 0, INT_MAX, DEC},
-
-    { "sdr_adcc" ,"sdr automatic dc correction", OFFSET(sdr_adcc), AV_OPT_TYPE_BOOL , {.i64 = -1}, -1, 1, DEC},
-    { "min_freq", "minimum frequency", OFFSET(min_freq   ), AV_OPT_TYPE_INT64 , {.i64 = 0}, 0, INT64_MAX, DEC},
-    { "max_freq", "maximum frequency", OFFSET(max_freq   ), AV_OPT_TYPE_INT64 , {.i64 = 0}, 0, INT64_MAX, DEC},
-
-    { "dumpurl", "url to dump soapy output to"  , OFFSET(dump_url), AV_OPT_TYPE_STRING , {.str = NULL}, 0, 0, DEC},
-    { "kbd_alpha", "Kaiser Bessel window parameter"  , OFFSET(kbd_alpha), AV_OPT_TYPE_INT , {.i64 = 8}, 1, 16, DEC},
-
-
-    { "am_mode", "AM Demodulation Mode", OFFSET(am_mode  ), AV_OPT_TYPE_INT , {.i64 = AMMidSide}, 0, AMModeNB-1, DEC, "am_mode"},
-        { "am_leftright", "AM Demodulation Left Right", 0, AV_OPT_TYPE_CONST, {.i64 = AMLeftRight}, 0, 0, DEC, "am_mode"},
-        { "am_midside", "AM Demodulation Mid Side", 0, AV_OPT_TYPE_CONST,   {.i64 = AMMidSide}, 0, 0, DEC, "am_mode"},
-        { "am_inphase", "AM Demodulation In Phase", 0, AV_OPT_TYPE_CONST,   {.i64 = AMInPhase}, 0, 0, DEC, "am_mode"},
-        { "am_envelope","AM Demodulation EnvelopeDC", 0, AV_OPT_TYPE_CONST, {.i64 = AMEnvelope}, 0, 0, DEC, "am_mode"},
-        { "am_cquam","CQUAM Stereo Demodulation", 0, AV_OPT_TYPE_CONST, {.i64 = AMCQUAM}, 0, 0, DEC, "am_mode"},
-
-    { "am_fft_ref", "Use FFT Based carrier for AM demodulation", OFFSET(am_fft_ref), AV_OPT_TYPE_INT , {.i64 = 0}, 0, 1, DEC},
-
-    { "fm_emphasis"     , "FM De-Emphasis", OFFSET(emphasis_mode), AV_OPT_TYPE_INT, {.i64 = EMPHASIS_75us}, 0, EMPHASISNB - 1, DEC, "fm_emphasis"},
-        { "emphasis75us", "FM De-Emphasis 75us", 0, AV_OPT_TYPE_CONST, {.i64 = EMPHASIS_75us}, 0, 0, DEC, "fm_emphasis"},
-        { "emphasis50us", "FM De-Emphasis 50us", 0, AV_OPT_TYPE_CONST, {.i64 = EMPHASIS_50us}, 0, 0, DEC, "fm_emphasis"},
-        { "none"        , "No FM De-Emphasis"  , 0, AV_OPT_TYPE_CONST, {.i64 = EMPHASIS_NONE}, 0, 0, DEC, "fm_emphasis"},
-
-    { "am_threshold"     , "AM detection threshold", OFFSET(am_threshold), AV_OPT_TYPE_FLOAT, {.dbl = 20}, 0, FLT_MAX, DEC},
-    { "fm_threshold"     , "FM detection threshold", OFFSET(fm_threshold), AV_OPT_TYPE_FLOAT, {.dbl = 50}, 0, FLT_MAX, DEC},
-    { "am_multiple"      , "AM frequency mutiple",   OFFSET(am_multiple ), AV_OPT_TYPE_FLOAT, {.dbl =  0}, 0, FLT_MAX, DEC},
-    { "fm_multiple"      , "FM frequency mutiple",   OFFSET(fm_multiple ), AV_OPT_TYPE_FLOAT, {.dbl =  0}, 0, FLT_MAX, DEC},
-    { "am_multiple_tolerance", "AM frequency mutiple tolerance", OFFSET(am_multiple_tolerance), AV_OPT_TYPE_FLOAT, {.dbl =  60}, 0, FLT_MAX, DEC},
-
-    { NULL },
+static const AVOption sdrfile_options[] = {
+    SDR_COMMON_OPT
 };
 
 static const AVClass sdrfile_demuxer_class = {
     .class_name = "sdrfile",
     .item_name  = av_default_item_name,
-    .option     = avpriv_sdr_options,
+    .option     = sdrfile_options,
     .version    = LIBAVUTIL_VERSION_INT,
     .category   = AV_CLASS_CATEGORY_DEMUXER,
 };
