diff options
author | Timothy Pearson <tpearson@raptorengineering.com> | 2019-11-22 10:08:11 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2019-11-27 01:02:16 -0600 |
commit | edefa0cdd8d0a83aeb6b545b1914a7a2a0bcbd30 (patch) | |
tree | fee376d7d37d7cd886caac745fe9f4f602d0644b /libavdevice/alsa.c | |
parent | 4c4d573f9986a92aea6fea9febf39665a69f51c1 (diff) | |
download | ffmpeg-streaming-edefa0cdd8d0a83aeb6b545b1914a7a2a0bcbd30.zip ffmpeg-streaming-edefa0cdd8d0a83aeb6b545b1914a7a2a0bcbd30.tar.gz |
Detect HR timestamp compatible version of ALSA before using HR timestamp functions
Diffstat (limited to 'libavdevice/alsa.c')
-rw-r--r-- | libavdevice/alsa.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavdevice/alsa.c b/libavdevice/alsa.c index 10ffe56..903ed94 100644 --- a/libavdevice/alsa.c +++ b/libavdevice/alsa.c @@ -272,6 +272,7 @@ av_cold int ff_alsa_open(AVFormatContext *ctx, snd_pcm_stream_t mode, } s->use_driver_timestamps = 0; +#if HAVE_ALSA_HR_TS if (snd_pcm_hw_params_supports_audio_ts_type(hw_params, 0)) { av_log(ctx, AV_LOG_INFO, "capture device supports compat timestamps\n"); s->use_driver_timestamps |= 1; @@ -296,6 +297,7 @@ av_cold int ff_alsa_open(AVFormatContext *ctx, snd_pcm_stream_t mode, av_log(ctx, AV_LOG_INFO, "capture device supports link synchronized timestamps\n"); s->use_driver_timestamps |= 32; } +#endif res = snd_pcm_sw_params_malloc(&sw_params); if (res < 0) { @@ -320,6 +322,7 @@ av_cold int ff_alsa_open(AVFormatContext *ctx, snd_pcm_stream_t mode, goto fail; } +#if HAVE_ALSA_HR_TS res = snd_pcm_sw_params_set_tstamp_type(h, sw_params, SND_PCM_TSTAMP_TYPE_MONOTONIC_RAW); if (res < 0) { av_log(ctx, AV_LOG_ERROR, "cannot set timestamp mode (%s)\n", @@ -327,6 +330,7 @@ av_cold int ff_alsa_open(AVFormatContext *ctx, snd_pcm_stream_t mode, snd_pcm_sw_params_free(sw_params); goto fail; } +#endif res = snd_pcm_sw_params(h, sw_params); if (res < 0) { |