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