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
9d2a0695
Commit
9d2a0695
authored
Nov 30, 2004
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
raw rgb flip fix
Originally committed as revision 3724 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
1b307feb
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
+9
-10
ffplay.c
ffplay.c
+0
-10
raw.c
libavcodec/raw.c
+9
-0
No files found.
ffplay.c
View file @
9d2a0695
...
...
@@ -899,15 +899,6 @@ static int video_thread(void *arg)
if
(
pkt
->
dts
!=
AV_NOPTS_VALUE
)
pts
=
(
double
)
pkt
->
dts
/
AV_TIME_BASE
;
if
(
is
->
video_st
->
codec
.
codec_id
==
CODEC_ID_RAWVIDEO
)
{
avpicture_fill
((
AVPicture
*
)
frame
,
pkt
->
data
,
is
->
video_st
->
codec
.
pix_fmt
,
is
->
video_st
->
codec
.
width
,
is
->
video_st
->
codec
.
height
);
frame
->
pict_type
=
FF_I_TYPE
;
if
(
output_picture2
(
is
,
frame
,
pts
)
<
0
)
goto
the_end
;
}
else
{
len1
=
avcodec_decode_video
(
&
is
->
video_st
->
codec
,
frame
,
&
got_picture
,
pkt
->
data
,
pkt
->
size
);
...
...
@@ -917,7 +908,6 @@ static int video_thread(void *arg)
if
(
output_picture2
(
is
,
frame
,
pts
)
<
0
)
goto
the_end
;
}
}
av_free_packet
(
pkt
);
if
(
step
)
if
(
cur_stream
)
...
...
libavcodec/raw.c
View file @
9d2a0695
...
...
@@ -106,6 +106,13 @@ static int raw_init_decoder(AVCodecContext *avctx)
return
0
;
}
static
void
flip
(
AVCodecContext
*
avctx
,
AVPicture
*
picture
){
if
(
!
avctx
->
codec_tag
&&
avctx
->
bits_per_sample
&&
picture
->
linesize
[
1
]
==
0
){
picture
->
data
[
0
]
+=
picture
->
linesize
[
0
]
*
(
avctx
->
height
-
1
);
picture
->
linesize
[
0
]
*=
-
1
;
}
}
static
int
raw_decode
(
AVCodecContext
*
avctx
,
void
*
data
,
int
*
data_size
,
uint8_t
*
buf
,
int
buf_size
)
...
...
@@ -118,6 +125,7 @@ static int raw_decode(AVCodecContext *avctx,
/* Early out without copy if packet size == frame size */
if
(
buf_size
==
context
->
length
&&
context
->
p
==
context
->
buffer
)
{
avpicture_fill
(
picture
,
buf
,
avctx
->
pix_fmt
,
avctx
->
width
,
avctx
->
height
);
flip
(
avctx
,
picture
);
*
data_size
=
sizeof
(
AVPicture
);
return
buf_size
;
}
...
...
@@ -132,6 +140,7 @@ static int raw_decode(AVCodecContext *avctx,
memcpy
(
context
->
p
,
buf
,
bytesNeeded
);
context
->
p
=
context
->
buffer
;
avpicture_fill
(
picture
,
context
->
buffer
,
avctx
->
pix_fmt
,
avctx
->
width
,
avctx
->
height
);
flip
(
avctx
,
picture
);
*
data_size
=
sizeof
(
AVPicture
);
return
bytesNeeded
;
}
...
...
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