mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-27 15:33:00 +02:00
libeplayer3: add callback to abort avformat_open_input
This commit is contained in:
@@ -1469,6 +1469,13 @@ static void ffmpeg_buf_free()
|
|||||||
/* **************************** */
|
/* **************************** */
|
||||||
/* Container part for ffmpeg */
|
/* Container part for ffmpeg */
|
||||||
/* **************************** */
|
/* **************************** */
|
||||||
|
#ifdef MARTII
|
||||||
|
static int interrupt_cb(void *ctx)
|
||||||
|
{
|
||||||
|
PlaybackHandler_t *p = (PlaybackHandler_t *)ctx;
|
||||||
|
return p->abortRequested;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int container_ffmpeg_init(Context_t *context, char * filename)
|
int container_ffmpeg_init(Context_t *context, char * filename)
|
||||||
{
|
{
|
||||||
@@ -1504,6 +1511,12 @@ int container_ffmpeg_init(Context_t *context, char * filename)
|
|||||||
#ifdef MARTII //TDT
|
#ifdef MARTII //TDT
|
||||||
avformat_network_init();
|
avformat_network_init();
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef MARTII
|
||||||
|
context->playback->abortRequested = 0;
|
||||||
|
avContext = avformat_alloc_context();
|
||||||
|
avContext->interrupt_callback.callback = interrupt_cb;
|
||||||
|
avContext->interrupt_callback.opaque = context->playback;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if LIBAVCODEC_VERSION_MAJOR < 54
|
#if LIBAVCODEC_VERSION_MAJOR < 54
|
||||||
if ((err = av_open_input_file(&avContext, filename, NULL, 0, NULL)) != 0) {
|
if ((err = av_open_input_file(&avContext, filename, NULL, 0, NULL)) != 0) {
|
||||||
@@ -2098,6 +2111,7 @@ static int container_ffmpeg_stop(Context_t *context) {
|
|||||||
getMutex(FILENAME, __FUNCTION__,__LINE__);
|
getMutex(FILENAME, __FUNCTION__,__LINE__);
|
||||||
|
|
||||||
#ifdef MARTII
|
#ifdef MARTII
|
||||||
|
if (avContext)
|
||||||
avformat_close_input(&avContext);
|
avformat_close_input(&avContext);
|
||||||
#else
|
#else
|
||||||
if (avContext != NULL) {
|
if (avContext != NULL) {
|
||||||
|
@@ -35,6 +35,7 @@ typedef struct PlaybackHandler_s {
|
|||||||
unsigned char isDvbSubtitle;
|
unsigned char isDvbSubtitle;
|
||||||
unsigned char isTeletext;
|
unsigned char isTeletext;
|
||||||
unsigned char mayWriteToFramebuffer;
|
unsigned char mayWriteToFramebuffer;
|
||||||
|
unsigned char abortRequested;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int (* Command) (/*Context_t*/void *, PlaybackCmd_t, void *);
|
int (* Command) (/*Context_t*/void *, PlaybackCmd_t, void *);
|
||||||
|
@@ -1153,6 +1153,7 @@ PlaybackHandler_t PlaybackHandler = {
|
|||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
|
0,
|
||||||
#endif
|
#endif
|
||||||
&Command,
|
&Command,
|
||||||
"",
|
"",
|
||||||
|
Reference in New Issue
Block a user