Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
41ad353d
Commit
41ad353d
authored
Oct 27, 2013
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pgssubdec: stop using deprecated avcodec_set_dimensions
parent
06794162
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
+16
-9
pgssubdec.c
libavcodec/pgssubdec.c
+16
-9
No files found.
libavcodec/pgssubdec.c
View file @
41ad353d
...
...
@@ -27,6 +27,8 @@
#include "avcodec.h"
#include "dsputil.h"
#include "bytestream.h"
#include "internal.h"
#include "libavutil/colorspace.h"
#include "libavutil/imgutils.h"
...
...
@@ -272,13 +274,13 @@ static void parse_palette_segment(AVCodecContext *avctx,
* @todo TODO: Implement cropping
* @todo TODO: Implement forcing of subtitles
*/
static
void
parse_presentation_segment
(
AVCodecContext
*
avctx
,
const
uint8_t
*
buf
,
int
buf_size
,
int64_t
pts
)
static
int
parse_presentation_segment
(
AVCodecContext
*
avctx
,
const
uint8_t
*
buf
,
int
buf_size
,
int64_t
pts
)
{
PGSSubContext
*
ctx
=
avctx
->
priv_data
;
int
x
,
y
;
int
x
,
y
,
ret
;
int
w
=
bytestream_get_be16
(
&
buf
);
int
h
=
bytestream_get_be16
(
&
buf
);
...
...
@@ -287,8 +289,9 @@ static void parse_presentation_segment(AVCodecContext *avctx,
av_dlog
(
avctx
,
"Video Dimensions %dx%d
\n
"
,
w
,
h
);
if
(
av_image_check_size
(
w
,
h
,
0
,
avctx
)
>=
0
)
avcodec_set_dimensions
(
avctx
,
w
,
h
);
ret
=
ff_set_dimensions
(
avctx
,
w
,
h
);
if
(
ret
<
0
)
return
ret
;
/* Skip 1 bytes of unknown, frame rate? */
buf
++
;
...
...
@@ -306,7 +309,7 @@ static void parse_presentation_segment(AVCodecContext *avctx,
ctx
->
presentation
.
object_number
=
bytestream_get_byte
(
&
buf
);
ctx
->
presentation
.
composition_flag
=
0
;
if
(
!
ctx
->
presentation
.
object_number
)
return
;
return
0
;
/*
* Skip 3 bytes of unknown:
...
...
@@ -332,6 +335,8 @@ static void parse_presentation_segment(AVCodecContext *avctx,
/* Fill in dimensions */
ctx
->
presentation
.
x
=
x
;
ctx
->
presentation
.
y
=
y
;
return
0
;
}
/**
...
...
@@ -413,7 +418,7 @@ static int decode(AVCodecContext *avctx, void *data, int *data_size,
const
uint8_t
*
buf_end
;
uint8_t
segment_type
;
int
segment_length
;
int
i
;
int
i
,
ret
;
av_dlog
(
avctx
,
"PGS sub packet:
\n
"
);
...
...
@@ -452,7 +457,9 @@ static int decode(AVCodecContext *avctx, void *data, int *data_size,
parse_picture_segment
(
avctx
,
buf
,
segment_length
);
break
;
case
PRESENTATION_SEGMENT
:
parse_presentation_segment
(
avctx
,
buf
,
segment_length
,
avpkt
->
pts
);
ret
=
parse_presentation_segment
(
avctx
,
buf
,
segment_length
,
avpkt
->
pts
);
if
(
ret
<
0
)
return
ret
;
break
;
case
WINDOW_SEGMENT
:
/*
...
...
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