Fix ffmpeg
This commit is contained in:
parent
819fda4f7e
commit
b309423fbc
@ -57,7 +57,7 @@ static int http_ffmpeg_read_from_buf(void *opaque, uint8_t *buf, int buf_size)
|
|||||||
|
|
||||||
buf_size = FFMIN(buf_size, status->buf->used - status->buf_offset);
|
buf_size = FFMIN(buf_size, status->buf->used - status->buf_offset);
|
||||||
if (!buf_size)
|
if (!buf_size)
|
||||||
return 0;
|
return AVERROR_EOF;
|
||||||
|
|
||||||
E_LOG_DEBUG(status, "http_ffmpeg_read_from_buf: offset=%d, n=%d", status->buf_offset, buf_size);
|
E_LOG_DEBUG(status, "http_ffmpeg_read_from_buf: offset=%d, n=%d", status->buf_offset, buf_size);
|
||||||
memcpy(buf, (char*)status->buf->start + status->buf_offset, buf_size);
|
memcpy(buf, (char*)status->buf->start + status->buf_offset, buf_size);
|
||||||
@ -117,19 +117,21 @@ error:
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void http_ffmpeg_close_avcontext(AVFormatContext **context)
|
static void http_ffmpeg_close_avcontext(AVFormatContext **contextp)
|
||||||
{
|
{
|
||||||
if (!*context)
|
if (!*contextp)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
AVIOContext *pb = (*context)->pb;
|
AVFormatContext *context = *contextp;
|
||||||
if (pb) av_freep(&pb->buffer);
|
|
||||||
avio_context_free(&(*context)->pb);
|
if (context->pb)
|
||||||
if ((*context)->iformat)
|
av_freep(&context->pb->buffer);
|
||||||
avformat_close_input(context);
|
avio_context_free(&context->pb);
|
||||||
|
if (context->iformat)
|
||||||
|
avformat_close_input(contextp);
|
||||||
else
|
else
|
||||||
avformat_free_context(*context);
|
avformat_free_context(context);
|
||||||
*context = NULL;
|
*contextp = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int http_ffmpeg_copy_streams(http_ffmpeg_status_t *status)
|
static int http_ffmpeg_copy_streams(http_ffmpeg_status_t *status)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user