<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:"Yu Gothic";
panose-1:2 11 4 0 0 0 0 0 0 0;}
@font-face
{font-family:"MS PGothic";
panose-1:2 11 6 0 7 2 5 8 2 4;}
@font-face
{font-family:"\@Yu Gothic";
panose-1:2 11 4 0 0 0 0 0 0 0;}
@font-face
{font-family:"\@MS PGothic";}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Yu Gothic";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:99.25pt 3.0cm 3.0cm 3.0cm;}
div.WordSection1
{page:WordSection1;}
--></style></head><body lang=JA link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='font-family:"Times New Roman",serif'>Also sorry. I should’ve saved only media’s path in clip.</span><span lang=EN-US style='font-family:"Times New Roman",serif'> Please ignore this patch !<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Times New Roman",serif'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Times New Roman",serif'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US> </span></p><p class=MsoNormal><span lang=EN-US>Sent from my Windows 10 phone</span></p><p class=MsoNormal><span lang=EN-US style='font-size:12.0pt;font-family:"MS PGothic",sans-serif'><o:p> </o:p></span></p><div style='mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal style='border:none;padding:0cm'><b><span lang=EN-US>From: </span></b><span lang=EN-US><a href="mailto:luyikei.qmltu@gmail.com">yikei lu</a><br><b>Sent: </b>2016</span>年<span lang=EN-US>4</span>月<span lang=EN-US>11</span>日<span lang=EN-US> 1:37<br><b>To: </b><a href="mailto:vlmc-devel@videolan.org">Mailing list for vlmc developers</a><br><b>Subject: </b>Re: [PATCH] Fix guessing as a wrong type of media when itsonMetaDataComputed is not yet called</span></p></div><p class=MsoNormal><span lang=EN-US style='font-size:12.0pt;font-family:"MS PGothic",sans-serif'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Sorry I meant TrackWorkflow</span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>2016-04-11 0:52 GMT+09:00 Yikai Lu <luyikei.qmltu@gmail.com>:</span></p><p class=MsoNormal><span lang=EN-US>> If loading in MainWorkflow is too fast to compute media's metadata, it's highly likely that the workflow will misjudge the type of ClipWorkflow.</span></p><p class=MsoNormal><span lang=EN-US>> ---</span></p><p class=MsoNormal><span lang=EN-US>> src/Library/MediaContainer.cpp | 6 ++++--</span></p><p class=MsoNormal><span lang=EN-US>> src/Media/Media.cpp | 5 ++++-</span></p><p class=MsoNormal><span lang=EN-US>> 2 files changed, 8 insertions(+), 3 deletions(-)</span></p><p class=MsoNormal><span lang=EN-US>><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>> diff --git a/src/Library/MediaContainer.cpp b/src/Library/MediaContainer.cpp</span></p><p class=MsoNormal><span lang=EN-US>> index a0b3364..574cb95 100644</span></p><p class=MsoNormal><span lang=EN-US>> --- a/src/Library/MediaContainer.cpp</span></p><p class=MsoNormal><span lang=EN-US>> +++ b/src/Library/MediaContainer.cpp</span></p><p class=MsoNormal><span lang=EN-US>> @@ -195,7 +195,9 @@ MediaContainer::count() const</span></p><p class=MsoNormal><span lang=EN-US>> Media*</span></p><p class=MsoNormal><span lang=EN-US>> MediaContainer::createMediaFromVariant( const QVariant& var )</span></p><p class=MsoNormal><span lang=EN-US>> {</span></p><p class=MsoNormal><span lang=EN-US>> - Media* m = addMedia( QFileInfo( var.toString() ) );</span></p><p class=MsoNormal><span lang=EN-US>> + auto map = var.toMap();</span></p><p class=MsoNormal><span lang=EN-US>> + Media* m = addMedia( QFileInfo( map["path"].toString() ) );</span></p><p class=MsoNormal><span lang=EN-US>> + m->setFileType( (Media::FileType) map["type"].toInt() );</span></p><p class=MsoNormal><span lang=EN-US>> return m;</span></p><p class=MsoNormal><span lang=EN-US>> }</span></p><p class=MsoNormal><span lang=EN-US>><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>> @@ -209,7 +211,7 @@ MediaContainer::createClipFromVariant( const QVariant &var, Clip* parent )</span></p><p class=MsoNormal><span lang=EN-US>> c = new Clip( parent, h["begin"].toULongLong(),</span></p><p class=MsoNormal><span lang=EN-US>> h["end"].toULongLong(), h["uuid"].toString() );</span></p><p class=MsoNormal><span lang=EN-US>> else {</span></p><p class=MsoNormal><span lang=EN-US>> - c = new Clip( m_medias[ h["media"].toString() ], 0, -1, h["uuid"].toString() );</span></p><p class=MsoNormal><span lang=EN-US>> + c = new Clip( m_medias[ h["media"].toMap()["path"].toString() ], 0, -1, h["uuid"].toString() );</span></p><p class=MsoNormal><span lang=EN-US>> addClip( c );</span></p><p class=MsoNormal><span lang=EN-US>> }</span></p><p class=MsoNormal><span lang=EN-US>> if ( h.contains( "subClips" ) )</span></p><p class=MsoNormal><span lang=EN-US>> diff --git a/src/Media/Media.cpp b/src/Media/Media.cpp</span></p><p class=MsoNormal><span lang=EN-US>> index 9f708f1..cdbbd31 100644</span></p><p class=MsoNormal><span lang=EN-US>> --- a/src/Media/Media.cpp</span></p><p class=MsoNormal><span lang=EN-US>> +++ b/src/Media/Media.cpp</span></p><p class=MsoNormal><span lang=EN-US>> @@ -151,7 +151,10 @@ Media::onMetaDataComputed()</span></p><p class=MsoNormal><span lang=EN-US>> QVariant</span></p><p class=MsoNormal><span lang=EN-US>> Media::toVariant() const</span></p><p class=MsoNormal><span lang=EN-US>> {</span></p><p class=MsoNormal><span lang=EN-US>> - return QVariant( m_fileInfo->absoluteFilePath() );</span></p><p class=MsoNormal><span lang=EN-US>> + return QVariant( QVariantHash {</span></p><p class=MsoNormal><span lang=EN-US>> + { "path", m_fileInfo->absoluteFilePath() },</span></p><p class=MsoNormal><span lang=EN-US>> + { "type", (int) m_fileType }</span></p><p class=MsoNormal><span lang=EN-US>> + } );</span></p><p class=MsoNormal><span lang=EN-US>> }</span></p><p class=MsoNormal><span lang=EN-US>><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>> void</span></p><p class=MsoNormal><span lang=EN-US>> --</span></p><p class=MsoNormal><span lang=EN-US>> 1.9.1</span></p><p class=MsoNormal><span lang=EN-US>><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div></body></html>