Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
8133a0aa
Commit
8133a0aa
authored
Sep 27, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec: use decoder_GetPicture()
This reduces the semaphore contention scope.
parent
997b63e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
modules/codec/avcodec/video.c
modules/codec/avcodec/video.c
+8
-7
No files found.
modules/codec/avcodec/video.c
View file @
8133a0aa
...
@@ -766,7 +766,7 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
...
@@ -766,7 +766,7 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
* then picture buffer can be allocated. */
* then picture buffer can be allocated. */
if
(
p_sys
->
p_va
==
NULL
if
(
p_sys
->
p_va
==
NULL
&&
lavc_UpdateVideoFormat
(
p_dec
,
p_context
,
false
)
==
0
)
&&
lavc_UpdateVideoFormat
(
p_dec
,
p_context
,
false
)
==
0
)
p_pic
=
decoder_
New
Picture
(
p_dec
);
p_pic
=
decoder_
Get
Picture
(
p_dec
);
if
(
!
p_pic
)
if
(
!
p_pic
)
{
{
...
@@ -1061,11 +1061,9 @@ static int lavc_GetFrame(struct AVCodecContext *ctx, AVFrame *frame, int flags)
...
@@ -1061,11 +1061,9 @@ static int lavc_GetFrame(struct AVCodecContext *ctx, AVFrame *frame, int flags)
return
-
1
;
return
-
1
;
}
}
}
}
/* FIXME: The core forces an extra output format update here, so the
* semaphore is still needed. */
pic
=
decoder_NewPicture
(
dec
);
post_mt
(
sys
);
post_mt
(
sys
);
pic
=
decoder_GetPicture
(
dec
);
if
(
pic
==
NULL
)
if
(
pic
==
NULL
)
return
-
1
;
return
-
1
;
...
@@ -1128,8 +1126,9 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
...
@@ -1128,8 +1126,9 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
}
}
if
(
lavc_UpdateVideoFormat
(
p_dec
,
p_context
,
true
))
if
(
lavc_UpdateVideoFormat
(
p_dec
,
p_context
,
true
))
continue
;
/* Unsupported brand of hardware acceleration */
continue
;
/* Unsupported brand of hardware acceleration */
post_mt
(
p_sys
);
picture_t
*
test_pic
=
decoder_
New
Picture
(
p_dec
);
picture_t
*
test_pic
=
decoder_
Get
Picture
(
p_dec
);
assert
(
!
test_pic
||
test_pic
->
format
.
i_chroma
==
p_dec
->
fmt_out
.
video
.
i_chroma
);
assert
(
!
test_pic
||
test_pic
->
format
.
i_chroma
==
p_dec
->
fmt_out
.
video
.
i_chroma
);
vlc_va_t
*
va
=
vlc_va_New
(
VLC_OBJECT
(
p_dec
),
p_context
,
hwfmt
,
vlc_va_t
*
va
=
vlc_va_New
(
VLC_OBJECT
(
p_dec
),
p_context
,
hwfmt
,
&
p_dec
->
fmt_in
,
&
p_dec
->
fmt_in
,
...
@@ -1137,8 +1136,10 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
...
@@ -1137,8 +1136,10 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
if
(
test_pic
)
if
(
test_pic
)
picture_Release
(
test_pic
);
picture_Release
(
test_pic
);
if
(
va
==
NULL
)
if
(
va
==
NULL
)
{
wait_mt
(
p_sys
);
continue
;
/* Unsupported codec profile or such */
continue
;
/* Unsupported codec profile or such */
post_mt
(
p_sys
);
}
if
(
va
->
description
!=
NULL
)
if
(
va
->
description
!=
NULL
)
msg_Info
(
p_dec
,
"Using %s for hardware decoding"
,
va
->
description
);
msg_Info
(
p_dec
,
"Using %s for hardware decoding"
,
va
->
description
);
...
...
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