Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gst-kaldi-nnet2-online
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
homeostasis
gst-kaldi-nnet2-online
Commits
918945fd
Commit
918945fd
authored
10 years ago
by
tanel
Browse files
Options
Downloads
Patches
Plain Diff
Guard against EOS when not yet decoding
parent
8a339089
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/gstkaldinnet2onlinedecoder.cc
+9
-2
9 additions, 2 deletions
src/gstkaldinnet2onlinedecoder.cc
src/gstkaldinnet2onlinedecoder.h
+1
-0
1 addition, 0 deletions
src/gstkaldinnet2onlinedecoder.h
with
10 additions
and
2 deletions
src/gstkaldinnet2onlinedecoder.cc
+
9
−
2
View file @
918945fd
...
@@ -249,6 +249,7 @@ static void gst_kaldinnet2onlinedecoder_init(
...
@@ -249,6 +249,7 @@ static void gst_kaldinnet2onlinedecoder_init(
// will be set later
// will be set later
filter
->
feature_info
=
NULL
;
filter
->
feature_info
=
NULL
;
filter
->
sample_rate
=
0
;
filter
->
sample_rate
=
0
;
filter
->
decoding
=
false
;
// init properties from various Kaldi Opts
// init properties from various Kaldi Opts
GstElementClass
*
klass
=
GST_ELEMENT_GET_CLASS
(
filter
);
GstElementClass
*
klass
=
GST_ELEMENT_GET_CLASS
(
filter
);
...
@@ -603,6 +604,7 @@ static void gst_kaldinnet2onlinedecoder_loop(
...
@@ -603,6 +604,7 @@ static void gst_kaldinnet2onlinedecoder_loop(
gst_pad_pause_task
(
filter
->
srcpad
);
gst_pad_pause_task
(
filter
->
srcpad
);
delete
filter
->
audio_source
;
delete
filter
->
audio_source
;
filter
->
audio_source
=
new
GstBufferSource
();
filter
->
audio_source
=
new
GstBufferSource
();
filter
->
decoding
=
false
;
}
}
/* GstElement vmethod implementations */
/* GstElement vmethod implementations */
...
@@ -653,8 +655,8 @@ static gboolean gst_kaldinnet2onlinedecoder_sink_event(GstPad * pad,
...
@@ -653,8 +655,8 @@ static gboolean gst_kaldinnet2onlinedecoder_sink_event(GstPad * pad,
switch
(
GST_EVENT_TYPE
(
event
))
{
switch
(
GST_EVENT_TYPE
(
event
))
{
case
GST_EVENT_SEGMENT
:
{
case
GST_EVENT_SEGMENT
:
{
GST_DEBUG_OBJECT
(
filter
,
"Starting decoding task"
);
GST_DEBUG_OBJECT
(
filter
,
"Starting decoding task"
);
filter
->
decoding
=
true
;
gst_pad_start_task
(
filter
->
srcpad
,
gst_pad_start_task
(
filter
->
srcpad
,
(
GstTaskFunction
)
gst_kaldinnet2onlinedecoder_loop
,
(
GstTaskFunction
)
gst_kaldinnet2onlinedecoder_loop
,
filter
,
NULL
);
filter
,
NULL
);
...
@@ -670,7 +672,12 @@ static gboolean gst_kaldinnet2onlinedecoder_sink_event(GstPad * pad,
...
@@ -670,7 +672,12 @@ static gboolean gst_kaldinnet2onlinedecoder_sink_event(GstPad * pad,
case
GST_EVENT_EOS
:
{
case
GST_EVENT_EOS
:
{
/* end-of-stream, we should close down all stream leftovers here */
/* end-of-stream, we should close down all stream leftovers here */
GST_DEBUG_OBJECT
(
filter
,
"EOS received"
);
GST_DEBUG_OBJECT
(
filter
,
"EOS received"
);
filter
->
audio_source
->
SetEnded
(
true
);
if
(
filter
->
decoding
)
{
filter
->
audio_source
->
SetEnded
(
true
);
}
else
{
GST_DEBUG_OBJECT
(
filter
,
"EOS received while not decoding, pushing EOS out"
);
gst_pad_push_event
(
filter
->
srcpad
,
gst_event_new_eos
());
}
ret
=
TRUE
;
ret
=
TRUE
;
break
;
break
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/gstkaldinnet2onlinedecoder.h
+
1
−
0
View file @
918945fd
...
@@ -105,6 +105,7 @@ struct _Gstkaldinnet2onlinedecoder
...
@@ -105,6 +105,7 @@ struct _Gstkaldinnet2onlinedecoder
fst
::
Fst
<
fst
::
StdArc
>
*
decode_fst
;
fst
::
Fst
<
fst
::
StdArc
>
*
decode_fst
;
fst
::
SymbolTable
*
word_syms
;
fst
::
SymbolTable
*
word_syms
;
int
sample_rate
;
int
sample_rate
;
gboolean
decoding
;
};
};
struct
_Gstkaldinnet2onlinedecoderClass
struct
_Gstkaldinnet2onlinedecoderClass
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment