From c6c70c2bf76cbec073c97f92dea2fe1fbcf6665c Mon Sep 17 00:00:00 2001 From: Lukasz Marek Date: Thu, 24 Oct 2013 18:10:06 +0200 Subject: [PATCH 1/2] lavd/pulse_audio_enc: add another default to stream name Signed-off-by: Lukasz Marek --- libavdevice/pulse_audio_enc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libavdevice/pulse_audio_enc.c b/libavdevice/pulse_audio_enc.c index 53436969f0..86ef6488c0 100644 --- a/libavdevice/pulse_audio_enc.c +++ b/libavdevice/pulse_audio_enc.c @@ -59,8 +59,12 @@ static av_cold int pulse_write_header(AVFormatContext *h) return AVERROR(EINVAL); } - if (!stream_name) - stream_name = h->filename; + if (!stream_name) { + if (h->filename) + stream_name = h->filename; + else + stream_name = "Playback"; + } ss.format = codec_id_to_pulse_format(st->codec->codec_id); ss.rate = st->codec->sample_rate; From c4281705492a1c862a0faff6c3132fbdeb60d35a Mon Sep 17 00:00:00 2001 From: Lukasz Marek Date: Sat, 26 Oct 2013 01:42:11 +0200 Subject: [PATCH 2/2] lavd/pulse_audio_enc: avoid vars in for() Signed-off-by: Lukasz Marek --- libavdevice/pulse_audio_enc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavdevice/pulse_audio_enc.c b/libavdevice/pulse_audio_enc.c index 86ef6488c0..b8b0700597 100644 --- a/libavdevice/pulse_audio_enc.c +++ b/libavdevice/pulse_audio_enc.c @@ -42,11 +42,12 @@ static av_cold int pulse_write_header(AVFormatContext *h) PulseData *s = h->priv_data; AVStream *st = NULL; int ret; + unsigned int i; pa_sample_spec ss; pa_buffer_attr attr = { -1, -1, -1, -1, -1 }; const char *stream_name = s->stream_name; - for (unsigned i = 0; i < h->nb_streams; i++) { + for (i = 0; i < h->nb_streams; i++) { if (h->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO) { st = h->streams[i]; s->stream_index = i;