Skip to content

Commit

Permalink
Use av_alloc_put_byte() instead of ffio_init_context() since the
Browse files Browse the repository at this point in the history
latter expects an already allocated AVIOContext.
BeScreenCapture works again, and should fix also #8299.
  • Loading branch information
jackburton79 committed Jan 3, 2013
1 parent 5745a40 commit 7e75e56
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/add-ons/media/plugins/ffmpeg/AVFormatWriter.cpp
Expand Up @@ -363,11 +363,12 @@ AVFormatWriter::Init(const media_file_format* fileFormat)
if (buffer == NULL)
return B_NO_MEMORY;

// Init I/O context with buffer and hook functions, pass ourself as
// cookie.
if (init_put_byte(fIOContext, buffer, kIOBufferSize, 1, this,
0, _Write, _Seek) != 0) {
TRACE(" init_put_byte() failed!\n");
// Allocate I/O context and initialize it with buffer
// and hook functions, pass ourself as cookie.
fIOContext = av_alloc_put_byte(buffer, kIOBufferSize, 1, this,
0, _Write, _Seek);
if (fIOContext == NULL) {
TRACE("av_alloc_put_byte() failed!\n");
return B_ERROR;
}

Expand Down

0 comments on commit 7e75e56

Please sign in to comment.