Skip to content

Commit

Permalink
interface/mmal: Reduce the header bytes alloc in the MMAL examples
Browse files Browse the repository at this point in the history
The examples read the first 512 bytes of the stream and try stuffing
them into the codec as header bytes.
If running a debug build of MMAL this will fail as the extradata
field of the port format is bigger than MMAL_FORMAT_EXTRADATA_MAX_SIZE

Reduce the header bytes array down to 128bytes to match
MMAL_FORMAT_EXTRADATA_MAX_SIZE.
  • Loading branch information
6by9 committed Jul 27, 2020
1 parent 1e1d07d commit 4bad21d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion interface/mmal/test/examples/example_basic_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#define CHECK_STATUS(status, msg) if (status != MMAL_SUCCESS) { fprintf(stderr, msg"\n"); goto error; }

static uint8_t codec_header_bytes[512];
static uint8_t codec_header_bytes[128];
static unsigned int codec_header_bytes_size = sizeof(codec_header_bytes);

static FILE *source_file;
Expand Down
2 changes: 1 addition & 1 deletion interface/mmal/test/examples/example_basic_2.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#define CHECK_STATUS(status, msg) if (status != MMAL_SUCCESS) { fprintf(stderr, msg"\n"); goto error; }

static uint8_t codec_header_bytes[512];
static uint8_t codec_header_bytes[128];
static unsigned int codec_header_bytes_size = sizeof(codec_header_bytes);

static FILE *source_file;
Expand Down

0 comments on commit 4bad21d

Please sign in to comment.