FFmpeg throws a bunch of PHP warnings concerning undefined variables. This patch fixes those.

One question is why was cache_get() commented out? This caused a warning as $cache would be undefined.

Another thing is ffmpeg_wrapper_enable(). It's not supposed to be an implementation of hook_enable(), right? I renamed it to ffmpeg_wrapper_load_js().

Comments

zoo33’s picture

Status: Active » Needs review
zoo33’s picture

Found another problem around line 335:

<?php
function ffmpeg_wrapper_return_codecs($type) {
  static $codecs;
  if ($codecs[$type]) {
  // ...
}
?>

This should be:

<?php
function ffmpeg_wrapper_return_codecs($type) {
  static $codecs;
  if (!empty($codecs[$type])) {
  // ...
}
?>

...or you'll get a PHP warning. I don't have time to update the patch right now, will do that later.

arthurf’s picture

Status: Needs review » Fixed

I applied most of this- didn't do the function name change yet.

Thanks for the patch!

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

zoo33’s picture

Status: Closed (fixed) » Active

I'm reopening this as there is still the issue with ffmpeg_wrapper_enable() triggering the hook hook_enable(). The result is a PHP warning when you enable the module, due to the fact that hook_enable() doesn't have any arguments, and fmpeg_wrapper_enable() does.

A simple search-and-replace for "ffmpeg_wrapper_enable()" would solve it. (The function is only called once in the code.)

arthurf’s picture

Ah, gotcha. My bad. Fixing in CVS. Will you port this up to 6x?

zoo33’s picture

Version: 5.x-1.x-dev » 6.x-1.x-dev
Status: Active » Patch (to be ported)

Yup, I'll do that. Thanks!

zoo33’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new1.43 KB

Hm, I don't seem to have commit access. Thought I did. So, here's a patch instead!

I included a TODO comment that went into your last commit.

zoo33’s picture

Status: Needs review » Fixed

Turns out I did have commit access. So, committed!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.