mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-26 23:12:44 +02:00
add cookie.patch thx DboxOldie
Origin commit data
------------------
Branch: master
Commit: 182baf4e57
Author: max_10 <max_10@gmx.de>
Date: 2016-04-03 (Sun, 03 Apr 2016)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -70,7 +70,7 @@ class Input
|
|||||||
|
|
||||||
bool ReadSubtitle(const char *filename, const char *format, int pid);
|
bool ReadSubtitle(const char *filename, const char *format, int pid);
|
||||||
bool ReadSubtitles(const char *filename);
|
bool ReadSubtitles(const char *filename);
|
||||||
bool Init(const char *filename);
|
bool Init(const char *filename, std::string headers = "");
|
||||||
bool UpdateTracks();
|
bool UpdateTracks();
|
||||||
bool Play();
|
bool Play();
|
||||||
bool Stop();
|
bool Stop();
|
||||||
|
@@ -103,7 +103,7 @@ class Player {
|
|||||||
bool FastBackward(int speed);
|
bool FastBackward(int speed);
|
||||||
bool FastForward(int speed);
|
bool FastForward(int speed);
|
||||||
|
|
||||||
bool Open(const char *Url, bool noprobe = false);
|
bool Open(const char *Url, bool noprobe = false, std::string headers = "");
|
||||||
bool Close();
|
bool Close();
|
||||||
bool Play();
|
bool Play();
|
||||||
bool Pause();
|
bool Pause();
|
||||||
|
@@ -372,12 +372,13 @@ bool Input::ReadSubtitles(const char *filename) {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Input::Init(const char *filename)
|
bool Input::Init(const char *filename, std::string headers)
|
||||||
{
|
{
|
||||||
bool find_info = true;
|
bool find_info = true;
|
||||||
abortPlayback = false;
|
abortPlayback = false;
|
||||||
av_lockmgr_register(lock_callback);
|
av_lockmgr_register(lock_callback);
|
||||||
#if ENABLE_LOGGING
|
#if ENABLE_LOGGING
|
||||||
|
av_log_set_level(AV_LOG_INFO);
|
||||||
av_log_set_callback(log_callback);
|
av_log_set_callback(log_callback);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -385,7 +386,16 @@ bool Input::Init(const char *filename)
|
|||||||
fprintf(stderr, "filename NULL\n");
|
fprintf(stderr, "filename NULL\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
fprintf(stderr, "%s %s %d: %s\n", FILENAME, __func__, __LINE__, filename);
|
|
||||||
|
if (!headers.empty())
|
||||||
|
{
|
||||||
|
fprintf(stderr, "%s %s %d: %s\n%s\n", FILENAME, __func__, __LINE__, filename, headers.c_str());
|
||||||
|
headers += "\r\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fprintf(stderr, "%s %s %d: %s\n", FILENAME, __func__, __LINE__, filename);
|
||||||
|
}
|
||||||
|
|
||||||
avcodec_register_all();
|
avcodec_register_all();
|
||||||
av_register_all();
|
av_register_all();
|
||||||
@@ -403,7 +413,14 @@ again:
|
|||||||
avfc->interrupt_callback.callback = interrupt_cb;
|
avfc->interrupt_callback.callback = interrupt_cb;
|
||||||
avfc->interrupt_callback.opaque = (void *) player;
|
avfc->interrupt_callback.opaque = (void *) player;
|
||||||
|
|
||||||
int err = avformat_open_input(&avfc, filename, NULL, 0);
|
AVDictionary *options = NULL;
|
||||||
|
av_dict_set(&options, "auth_type", "basic", 0);
|
||||||
|
if (!headers.empty())
|
||||||
|
{
|
||||||
|
av_dict_set(&options, "headers", headers.c_str(), 0);
|
||||||
|
}
|
||||||
|
int err = avformat_open_input(&avfc, filename, NULL, &options);
|
||||||
|
av_dict_free(&options);
|
||||||
if (averror(err, avformat_open_input)) {
|
if (averror(err, avformat_open_input)) {
|
||||||
avformat_free_context(avfc);
|
avformat_free_context(avfc);
|
||||||
return false;
|
return false;
|
||||||
|
@@ -65,7 +65,7 @@ void *Player::playthread(void *arg)
|
|||||||
pthread_exit(NULL);
|
pthread_exit(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Player::Open(const char *Url, bool _noprobe)
|
bool Player::Open(const char *Url, bool _noprobe, std::string headers)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "URL=%s\n", Url);
|
fprintf(stderr, "URL=%s\n", Url);
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ bool Player::Open(const char *Url, bool _noprobe)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return input.Init(url.c_str());
|
return input.Init(url.c_str(), headers);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Player::Close()
|
bool Player::Close()
|
||||||
|
@@ -54,10 +54,10 @@ void cPlayback::Close(void)
|
|||||||
|
|
||||||
bool cPlayback::Start(std::string filename, std::string headers)
|
bool cPlayback::Start(std::string filename, std::string headers)
|
||||||
{
|
{
|
||||||
Start((char*) filename.c_str(),0,0,0,0,0);
|
return Start((char*) filename.c_str(),0,0,0,0,0, headers);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cPlayback::Start(char *filename, int vpid, int vtype, int apid, int ac3, int)
|
bool cPlayback::Start(char *filename, int vpid, int vtype, int apid, int ac3, int, std::string headers)
|
||||||
{
|
{
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
bool isHTTP = false;
|
bool isHTTP = false;
|
||||||
@@ -82,7 +82,7 @@ bool cPlayback::Start(char *filename, int vpid, int vtype, int apid, int ac3, in
|
|||||||
} else
|
} else
|
||||||
isHTTP = true;
|
isHTTP = true;
|
||||||
|
|
||||||
if (player->Open(file.c_str(), no_probe)) {
|
if (player->Open(file.c_str(), no_probe, headers)) {
|
||||||
if (pm == PLAYMODE_TS) {
|
if (pm == PLAYMODE_TS) {
|
||||||
struct stat64 s;
|
struct stat64 s;
|
||||||
if (!stat64(file.c_str(), &s))
|
if (!stat64(file.c_str(), &s))
|
||||||
|
@@ -40,7 +40,7 @@ class cPlayback
|
|||||||
|
|
||||||
bool Open(playmode_t PlayMode);
|
bool Open(playmode_t PlayMode);
|
||||||
void Close(void);
|
void Close(void);
|
||||||
bool Start(char *filename, int vpid, int vtype, int apid, int ac3, int duration);
|
bool Start(char *filename, int vpid, int vtype, int apid, int ac3, int duration, std::string headers = "");
|
||||||
bool Start(std::string filename, std::string headers = "");
|
bool Start(std::string filename, std::string headers = "");
|
||||||
bool SetAPid(int pid, bool ac3 = false);
|
bool SetAPid(int pid, bool ac3 = false);
|
||||||
bool SetVPid(int pid);
|
bool SetVPid(int pid);
|
||||||
|
Reference in New Issue
Block a user