Page MenuHomePhabricator

Undefined index in handlers/Mp4Handler.php
Closed, ResolvedPublic

Description

When Mp4Handler is used to handle MP3 files, there is a warning: Notice: Undefined index: video in (MediaWiki path)/extensions/TimedMediaHandler/handlers/Mp4Handler/Mp4Handler.php on line 95.

isset ($metadata['video']) && should be added to the condition in that line.

Event Timeline

alex-mashin raised the priority of this task from to Needs Triage.
alex-mashin updated the task description. (Show Details)
alex-mashin added a project: TimedMediaHandler.
alex-mashin added a subscriber: alex-mashin.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 10 2015, 11:00 PM
brion added a subscriber: brion.Oct 12 2015, 3:13 AM

I'm assuming that using Mp4Handler for mp3 files is a hack of some kind that should not be done. :D Does this also happen on audio-only .m4a/.mp4 files?

I'm assuming that using Mp4Handler for mp3 files is a hack of some kind that should not be done.

Any alternatives to handle MP3?

D Does this also happen on audio-only .m4a/.mp4 files?

Sorry, haven't got any.

Change 247548 had a related patch set uploaded (by TheDJ):
Do not throw errors on audio-only MP4 files

https://gerrit.wikimedia.org/r/247548

TheDJ added a subscriber: TheDJ.Oct 20 2015, 12:09 PM

@alex-mashin Would be handy if you could point us at an example file so we can test.

TheDJ moved this task from Backlog to Doing on the TimedMediaHandler board.Oct 20 2015, 12:11 PM
brion added a comment.Oct 20 2015, 6:12 PM

So, if I try to upload an .mp4 file with only an AAC audio track:

, I get a failure during the upload process:

File extension ".mp4" does not match the detected MIME type of the file (audio/mp4).

(This is with $wgTmhEnableMp4Uploads enabled.)

Presumably needs more work elsewhere to support audio-only files.

Meanwhile, MP3 support should be done with a dedicated handler, just as with other file types.

Split mp4 audio details out to T116094; MP3 is in T115170.

Change 247548 merged by jenkins-bot:
Do not throw errors on audio-only MP4 files

https://gerrit.wikimedia.org/r/247548

brion closed this task as Resolved.Oct 20 2015, 10:57 PM
brion claimed this task.

Patch merged per above.

TheDJ moved this task from Doing to Done on the TimedMediaHandler board.Nov 13 2015, 12:07 PM
Restricted Application added a subscriber: StudiesWorld. · View Herald TranscriptNov 13 2015, 12:07 PM