MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / audio_read_header

Function audio_read_header

libavdevice/jack.c:237–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235}
236
237static int audio_read_header(AVFormatContext *context)
238{
239 JackData *self = context->priv_data;
240 AVStream *stream;
241 int test;
242
243 if ((test = start_jack(context)))
244 return test;
245
246 stream = avformat_new_stream(context, NULL);
247 if (!stream) {
248 stop_jack(self);
249 return AVERROR(ENOMEM);
250 }
251
252 stream->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
253#if HAVE_BIGENDIAN
254 stream->codecpar->codec_id = AV_CODEC_ID_PCM_F32BE;
255#else
256 stream->codecpar->codec_id = AV_CODEC_ID_PCM_F32LE;
257#endif
258 stream->codecpar->sample_rate = self->sample_rate;
259 stream->codecpar->ch_layout.nb_channels = self->nports;
260
261 avpriv_set_pts_info(stream, 64, 1, 1000000); /* 64 bits pts in us */
262 return 0;
263}
264
265static int audio_read_packet(AVFormatContext *context, AVPacket *pkt)
266{

Callers

nothing calls this directly

Calls 4

start_jackFunction · 0.85
avformat_new_streamFunction · 0.85
stop_jackFunction · 0.85
avpriv_set_pts_infoFunction · 0.85

Tested by

no test coverage detected