mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 23:13:16 +02:00
libarmbox/playback_libeplayer3.cpp enable use headers with ffmpeg_av_dict_set
This commit is contained in:
@@ -9,11 +9,14 @@
|
|||||||
#include <audio_lib.h>
|
#include <audio_lib.h>
|
||||||
#include <video_lib.h>
|
#include <video_lib.h>
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
extern OutputHandler_t OutputHandler;
|
extern OutputHandler_t OutputHandler;
|
||||||
extern PlaybackHandler_t PlaybackHandler;
|
extern PlaybackHandler_t PlaybackHandler;
|
||||||
extern ContainerHandler_t ContainerHandler;
|
extern ContainerHandler_t ContainerHandler;
|
||||||
extern ManagerHandler_t ManagerHandler;
|
extern ManagerHandler_t ManagerHandler;
|
||||||
|
extern int32_t ffmpeg_av_dict_set( const char *key, const char *value, int32_t flags);
|
||||||
|
}
|
||||||
|
|
||||||
#include "playback_libeplayer3.h"
|
#include "playback_libeplayer3.h"
|
||||||
#include "hal_debug.h"
|
#include "hal_debug.h"
|
||||||
@@ -101,7 +104,7 @@ bool cPlayback::Start(std::string filename, std::string headers, std::string fil
|
|||||||
return Start((char *) filename.c_str(), 0, 0, 0, 0, 0, headers,filename2);
|
return Start((char *) filename.c_str(), 0, 0, 0, 0, 0, headers,filename2);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cPlayback::Start(char *filename, int vpid, int vtype, int apid, int ac3, int, std::string headers __attribute__((unused)),std::string filename2)
|
bool cPlayback::Start(char *filename, int vpid, int vtype, int apid, int ac3, int, std::string headers, std::string filename2)
|
||||||
{
|
{
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
bool isHTTP = false;
|
bool isHTTP = false;
|
||||||
@@ -137,6 +140,22 @@ bool cPlayback::Start(char *filename, int vpid, int vtype, int apid, int ac3, in
|
|||||||
else
|
else
|
||||||
isHTTP = true;
|
isHTTP = true;
|
||||||
|
|
||||||
|
if(isHTTP && headers.empty())
|
||||||
|
{
|
||||||
|
size_t pos = file.find('#');
|
||||||
|
if (pos != std::string::npos)
|
||||||
|
{
|
||||||
|
headers = file.substr(pos + 1);
|
||||||
|
pos = headers.find("User-Agent=");
|
||||||
|
if (pos != std::string::npos)
|
||||||
|
headers.replace(pos+10, 1, ": ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!headers.empty()){
|
||||||
|
const char hkey[] = "headers";
|
||||||
|
ffmpeg_av_dict_set(hkey, headers.c_str(), 0);
|
||||||
|
}
|
||||||
|
|
||||||
std::string szSecondFile;
|
std::string szSecondFile;
|
||||||
char *file2 = NULL;
|
char *file2 = NULL;
|
||||||
if(!filename2.empty()){
|
if(!filename2.empty()){
|
||||||
|
Reference in New Issue
Block a user