Closed GoogleCodeExporter closed 9 years ago
same issue with trunk-355
Original comment by razone
on 3 Dec 2009 at 3:14
The problem is that there are two ways to specify a genre. The ~gen atom which
contains a string and the gnre atom which contains a genre number. It appears
that
MP4V2 only supports the ~gen atom. I've created a fix which will support both,
but
I'm not enlisted so I can't check it in. If you can build the source, go to
src\itmf\tags.cpp, find the line:
fetchGenre( cim, genreType, c.genreType );
and after it add:
if (genre == "") {
genre = enumGenreType.data[genreType-1].formal;
c.genre = genre.c_str();
}
That way if the ~gen atom is empty, it will decode the gnre atom and use it.
If you can't build and would like a fixed DLL, email me at danhi@danhinsley.com.
If someone who understand both the format of MP4 files and this code sees that
this
is a bad solution, please let me know.
Dan
Original comment by danahins...@gmail.com
on 13 Dec 2009 at 9:01
Thanks, it worked perfect.
razone
Original comment by razone
on 14 Dec 2009 at 1:25
[deleted comment]
Danahinsley can now commit code. Thanks Dan. Cheers Ed.
Original comment by eddyg.o....@gmail.com
on 14 Dec 2009 at 7:51
Eddy, I've tried using the same username/password that I use to log into google
code, but it doesn't like it. Do I have some other username/password that I
need to
use? You can email me directly at danhi@danhinsley.com
Original comment by danahins...@gmail.com
on 14 Dec 2009 at 11:57
Okay, I checked this in, although with one bugfix--it also needs to make sure
genreType isn't GENRE_UNDEFINED:
// Fix for issue #45 - two different ways to specify a genre string, the
// ~gen atom which contains a string and the gnre atom, which contains
// an index. if our genre is empty and we have a valid genreType,
// go ahead and populate genre with the correct string.
if (genre == "" && genreType != GENRE_UNDEFINED) {
genre = enumGenreType.data[genreType-1].formal;
c.genre = genre.c_str();
}
Without the extra check, files that contain either will display an empty genre
string
in MP4Info. Hopefully kona can drop in and comment on this change (seems out of
place to me), but it's in r378.
Original comment by kid...@gmail.com
on 4 Apr 2010 at 12:56
Reopening...after discussing this with Kona, I'm going to implement a slightly
different change. Callers should be checking for both genre and genreType if
they're
interested in a genre value.
The basic problem here seems to be there's no way to get a string value that
corresponds with genreType. The one thing we can do is provide a mapping
between
string values in the enum and genreType. But with the way the code currently
is, it
wouldn't be possible for someone to have an empty genre, which is invalid.
Original comment by kid...@gmail.com
on 23 Apr 2010 at 10:20
okay--turns out you can pretty easily fetch the genreType and convert that into
its
associated string reference:
if ( tags->genreType ) {
string s =
itmf::enumGenreType.toString(static_cast<itmf::GenreType>(*tags->genreType ),
true);
fprintf( stdout, " GenreType: %u, %s\n", *tags->genreType, s.c_str() );
}
...I've updated mp4info to show how to do this--it follows suit with many of the
other enum types in the same file, so nothing too extraordinary here.
I backed out dana's fix (sorry)--it gives a false impression of what's actually
in
the file; mp4v2 should respect the fact that there truly is no "genre" tag and
not
misreport the contents of the file.
changes should be in changeset 384.
Original comment by kid...@gmail.com
on 27 Apr 2010 at 5:56
Also, to the original poster, I should mention one more thing--you'll need to
use
r355 or trunk to use genreType, I don't believe they're available in 1.9.1.
Original comment by kid...@gmail.com
on 27 Apr 2010 at 6:42
I`m actually using r355 with dana`s fix, tested with a lot of mp4 files and no
problems. I will upgrade to trunk and report if there are new issues.
Thanks
Original comment by razone
on 27 Apr 2010 at 7:35
okay--if you use trunk, please make sure you review the changes in r384--I
updated
the command line utility to show you how to convert the genreType to its string
value. genre will still be empty/null.
Original comment by kid...@gmail.com
on 27 Apr 2010 at 8:08
(many years pass)
So, I see the code in mp4info and it works fine. My question is simply how can
one easily use this approach in their own code which uses mp4v2. The
enumGenreType, toString, and assorted other bits that get called into play are
all in the non-exposed part of the project. I tried to use as minimal a subset
as possible of the code and it just kept snowballing needing more headers and
cpp files that weren't part of the API.
enumGenreType looks like it is actually in the created lib files, but I don't
see a clean way to hook into it from outside code.
Original comment by r...@loci.net
on 11 May 2015 at 8:29
Original issue reported on code.google.com by
razone
on 3 Dec 2009 at 2:50Attachments: