diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-10-26 10:30:59 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-10-26 10:31:04 +0200 |
commit | 0feecb62abab9ec6afa98121a07941792204fad9 (patch) | |
tree | 9eea12d5e3f46b355bb98f596fac14dbc3f8aade | |
parent | 7e19c549bafa9e4025d0adc59593f6541ccbe304 (diff) | |
parent | c4281705492a1c862a0faff6c3132fbdeb60d35a (diff) | |
download | ffmpeg-0feecb62abab9ec6afa98121a07941792204fad9.tar.gz |
Merge remote-tracking branch 'lukaszmluki/master'
* lukaszmluki/master:
lavd/pulse_audio_enc: avoid vars in for()
lavd/pulse_audio_enc: add another default to stream name
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavdevice/pulse_audio_enc.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libavdevice/pulse_audio_enc.c b/libavdevice/pulse_audio_enc.c index 53436969f0..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; @@ -59,8 +60,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; |