mirror of https://git.ffmpeg.org/ffmpeg.git
lavd/pulse: add ff_ prefix and fix param type
Add ff_ prefix for internal API function. Change type of param from int into enum AVCodecID as it is more specific. Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
This commit is contained in:
parent
398844f093
commit
babf20a215
|
@ -19,11 +19,10 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "libavutil/attributes.h"
|
|
||||||
#include "libavcodec/avcodec.h"
|
|
||||||
#include "pulse_audio_common.h"
|
#include "pulse_audio_common.h"
|
||||||
|
#include "libavutil/attributes.h"
|
||||||
|
|
||||||
pa_sample_format_t av_cold codec_id_to_pulse_format(int codec_id)
|
pa_sample_format_t av_cold ff_codec_id_to_pulse_format(enum AVCodecID codec_id)
|
||||||
{
|
{
|
||||||
switch (codec_id) {
|
switch (codec_id) {
|
||||||
case AV_CODEC_ID_PCM_U8: return PA_SAMPLE_U8;
|
case AV_CODEC_ID_PCM_U8: return PA_SAMPLE_U8;
|
||||||
|
|
|
@ -23,7 +23,8 @@
|
||||||
#define AVDEVICE_PULSE_AUDIO_COMMON_H
|
#define AVDEVICE_PULSE_AUDIO_COMMON_H
|
||||||
|
|
||||||
#include <pulse/simple.h>
|
#include <pulse/simple.h>
|
||||||
|
#include "libavcodec/avcodec.h"
|
||||||
|
|
||||||
pa_sample_format_t codec_id_to_pulse_format(int codec_id);
|
pa_sample_format_t ff_codec_id_to_pulse_format(enum AVCodecID codec_id);
|
||||||
|
|
||||||
#endif /* AVDEVICE_PULSE_AUDIO_COMMON_H */
|
#endif /* AVDEVICE_PULSE_AUDIO_COMMON_H */
|
||||||
|
|
|
@ -57,7 +57,7 @@ static av_cold int pulse_read_header(AVFormatContext *s)
|
||||||
int ret;
|
int ret;
|
||||||
enum AVCodecID codec_id =
|
enum AVCodecID codec_id =
|
||||||
s->audio_codec_id == AV_CODEC_ID_NONE ? DEFAULT_CODEC_ID : s->audio_codec_id;
|
s->audio_codec_id == AV_CODEC_ID_NONE ? DEFAULT_CODEC_ID : s->audio_codec_id;
|
||||||
const pa_sample_spec ss = { codec_id_to_pulse_format(codec_id),
|
const pa_sample_spec ss = { ff_codec_id_to_pulse_format(codec_id),
|
||||||
pd->sample_rate,
|
pd->sample_rate,
|
||||||
pd->channels };
|
pd->channels };
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ static av_cold int pulse_write_header(AVFormatContext *h)
|
||||||
stream_name = "Playback";
|
stream_name = "Playback";
|
||||||
}
|
}
|
||||||
|
|
||||||
ss.format = codec_id_to_pulse_format(st->codec->codec_id);
|
ss.format = ff_codec_id_to_pulse_format(st->codec->codec_id);
|
||||||
ss.rate = st->codec->sample_rate;
|
ss.rate = st->codec->sample_rate;
|
||||||
ss.channels = st->codec->channels;
|
ss.channels = st->codec->channels;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue