Skip to content

Commit

Permalink
mp4: update comments around fix
Browse files Browse the repository at this point in the history
Now that this MP4Read fix is practically finalized, make sure we properly document why we make this call.
  • Loading branch information
OxygenCobalt committed Oct 6, 2021
1 parent 976bef2 commit 968c4bd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ip/mp4.c
Expand Up @@ -172,9 +172,13 @@ static int mp4_open(struct input_plugin_data *ip_data)

/* open mpeg-4 file */
#if MP4V2_PROJECT_version_major < 2 || (MP4V2_PROJECT_version_major == 2 && MP4V2_PROJECT_version_minor < 1)
/* MP4Read doesnt have a second argument on macos */
priv->mp4.handle = MP4Read(ip_data->filename);
#else
/* some distributions [notably arch linux] use techsmith's mp4v2 fork instead of the largely abandoned
upstream project. This fork however is primarily designed for internal techsmith use, and in 4.1.4/4.1.5
they added an extra argument to MP4Read that when dynamically called my cmus would result in a segfault.
to fix this, we check if we are using the techsmith fork by seeing if the version is higher than the last
upstream version, and then specify the argument in that case. */
priv->mp4.handle = MP4Read(ip_data->filename, NULL);
#endif

Expand Down

1 comment on commit 968c4bd

@nefthy
Copy link
Collaborator

@nefthy nefthy commented on 968c4bd Oct 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately TechSmith has not updated the techsmith's constants in project.h. They still read 2.0.0 despite them having released a 2.1.0 version.

Please sign in to comment.