Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
c0479f0f
Commit
c0479f0f
authored
Oct 25, 2013
by
Marton Balint
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libzvbi-teletextdec: propagate errors generated in page handler
Signed-off-by:
Marton Balint
<
cus@passwd.hu
>
parent
4947b062
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
libzvbi-teletextdec.c
libavcodec/libzvbi-teletextdec.c
+17
-4
No files found.
libavcodec/libzvbi-teletextdec.c
View file @
c0479f0f
...
@@ -60,6 +60,7 @@ typedef struct TeletextContext
...
@@ -60,6 +60,7 @@ typedef struct TeletextContext
TeletextPage
*
pages
;
TeletextPage
*
pages
;
int
nb_pages
;
int
nb_pages
;
int64_t
pts
;
int64_t
pts
;
int
handler_ret
;
vbi_decoder
*
vbi
;
vbi_decoder
*
vbi
;
vbi_dvb_demux
*
dx
;
vbi_dvb_demux
*
dx
;
...
@@ -307,6 +308,8 @@ handler(vbi_event *ev, void *user_data)
...
@@ -307,6 +308,8 @@ handler(vbi_event *ev, void *user_data)
if
(
strcmp
(
ctx
->
pgno
,
"*"
)
&&
!
strstr
(
ctx
->
pgno
,
pgno_str
))
if
(
strcmp
(
ctx
->
pgno
,
"*"
)
&&
!
strstr
(
ctx
->
pgno
,
pgno_str
))
return
;
return
;
if
(
ctx
->
handler_ret
<
0
)
return
;
/* Fetch the page. */
/* Fetch the page. */
res
=
vbi_fetch_vt_page
(
ctx
->
vbi
,
&
page
,
res
=
vbi_fetch_vt_page
(
ctx
->
vbi
,
&
page
,
...
@@ -345,17 +348,22 @@ handler(vbi_event *ev, void *user_data)
...
@@ -345,17 +348,22 @@ handler(vbi_event *ev, void *user_data)
res
=
(
ctx
->
format_id
==
0
)
?
res
=
(
ctx
->
format_id
==
0
)
?
gen_sub_bitmap
(
ctx
,
cur_page
->
sub_rect
,
&
page
,
chop_top
)
:
gen_sub_bitmap
(
ctx
,
cur_page
->
sub_rect
,
&
page
,
chop_top
)
:
gen_sub_text
(
ctx
,
cur_page
->
sub_rect
,
&
page
,
chop_top
);
gen_sub_text
(
ctx
,
cur_page
->
sub_rect
,
&
page
,
chop_top
);
if
(
res
)
if
(
res
<
0
)
{
av_freep
(
&
cur_page
->
sub_rect
);
av_freep
(
&
cur_page
->
sub_rect
);
else
ctx
->
handler_ret
=
res
;
}
else
{
ctx
->
pages
[
ctx
->
nb_pages
++
]
=
*
cur_page
;
ctx
->
pages
[
ctx
->
nb_pages
++
]
=
*
cur_page
;
}
}
else
{
ctx
->
handler_ret
=
AVERROR
(
ENOMEM
);
}
}
}
else
{
}
else
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Failed to allocate memory to to buffer pages
\n
"
);
ctx
->
handler_ret
=
AVERROR
(
ENOMEM
);
}
}
}
else
{
}
else
{
//TODO: If multiple packets contain more than one page, pages may got queued up, and this may happen...
//TODO: If multiple packets contain more than one page, pages may got queued up, and this may happen...
av_log
(
ctx
,
AV_LOG_ERROR
,
"Buffered too many pages, dropping page %s.
\n
"
,
pgno_str
);
av_log
(
ctx
,
AV_LOG_ERROR
,
"Buffered too many pages, dropping page %s.
\n
"
,
pgno_str
);
ctx
->
handler_ret
=
AVERROR
(
ENOSYS
);
}
}
vbi_unref_page
(
&
page
);
vbi_unref_page
(
&
page
);
...
@@ -403,6 +411,8 @@ teletext_decode_frame(AVCodecContext *avctx,
...
@@ -403,6 +411,8 @@ teletext_decode_frame(AVCodecContext *avctx,
* (see mpegts demuxer) are not accurate enough to pass that test. */
* (see mpegts demuxer) are not accurate enough to pass that test. */
vbi_dvb_demux_cor
(
ctx
->
dx
,
ctx
->
sliced
,
64
,
NULL
,
&
pesheader_buf
,
&
pesheader_size
);
vbi_dvb_demux_cor
(
ctx
->
dx
,
ctx
->
sliced
,
64
,
NULL
,
&
pesheader_buf
,
&
pesheader_size
);
ctx
->
handler_ret
=
pkt
->
size
;
while
(
left
>
0
)
{
while
(
left
>
0
)
{
int64_t
pts
=
0
;
int64_t
pts
=
0
;
unsigned
int
lines
=
vbi_dvb_demux_cor
(
ctx
->
dx
,
ctx
->
sliced
,
64
,
&
pts
,
&
buf
,
&
left
);
unsigned
int
lines
=
vbi_dvb_demux_cor
(
ctx
->
dx
,
ctx
->
sliced
,
64
,
&
pts
,
&
buf
,
&
left
);
...
@@ -423,9 +433,12 @@ teletext_decode_frame(AVCodecContext *avctx,
...
@@ -423,9 +433,12 @@ teletext_decode_frame(AVCodecContext *avctx,
}
}
}
}
ctx
->
pts
=
AV_NOPTS_VALUE
;
ctx
->
pts
=
AV_NOPTS_VALUE
;
ret
=
pkt
->
size
;
ret
=
ctx
->
handler_ret
;
}
}
if
(
ret
<
0
)
return
ret
;
// is there a subtitle to pass?
// is there a subtitle to pass?
if
(
ctx
->
nb_pages
)
{
if
(
ctx
->
nb_pages
)
{
int
i
;
int
i
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment