if (!(pkt->flags & AV_PKT_FLAG_KEY) && !key_detected)
goto NEXT;
- debug_msg(RELEASE, "video frame: %d, %d, %d", retry, i, v);
#ifdef __MMFILE_TEST_MODE__
_dump_av_packet(pkt);
#endif
i++;
key_detected = false;
+ debug_msg(RELEASE, "video frame: %d, %d, %d", retry, i, v);
ret = avcodec_send_packet(pCodecCtx, pkt);
if (ret < 0 && ret != AVERROR(EAGAIN) && ret != AVERROR_EOF) {
* UTF8 convert
*/
if (taginfo.title) {
- formatContext->title = mmfile_convert_to_utf8(taginfo.title, -1, locale);
+ formatContext->title = mmfile_convert_to_utf8(taginfo.title, strlen(taginfo.title), locale);
if (formatContext->title == NULL) {
debug_warning(DEBUG, "failed to UTF8 convert.\n");
}
if (taginfo.composer) {
- formatContext->composer = mmfile_convert_to_utf8(taginfo.composer, -1, locale);
+ formatContext->composer = mmfile_convert_to_utf8(taginfo.composer, strlen(taginfo.composer), locale);
if (formatContext->composer == NULL) {
debug_warning(DEBUG, "failed to UTF8 convert.\n");
formatContext->composer = g_strdup(taginfo.composer);
}
if (taginfo.copyright) {
- formatContext->copyright = mmfile_convert_to_utf8(taginfo.copyright, -1, locale);
+ formatContext->copyright = mmfile_convert_to_utf8(taginfo.copyright, strlen(taginfo.copyright), locale);
if (formatContext->copyright == NULL) {
debug_warning(DEBUG, "failed to UTF8 convert.\n");
formatContext->copyright = g_strdup(taginfo.copyright);
* UTF8 converting.
*/
if (info->title) {
- formatContext->title = mmfile_convert_to_utf8((const char *)info->title, -1, locale);
+ formatContext->title = mmfile_convert_to_utf8(info->title, strlen(info->title), locale);
if (formatContext->title == NULL) {
debug_warning(DEBUG, "failed to UTF8 convert.\n");
formatContext->title = g_strdup(info->title);
}
if (info->copyright) {
- formatContext->copyright = mmfile_convert_to_utf8((const char *)info->copyright, -1, locale);
+ formatContext->copyright = mmfile_convert_to_utf8(info->copyright, strlen(info->copyright), locale);
if (formatContext->copyright == NULL) {
debug_warning(DEBUG, "failed to UTF8 convert.\n");
formatContext->copyright = g_strdup(info->copyright);
}
if (info->comment) {
- formatContext->comment = mmfile_convert_to_utf8((const char *)info->comment, -1, locale);
+ formatContext->comment = mmfile_convert_to_utf8(info->comment, strlen(info->comment), locale);
if (formatContext->comment == NULL) {
debug_warning(DEBUG, "failed to UTF8 convert.\n");
formatContext->comment = g_strdup(info->comment);
/*if both to_codeset and from_codeset are same, return duplicated string.*/
if (g_strcmp0(MMFILE_CODESET_UTF8, from_codeset) == 0)
- return g_strdup(str);
+ return g_strndup(str, len);
result = g_convert(str, len, MMFILE_CODESET_UTF8, from_codeset, NULL, NULL, &err);