Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc> --- libavradio/sdr.h | 5 +++++ libavradio/sdrdemux.c | 8 ++++++++ libavradio/sdrinradio.c | 5 +---- 3 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/libavradio/sdr.h b/libavradio/sdr.h index de0a479d26..7d7bfd6806 100644 --- a/libavradio/sdr.h +++ b/libavradio/sdr.h @@ -290,6 +290,11 @@ extern const AVOption ff_sdr_options[]; extern ModulationDescriptor ff_sdr_modulation_descs[]; +/** + * Detect hw bug specific workarounds. + */ +void ff_sdr_autodetect_workarounds(SDRContext *sdr); + /** * Set the center frequency of the hardware * this will check the argument and call set_frequency_callback() diff --git a/libavradio/sdrdemux.c b/libavradio/sdrdemux.c index bb33c69668..b0b63827eb 100644 --- a/libavradio/sdrdemux.c +++ b/libavradio/sdrdemux.c @@ -99,6 +99,14 @@ static void apply_deemphasis(SDRContext *sdr, AVComplexFloat *data, int len, int } } +void ff_sdr_autodetect_workarounds(SDRContext *sdr) +{ + if (sdr->rtlsdr_fixes < 0) + sdr->rtlsdr_fixes = !strcmp(sdr->driver_name, "rtlsdr"); + if (sdr->sdrplay_fixes < 0) + sdr->sdrplay_fixes = !strcmp(sdr->driver_name, "sdrplay"); +} + static void free_station(Station *station) { if (station->stream) diff --git a/libavradio/sdrinradio.c b/libavradio/sdrinradio.c index 5c14250f8c..2865b6a9a6 100644 --- a/libavradio/sdrinradio.c +++ b/libavradio/sdrinradio.c @@ -212,10 +212,7 @@ static int sdrindev_initial_hw_setup(AVFormatContext *s) if (!sdr->driver_name) return AVERROR(EINVAL); //No driver specified and none found - if (sdr->rtlsdr_fixes < 0) - sdr->rtlsdr_fixes = !strcmp(sdr->driver_name, "rtlsdr"); - if (sdr->sdrplay_fixes < 0) - sdr->sdrplay_fixes = !strcmp(sdr->driver_name, "sdrplay"); + ff_sdr_autodetect_workarounds(sdr); SoapySDRKwargs_set(&args, "driver", sdr->driver_name); sdr->soapy = soapy = SoapySDRDevice_make(&args); -- 2.31.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".