Commit 7af3418c authored by Stefan Westerfeld's avatar Stefan Westerfeld

Fix building HLS support with newer ffmpeg versions.

Signed-off-by: Stefan Westerfeld's avatarStefan Westerfeld <stefan@space.twc.de>
parent abe39588
......@@ -76,7 +76,7 @@ HLSOutputStream::~HLSOutputStream()
/* Add an output stream. */
Error
HLSOutputStream::add_stream (AVCodec **codec, enum AVCodecID codec_id)
HLSOutputStream::add_stream (const AVCodec **codec, enum AVCodecID codec_id)
{
/* find the encoder */
*codec = avcodec_find_encoder (codec_id);
......@@ -170,7 +170,7 @@ HLSOutputStream::alloc_audio_frame (AVSampleFormat sample_fmt, uint64_t channel_
Error
HLSOutputStream::open_audio (AVCodec *codec, AVDictionary *opt_arg)
HLSOutputStream::open_audio (const AVCodec *codec, AVDictionary *opt_arg)
{
int nb_samples;
int ret;
......@@ -385,7 +385,7 @@ HLSOutputStream::open (const string& out_filename, size_t cut_aac_frames, size_t
return Error (av_err2str (ret));
AVDictionary *opt = nullptr;
AVCodec *audio_codec;
const AVCodec *audio_codec;
Error err = add_stream (&audio_codec, AV_CODEC_ID_AAC);
if (err)
return err;
......
......@@ -29,6 +29,7 @@ extern "C" {
#include <libswresample/swresample.h>
#include <libavutil/avassert.h>
#include <libavutil/timestamp.h>
#include <libavcodec/avcodec.h>
}
class HLSOutputStream : public AudioOutputStream {
......@@ -64,8 +65,8 @@ class HLSOutputStream : public AudioOutputStream {
};
State m_state = State::NEW;
Error add_stream (AVCodec **codec, enum AVCodecID codec_id);
Error open_audio (AVCodec *codec, AVDictionary *opt_arg);
Error add_stream (const AVCodec **codec, enum AVCodecID codec_id);
Error open_audio (const AVCodec *codec, AVDictionary *opt_arg);
AVFrame *get_audio_frame();
enum class EncResult {
OK,
......
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