Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
Aegisub
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Déploiement
Releases
Registre de paquets
Registre de conteneurs
Registre de modèles
Opération
Modules Terraform
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Ce projet est archivé. Le dépôt et les autres ressources du projet sont en lecture seule.
Afficher davantage de fils d'Ariane
Kubat
Aegisub
Validations
4683c5a9
Valider
4683c5a9
rédigé
Il y a 16 ans
par
Fredrik Mellbin
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
FFmpegSource2: crash less
Originally committed to SVN as r2404.
parent
b0137363
Branches
Branches contenant la validation
Étiquettes
Étiquettes contenant la validation
Aucune requête de fusion associée trouvée
Modifications
3
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
3 fichiers modifiés
FFmpegSource2/ffavsfilters.cpp
+22
-22
22 ajouts, 22 suppressions
FFmpegSource2/ffavsfilters.cpp
FFmpegSource2/ffvideosource.cpp
+1
-1
1 ajout, 1 suppression
FFmpegSource2/ffvideosource.cpp
FFmpegSource2/indexing.cpp
+13
-5
13 ajouts, 5 suppressions
FFmpegSource2/indexing.cpp
avec
36 ajouts
et
28 suppressions
FFmpegSource2/ffavsfilters.cpp
+
22
−
22
Voir le fichier @
4683c5a9
...
@@ -118,9 +118,10 @@ AVSValue __cdecl CreateFFVideoSource(AVSValue Args, void* UserData, IScriptEnvir
...
@@ -118,9 +118,10 @@ AVSValue __cdecl CreateFFVideoSource(AVSValue Args, void* UserData, IScriptEnvir
if
(
!
strcmp
(
CacheFile
,
""
))
if
(
!
strcmp
(
CacheFile
,
""
))
CacheFile
=
DefaultCache
.
c_str
();
CacheFile
=
DefaultCache
.
c_str
();
FrameIndex
*
Index
;
FrameIndex
*
Index
=
NULL
;
if
(
Cache
)
{
if
(
Cache
)
if
(
!
(
Index
=
FFMS_ReadIndex
(
CacheFile
,
ErrorMsg
,
MsgSize
)))
{
Index
=
FFMS_ReadIndex
(
CacheFile
,
ErrorMsg
,
MsgSize
);
if
(
!
Index
)
{
if
(
!
(
Index
=
FFMS_MakeIndex
(
Source
,
0
,
0
,
NULL
,
true
,
NULL
,
NULL
,
ErrorMsg
,
MsgSize
)))
if
(
!
(
Index
=
FFMS_MakeIndex
(
Source
,
0
,
0
,
NULL
,
true
,
NULL
,
NULL
,
ErrorMsg
,
MsgSize
)))
Env
->
ThrowError
(
"FFVideoSource: %s"
,
ErrorMsg
);
Env
->
ThrowError
(
"FFVideoSource: %s"
,
ErrorMsg
);
...
@@ -130,7 +131,6 @@ AVSValue __cdecl CreateFFVideoSource(AVSValue Args, void* UserData, IScriptEnvir
...
@@ -130,7 +131,6 @@ AVSValue __cdecl CreateFFVideoSource(AVSValue Args, void* UserData, IScriptEnvir
Env
->
ThrowError
(
"FFVideoSource: %s"
,
ErrorMsg
);
Env
->
ThrowError
(
"FFVideoSource: %s"
,
ErrorMsg
);
}
}
}
}
}
if
(
Track
==
-
1
)
if
(
Track
==
-
1
)
Track
=
FFMS_GetFirstTrackOfType
(
Index
,
FFMS_TYPE_VIDEO
,
ErrorMsg
,
MsgSize
);
Track
=
FFMS_GetFirstTrackOfType
(
Index
,
FFMS_TYPE_VIDEO
,
ErrorMsg
,
MsgSize
);
...
@@ -179,9 +179,10 @@ AVSValue __cdecl CreateFFAudioSource(AVSValue Args, void* UserData, IScriptEnvir
...
@@ -179,9 +179,10 @@ AVSValue __cdecl CreateFFAudioSource(AVSValue Args, void* UserData, IScriptEnvir
if
(
!
strcmp
(
CacheFile
,
""
))
if
(
!
strcmp
(
CacheFile
,
""
))
CacheFile
=
DefaultCache
.
c_str
();
CacheFile
=
DefaultCache
.
c_str
();
FrameIndex
*
Index
;
FrameIndex
*
Index
=
NULL
;
if
(
Cache
)
{
if
(
Cache
)
if
(
!
(
Index
=
FFMS_ReadIndex
(
CacheFile
,
ErrorMsg
,
MsgSize
)))
{
Index
=
FFMS_ReadIndex
(
CacheFile
,
ErrorMsg
,
MsgSize
);
if
(
!
Index
)
{
if
(
!
(
Index
=
FFMS_MakeIndex
(
Source
,
-
1
,
0
,
CacheFile
,
true
,
NULL
,
NULL
,
ErrorMsg
,
MsgSize
)))
if
(
!
(
Index
=
FFMS_MakeIndex
(
Source
,
-
1
,
0
,
CacheFile
,
true
,
NULL
,
NULL
,
ErrorMsg
,
MsgSize
)))
Env
->
ThrowError
(
"FFAudioSource: %s"
,
ErrorMsg
);
Env
->
ThrowError
(
"FFAudioSource: %s"
,
ErrorMsg
);
...
@@ -191,7 +192,6 @@ AVSValue __cdecl CreateFFAudioSource(AVSValue Args, void* UserData, IScriptEnvir
...
@@ -191,7 +192,6 @@ AVSValue __cdecl CreateFFAudioSource(AVSValue Args, void* UserData, IScriptEnvir
Env
->
ThrowError
(
"FFAudioSource: %s"
,
ErrorMsg
);
Env
->
ThrowError
(
"FFAudioSource: %s"
,
ErrorMsg
);
}
}
}
}
}
if
(
Track
==
-
1
)
if
(
Track
==
-
1
)
Track
=
FFMS_GetFirstTrackOfType
(
Index
,
FFMS_TYPE_AUDIO
,
ErrorMsg
,
MsgSize
);
Track
=
FFMS_GetFirstTrackOfType
(
Index
,
FFMS_TYPE_AUDIO
,
ErrorMsg
,
MsgSize
);
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
FFmpegSource2/ffvideosource.cpp
+
1
−
1
Voir le fichier @
4683c5a9
...
@@ -110,7 +110,7 @@ VideoBase::~VideoBase() {
...
@@ -110,7 +110,7 @@ VideoBase::~VideoBase() {
}
}
AVFrameLite
*
VideoBase
::
GetFrameByTime
(
double
Time
,
char
*
ErrorMsg
,
unsigned
MsgSize
)
{
AVFrameLite
*
VideoBase
::
GetFrameByTime
(
double
Time
,
char
*
ErrorMsg
,
unsigned
MsgSize
)
{
int
Frame
=
Frames
.
ClosestFrameFromDTS
((
Time
*
Frames
.
TB
.
Num
)
/
Frames
.
TB
.
Den
);
int
Frame
=
Frames
.
ClosestFrameFromDTS
((
Time
*
Frames
.
TB
.
Num
)
/
Frames
.
TB
.
Den
+
0.5
);
return
GetFrame
(
Frame
,
ErrorMsg
,
MsgSize
);
return
GetFrame
(
Frame
,
ErrorMsg
,
MsgSize
);
}
}
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
FFmpegSource2/indexing.cpp
+
13
−
5
Voir le fichier @
4683c5a9
...
@@ -60,7 +60,7 @@ public:
...
@@ -60,7 +60,7 @@ public:
FFAudioContext
()
{
FFAudioContext
()
{
W64W
=
NULL
;
W64W
=
NULL
;
CTX
=
0
;
CTX
=
NULL
;
CurrentSample
=
0
;
CurrentSample
=
0
;
}
}
...
@@ -206,6 +206,8 @@ static FrameIndex *MakeMatroskaIndex(const char *SourceFile, int IndexMask, int
...
@@ -206,6 +206,8 @@ static FrameIndex *MakeMatroskaIndex(const char *SourceFile, int IndexMask, int
if
(
mkv_GetTrackInfo
(
MF
,
i
)
->
CompEnabled
)
{
if
(
mkv_GetTrackInfo
(
MF
,
i
)
->
CompEnabled
)
{
AudioContexts
[
i
].
CS
=
cs_Create
(
MF
,
i
,
ErrorMessage
,
sizeof
(
ErrorMessage
));
AudioContexts
[
i
].
CS
=
cs_Create
(
MF
,
i
,
ErrorMessage
,
sizeof
(
ErrorMessage
));
if
(
AudioContexts
[
i
].
CS
==
NULL
)
{
if
(
AudioContexts
[
i
].
CS
==
NULL
)
{
av_free
(
AudioCodecContext
);
AudioContexts
[
i
].
CTX
=
NULL
;
_snprintf
(
ErrorMsg
,
MsgSize
,
"Can't create decompressor: %s"
,
ErrorMessage
);
_snprintf
(
ErrorMsg
,
MsgSize
,
"Can't create decompressor: %s"
,
ErrorMessage
);
return
NULL
;
return
NULL
;
}
}
...
@@ -213,11 +215,15 @@ static FrameIndex *MakeMatroskaIndex(const char *SourceFile, int IndexMask, int
...
@@ -213,11 +215,15 @@ static FrameIndex *MakeMatroskaIndex(const char *SourceFile, int IndexMask, int
AVCodec
*
AudioCodec
=
avcodec_find_decoder
(
MatroskaToFFCodecID
(
mkv_GetTrackInfo
(
MF
,
i
)));
AVCodec
*
AudioCodec
=
avcodec_find_decoder
(
MatroskaToFFCodecID
(
mkv_GetTrackInfo
(
MF
,
i
)));
if
(
AudioCodec
==
NULL
)
{
if
(
AudioCodec
==
NULL
)
{
av_free
(
AudioCodecContext
);
AudioContexts
[
i
].
CTX
=
NULL
;
_snprintf
(
ErrorMsg
,
MsgSize
,
"Audio codec not found"
);
_snprintf
(
ErrorMsg
,
MsgSize
,
"Audio codec not found"
);
return
NULL
;
return
NULL
;
}
}
if
(
avcodec_open
(
AudioCodecContext
,
AudioCodec
)
<
0
)
{
if
(
avcodec_open
(
AudioCodecContext
,
AudioCodec
)
<
0
)
{
av_free
(
AudioCodecContext
);
AudioContexts
[
i
].
CTX
=
NULL
;
_snprintf
(
ErrorMsg
,
MsgSize
,
"Could not open audio codec"
);
_snprintf
(
ErrorMsg
,
MsgSize
,
"Could not open audio codec"
);
return
NULL
;
return
NULL
;
}
}
...
@@ -350,6 +356,8 @@ FrameIndex *MakeIndex(const char *SourceFile, int IndexMask, int DumpMask, const
...
@@ -350,6 +356,8 @@ FrameIndex *MakeIndex(const char *SourceFile, int IndexMask, int DumpMask, const
_snprintf
(
ErrorMsg
,
MsgSize
,
"Could not open audio codec"
);
_snprintf
(
ErrorMsg
,
MsgSize
,
"Could not open audio codec"
);
return
NULL
;
return
NULL
;
}
}
AudioContexts
[
i
].
CTX
=
AudioCodecContext
;
}
else
{
}
else
{
IndexMask
&=
~
(
1
<<
i
);
IndexMask
&=
~
(
1
<<
i
);
}
}
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter