Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for opus, comment field & misc #283

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

h67ma
Copy link

@h67ma h67ma commented Dec 5, 2024

No description provided.

h67ma added 4 commits December 4, 2024 23:20
local.properties is clearly not meant to be present in version control
(as stated in the file itself). Remove it, as otherwise the paths to
sdk/ndk need to be modified manually.

Signed-off-by: h67ma <[email protected]>
Compilation fails because advance_file_descriptor() is undeclared. Move
it above its usage.

Signed-off-by: h67ma <[email protected]>
Current configuration of ffmpeg does not support opus containers and
streams. In stream_component_open(), avcodec_find_decoder() for codec id
AV_CODEC_ID_OPUS returns NULL.

Add the --enable-libopus flag to ffmpeg-android-maker.sh.

Note: not sure about the branch with openssl enabled.
build_ffmpeg_with_ssl.sh does not exist.

Signed-off-by: h67ma <[email protected]>
In current implementation, tags from all streams are being put in a
single map. This can cause overwriting tags from other streams. One
specific example is the "comment" field in audio files. If a coverart
(attached picture) is present, its stream usually contains a "comment"
field with a value of e.g. "Cover (front)". The "comment" field is also
commonly used in audio streams. Audio stream tags are parsed before any
attached pictures (video streams) in get_metadata_internal(). If the
file has video streams with "comment" tags, those tags will overwrite
the original value from audio stream. From a user's perspective, the
value from audio stream is more preferable than a coverart annotation.

Add flags to av_dict_copy() calls to not overwrite previous keys.

Note: this is more of a workaround than a fix. A proper, comprehensive
fix would be to redesign the whole library to output an array of maps,
one for each stream.

Signed-off-by: h67ma <[email protected]>
@h67ma
Copy link
Author

h67ma commented Dec 5, 2024

Patch 4/5 fixes #263

wseemann_media_FFmpegMediaMetadataRetriever_setDataSourceAndHeaders
copies from char ptr to char array without allocating space for the
terminating null byte. This sometimes results in file uri containing
random garbage at the end after the buffer is passed to
MediaMetadataRetriever::setDataSource and subsequent functions.
Fix it by allocating a buffer of proper size (strlen(src) + 1).

Signed-off-by: h67ma <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant