Commit 84c2d8af authored by Nicolas George's avatar Nicolas George

ALSA: implement get_output_timestamp.

parent b442ca69
...@@ -102,6 +102,17 @@ static int audio_write_packet(AVFormatContext *s1, AVPacket *pkt) ...@@ -102,6 +102,17 @@ static int audio_write_packet(AVFormatContext *s1, AVPacket *pkt)
return 0; return 0;
} }
static void
audio_get_output_timestamp(AVFormatContext *s1, int stream,
int64_t *dts, int64_t *wall)
{
AlsaData *s = s1->priv_data;
snd_pcm_sframes_t delay = 0;
*wall = av_gettime();
snd_pcm_delay(s->h, &delay);
*dts = s1->streams[0]->cur_dts - delay;
}
AVOutputFormat ff_alsa_muxer = { AVOutputFormat ff_alsa_muxer = {
"alsa", "alsa",
NULL_IF_CONFIG_SMALL("ALSA audio output"), NULL_IF_CONFIG_SMALL("ALSA audio output"),
...@@ -113,5 +124,6 @@ AVOutputFormat ff_alsa_muxer = { ...@@ -113,5 +124,6 @@ AVOutputFormat ff_alsa_muxer = {
audio_write_header, audio_write_header,
audio_write_packet, audio_write_packet,
ff_alsa_close, ff_alsa_close,
.get_output_timestamp = audio_get_output_timestamp,
.flags = AVFMT_NOFILE, .flags = AVFMT_NOFILE,
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment