Use av_alloc_put_byte() instead of ffio_init_context() since the
latter expects an already allocated AVIOContext. BeScreenCapture works again, and should fix also #8299.
This commit is contained in:
@@ -363,11 +363,12 @@ AVFormatWriter::Init(const media_file_format* fileFormat)
|
|||||||
if (buffer == NULL)
|
if (buffer == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
// Init I/O context with buffer and hook functions, pass ourself as
|
// Allocate I/O context and initialize it with buffer
|
||||||
// cookie.
|
// and hook functions, pass ourself as cookie.
|
||||||
if (init_put_byte(fIOContext, buffer, kIOBufferSize, 1, this,
|
fIOContext = av_alloc_put_byte(buffer, kIOBufferSize, 1, this,
|
||||||
0, _Write, _Seek) != 0) {
|
0, _Write, _Seek);
|
||||||
TRACE(" init_put_byte() failed!\n");
|
if (fIOContext == NULL) {
|
||||||
|
TRACE("av_alloc_put_byte() failed!\n");
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user