|
|
|
@ -1060,7 +1060,7 @@ HRESULT decklink_input_callback::VideoInputFrameArrived( |
|
|
|
|
BMDTimeValue audio_pts; |
|
|
|
|
|
|
|
|
|
//hack among hacks
|
|
|
|
|
pkt.size = audioFrame->GetSampleFrameCount() * ctx->audio_st->codecpar->channels * (ctx->audio_depth / 8); |
|
|
|
|
pkt.size = audioFrame->GetSampleFrameCount() * ctx->audio_st->codecpar->ch_layout.nb_channels * (ctx->audio_depth / 8); |
|
|
|
|
audioFrame->GetBytes(&audioFrameBytes); |
|
|
|
|
audioFrame->GetPacketTime(&audio_pts, ctx->audio_st->time_base.den); |
|
|
|
|
pkt.pts = get_pkt_pts(videoFrame, audioFrame, wallclock, abs_wallclock, ctx->audio_pts_source, ctx->audio_st->time_base, &initial_audio_pts, cctx->copyts); |
|
|
|
@ -1296,7 +1296,7 @@ av_cold int ff_decklink_read_header(AVFormatContext *avctx) |
|
|
|
|
st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; |
|
|
|
|
st->codecpar->codec_id = cctx->audio_depth == 32 ? AV_CODEC_ID_PCM_S32LE : AV_CODEC_ID_PCM_S16LE; |
|
|
|
|
st->codecpar->sample_rate = bmdAudioSampleRate48kHz; |
|
|
|
|
st->codecpar->channels = cctx->audio_channels; |
|
|
|
|
st->codecpar->ch_layout.nb_channels = cctx->audio_channels; |
|
|
|
|
avpriv_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */ |
|
|
|
|
ctx->audio_st=st; |
|
|
|
|
|
|
|
|
@ -1392,8 +1392,8 @@ av_cold int ff_decklink_read_header(AVFormatContext *avctx) |
|
|
|
|
ctx->teletext_st = st; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
av_log(avctx, AV_LOG_VERBOSE, "Using %d input audio channels\n", ctx->audio_st->codecpar->channels); |
|
|
|
|
result = ctx->dli->EnableAudioInput(bmdAudioSampleRate48kHz, cctx->audio_depth == 32 ? bmdAudioSampleType32bitInteger : bmdAudioSampleType16bitInteger, ctx->audio_st->codecpar->channels); |
|
|
|
|
av_log(avctx, AV_LOG_VERBOSE, "Using %d input audio channels\n", ctx->audio_st->codecpar->ch_layout.nb_channels); |
|
|
|
|
result = ctx->dli->EnableAudioInput(bmdAudioSampleRate48kHz, cctx->audio_depth == 32 ? bmdAudioSampleType32bitInteger : bmdAudioSampleType16bitInteger, ctx->audio_st->codecpar->ch_layout.nb_channels); |
|
|
|
|
|
|
|
|
|
if (result != S_OK) { |
|
|
|
|
av_log(avctx, AV_LOG_ERROR, "Cannot enable audio input\n"); |
|
|
|
|