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

Embedded coverart overwrites comment field #263

Open
h67ma opened this issue Oct 14, 2022 · 0 comments
Open

Embedded coverart overwrites comment field #263

h67ma opened this issue Oct 14, 2022 · 0 comments

Comments

@h67ma
Copy link

h67ma commented Oct 14, 2022

Summary

Parsing of comment metadata field yields wrong value if embedded coverart(s) are present.

Repro

val testPath = "/path/to/testfile.ogg"
val mediaInfo = FFmpegMediaMetadataRetriever()
mediaInfo.setDataSource(testPath)
for (meta in mediaInfo.metadata.all)
{
	Log.d("test", "${meta.key} = ${meta.value}");
}

(see attached sample files: ffmpeg_extr_embedded_coverart_comments_bug.zip)

Sample 1: test_no_coverart.ogg

If track has no embedded coverart, comment field extraction works correctly:

...
D/test: COMMENT = boonooonoonnos
...

Sample 2: test_coverart_comment.ogg

If coverart is present, comment field value is overwritten with "Cover (front)":

...
D/test: comment = Cover (front)
...

Sample 3: test_coverart_comments.ogg

Some audio files include a field called comments instead of comment, in which case there will be two values: one coming from embedded coverart "comment", and second coming from comments field:

...
D/test: comments = boonooonoonnos
...
D/test: comment = Cover (front)
...

Sample 4: test_coverart_multiple_comment.ogg

In case when audio file contains multiple embedded coverarts, the last one will replace the comment field value:

...
D/test: comment = Cover (back)
...

Version

1.0.18

Isolation notes

Issue does not reproduce on 1.0.16

Speculation

Looing at the output of ffprobe -v quiet -print_format json -show_format -show_streams test_coverart_comment.ogg, if coverart is present, there exists root["streams"][index]["tags"]["comment"], containing the name of coverart, e.g. "Cover (front)". This is likely the cause of the bug, as the comment key has the same name as the actual comment key.

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

No branches or pull requests

1 participant