mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-27 15:32:43 +02:00
libeplayer3: add callback to abort avformat_open_input
Origin commit data
------------------
Branch: master
Commit: d02696233c
Author: martii <m4rtii@gmx.de>
Date: 2013-03-10 (Sun, 10 Mar 2013)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -1508,6 +1508,13 @@ static void ffmpeg_buf_free()
|
||||
/* **************************** */
|
||||
/* 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)
|
||||
{
|
||||
@@ -1543,6 +1550,12 @@ int container_ffmpeg_init(Context_t *context, char * filename)
|
||||
#ifdef MARTII //TDT
|
||||
avformat_network_init();
|
||||
#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 ((err = av_open_input_file(&avContext, filename, NULL, 0, NULL)) != 0) {
|
||||
@@ -2139,6 +2152,7 @@ static int container_ffmpeg_stop(Context_t *context) {
|
||||
getMutex(FILENAME, __FUNCTION__,__LINE__);
|
||||
|
||||
#ifdef MARTII
|
||||
if (avContext)
|
||||
avformat_close_input(&avContext);
|
||||
#else
|
||||
if (avContext != NULL) {
|
||||
|
Reference in New Issue
Block a user