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
bab11fe7
Commit
bab11fe7
authored
Nov 20, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/mpeg12dec: forward error codes
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
1852b2a0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
18 deletions
+22
-18
mpeg12dec.c
libavcodec/mpeg12dec.c
+22
-18
No files found.
libavcodec/mpeg12dec.c
View file @
bab11fe7
...
@@ -733,6 +733,7 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64])
...
@@ -733,6 +733,7 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64])
{
{
int
i
,
j
,
k
,
cbp
,
val
,
mb_type
,
motion_type
;
int
i
,
j
,
k
,
cbp
,
val
,
mb_type
,
motion_type
;
const
int
mb_block_count
=
4
+
(
1
<<
s
->
chroma_format
);
const
int
mb_block_count
=
4
+
(
1
<<
s
->
chroma_format
);
int
ret
;
av_dlog
(
s
->
avctx
,
"decode_mb: x=%d y=%d
\n
"
,
s
->
mb_x
,
s
->
mb_y
);
av_dlog
(
s
->
avctx
,
"decode_mb: x=%d y=%d
\n
"
,
s
->
mb_x
,
s
->
mb_y
);
...
@@ -846,13 +847,13 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64])
...
@@ -846,13 +847,13 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64])
mpeg2_fast_decode_block_intra
(
s
,
*
s
->
pblocks
[
i
],
i
);
mpeg2_fast_decode_block_intra
(
s
,
*
s
->
pblocks
[
i
],
i
);
}
else
{
}
else
{
for
(
i
=
0
;
i
<
mb_block_count
;
i
++
)
for
(
i
=
0
;
i
<
mb_block_count
;
i
++
)
if
(
mpeg2_decode_block_intra
(
s
,
*
s
->
pblocks
[
i
],
i
)
<
0
)
if
(
(
ret
=
mpeg2_decode_block_intra
(
s
,
*
s
->
pblocks
[
i
],
i
)
)
<
0
)
return
-
1
;
return
ret
;
}
}
}
else
{
}
else
{
for
(
i
=
0
;
i
<
6
;
i
++
)
for
(
i
=
0
;
i
<
6
;
i
++
)
if
(
mpeg1_decode_block_intra
(
s
,
*
s
->
pblocks
[
i
],
i
)
<
0
)
if
(
(
ret
=
mpeg1_decode_block_intra
(
s
,
*
s
->
pblocks
[
i
],
i
)
)
<
0
)
return
-
1
;
return
ret
;
}
}
}
else
{
}
else
{
if
(
mb_type
&
MB_TYPE_ZERO_MV
)
{
if
(
mb_type
&
MB_TYPE_ZERO_MV
)
{
...
@@ -1074,8 +1075,8 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64])
...
@@ -1074,8 +1075,8 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64])
for
(
i
=
0
;
i
<
mb_block_count
;
i
++
)
{
for
(
i
=
0
;
i
<
mb_block_count
;
i
++
)
{
if
(
cbp
&
(
1
<<
11
))
{
if
(
cbp
&
(
1
<<
11
))
{
if
(
mpeg2_decode_block_non_intra
(
s
,
*
s
->
pblocks
[
i
],
i
)
<
0
)
if
(
(
ret
=
mpeg2_decode_block_non_intra
(
s
,
*
s
->
pblocks
[
i
],
i
)
)
<
0
)
return
-
1
;
return
ret
;
}
else
{
}
else
{
s
->
block_last_index
[
i
]
=
-
1
;
s
->
block_last_index
[
i
]
=
-
1
;
}
}
...
@@ -1094,8 +1095,8 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64])
...
@@ -1094,8 +1095,8 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64])
}
else
{
}
else
{
for
(
i
=
0
;
i
<
6
;
i
++
)
{
for
(
i
=
0
;
i
<
6
;
i
++
)
{
if
(
cbp
&
32
)
{
if
(
cbp
&
32
)
{
if
(
mpeg1_decode_block_inter
(
s
,
*
s
->
pblocks
[
i
],
i
)
<
0
)
if
(
(
ret
=
mpeg1_decode_block_inter
(
s
,
*
s
->
pblocks
[
i
],
i
)
)
<
0
)
return
-
1
;
return
ret
;
}
else
{
}
else
{
s
->
block_last_index
[
i
]
=
-
1
;
s
->
block_last_index
[
i
]
=
-
1
;
}
}
...
@@ -1627,13 +1628,14 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size)
...
@@ -1627,13 +1628,14 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size)
{
{
AVCodecContext
*
avctx
=
s
->
avctx
;
AVCodecContext
*
avctx
=
s
->
avctx
;
Mpeg1Context
*
s1
=
(
Mpeg1Context
*
)
s
;
Mpeg1Context
*
s1
=
(
Mpeg1Context
*
)
s
;
int
ret
;
/* start frame decoding */
/* start frame decoding */
if
(
s
->
first_field
||
s
->
picture_structure
==
PICT_FRAME
)
{
if
(
s
->
first_field
||
s
->
picture_structure
==
PICT_FRAME
)
{
AVFrameSideData
*
pan_scan
;
AVFrameSideData
*
pan_scan
;
if
(
ff_mpv_frame_start
(
s
,
avctx
)
<
0
)
if
(
(
ret
=
ff_mpv_frame_start
(
s
,
avctx
)
)
<
0
)
return
-
1
;
return
ret
;
ff_mpeg_er_frame_start
(
s
);
ff_mpeg_er_frame_start
(
s
);
...
@@ -1712,8 +1714,8 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size)
...
@@ -1712,8 +1714,8 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size)
}
}
if
(
avctx
->
hwaccel
)
{
if
(
avctx
->
hwaccel
)
{
if
(
avctx
->
hwaccel
->
start_frame
(
avctx
,
buf
,
buf_size
)
<
0
)
if
(
(
ret
=
avctx
->
hwaccel
->
start_frame
(
avctx
,
buf
,
buf_size
)
)
<
0
)
return
-
1
;
return
ret
;
}
}
return
0
;
return
0
;
...
@@ -1734,6 +1736,7 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y,
...
@@ -1734,6 +1736,7 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y,
AVCodecContext
*
avctx
=
s
->
avctx
;
AVCodecContext
*
avctx
=
s
->
avctx
;
const
int
lowres
=
s
->
avctx
->
lowres
;
const
int
lowres
=
s
->
avctx
->
lowres
;
const
int
field_pic
=
s
->
picture_structure
!=
PICT_FRAME
;
const
int
field_pic
=
s
->
picture_structure
!=
PICT_FRAME
;
int
ret
;
s
->
resync_mb_x
=
s
->
resync_mb_x
=
s
->
resync_mb_y
=
-
1
;
s
->
resync_mb_y
=
-
1
;
...
@@ -1830,8 +1833,8 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y,
...
@@ -1830,8 +1833,8 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y,
if
((
CONFIG_MPEG1_XVMC_HWACCEL
||
CONFIG_MPEG2_XVMC_HWACCEL
)
&&
s
->
pack_pblocks
)
if
((
CONFIG_MPEG1_XVMC_HWACCEL
||
CONFIG_MPEG2_XVMC_HWACCEL
)
&&
s
->
pack_pblocks
)
ff_xvmc_init_block
(
s
);
// set s->block
ff_xvmc_init_block
(
s
);
// set s->block
if
(
mpeg_decode_mb
(
s
,
s
->
block
)
<
0
)
if
(
(
ret
=
mpeg_decode_mb
(
s
,
s
->
block
)
)
<
0
)
return
-
1
;
return
ret
;
// Note motion_val is normally NULL unless we want to extract the MVs.
// Note motion_val is normally NULL unless we want to extract the MVs.
if
(
s
->
current_picture
.
motion_val
[
0
]
&&
!
s
->
encoding
)
{
if
(
s
->
current_picture
.
motion_val
[
0
]
&&
!
s
->
encoding
)
{
...
@@ -2189,6 +2192,7 @@ static int vcr2_init_sequence(AVCodecContext *avctx)
...
@@ -2189,6 +2192,7 @@ static int vcr2_init_sequence(AVCodecContext *avctx)
Mpeg1Context
*
s1
=
avctx
->
priv_data
;
Mpeg1Context
*
s1
=
avctx
->
priv_data
;
MpegEncContext
*
s
=
&
s1
->
mpeg_enc_ctx
;
MpegEncContext
*
s
=
&
s1
->
mpeg_enc_ctx
;
int
i
,
v
;
int
i
,
v
;
int
ret
;
/* start new MPEG-1 context decoding */
/* start new MPEG-1 context decoding */
s
->
out_format
=
FMT_MPEG1
;
s
->
out_format
=
FMT_MPEG1
;
...
@@ -2205,8 +2209,8 @@ static int vcr2_init_sequence(AVCodecContext *avctx)
...
@@ -2205,8 +2209,8 @@ static int vcr2_init_sequence(AVCodecContext *avctx)
setup_hwaccel_for_pixfmt
(
avctx
);
setup_hwaccel_for_pixfmt
(
avctx
);
ff_mpv_idct_init
(
s
);
ff_mpv_idct_init
(
s
);
if
(
ff_mpv_common_init
(
s
)
<
0
)
if
(
(
ret
=
ff_mpv_common_init
(
s
)
)
<
0
)
return
-
1
;
return
ret
;
s1
->
mpeg_enc_ctx_allocated
=
1
;
s1
->
mpeg_enc_ctx_allocated
=
1
;
for
(
i
=
0
;
i
<
64
;
i
++
)
{
for
(
i
=
0
;
i
<
64
;
i
++
)
{
...
@@ -2663,8 +2667,8 @@ static int decode_chunks(AVCodecContext *avctx, AVFrame *picture,
...
@@ -2663,8 +2667,8 @@ static int decode_chunks(AVCodecContext *avctx, AVFrame *picture,
if
(
s
->
first_slice
)
{
if
(
s
->
first_slice
)
{
skip_frame
=
0
;
skip_frame
=
0
;
s
->
first_slice
=
0
;
s
->
first_slice
=
0
;
if
(
mpeg_field_start
(
s2
,
buf
,
buf_size
)
<
0
)
if
(
(
ret
=
mpeg_field_start
(
s2
,
buf
,
buf_size
)
)
<
0
)
return
-
1
;
return
ret
;
}
}
if
(
!
s2
->
current_picture_ptr
)
{
if
(
!
s2
->
current_picture_ptr
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
av_log
(
avctx
,
AV_LOG_ERROR
,
...
...
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