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
d706c1aa
Commit
d706c1aa
authored
Dec 11, 2013
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: asf: follow aspect ratio payload extension (fix #7433)
parent
86dde348
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
modules/demux/asf/asf.c
modules/demux/asf/asf.c
+34
-0
No files found.
modules/demux/asf/asf.c
View file @
d706c1aa
...
...
@@ -36,6 +36,8 @@
#include <vlc_meta.h>
/* vlc_meta_Set*, vlc_meta_New */
#include <vlc_access.h>
/* GET_PRIVATE_ID_STATE */
#include <vlc_codecs.h>
/* VLC_BITMAPINFOHEADER, WAVEFORMATEX */
#include <vlc_input.h>
#include <vlc_vout.h>
#include <limits.h>
...
...
@@ -76,6 +78,7 @@ typedef struct
int
i_cat
;
es_out_id_t
*
p_es
;
es_format_t
*
p_fmt
;
/* format backup for video changes */
asf_object_stream_properties_t
*
p_sp
;
asf_object_extended_stream_properties_t
*
p_esp
;
...
...
@@ -647,7 +650,25 @@ static void ParsePayloadExtensions(demux_t *p_demux, asf_track_t *tk,
==
ASF_EXTENSION_VIDEOFRAME_IFRAME
);
}
}
else
if
(
guidcmp
(
&
p_ext
->
i_extension_id
,
&
mfasf_sampleextension_pixelaspectratio_guid
)
)
{
if
(
i_payload_extensions_size
!=
sizeof
(
uint16_t
)
)
goto
sizeerror
;
uint8_t
i_ratio_x
=
*
p_data
;
uint8_t
i_ratio_y
=
*
(
p_data
+
1
);
if
(
tk
->
p_fmt
->
video
.
i_sar_num
!=
i_ratio_x
||
tk
->
p_fmt
->
video
.
i_sar_den
!=
i_ratio_y
)
{
vout_thread_t
*
p_vout
=
input_GetVout
(
p_demux
->
p_input
);
if
(
p_vout
)
{
msg_Info
(
p_demux
,
"Changing aspect ratio to %i/%i"
,
i_ratio_x
,
i_ratio_y
);
tk
->
p_fmt
->
video
.
i_sar_num
=
i_ratio_x
;
tk
->
p_fmt
->
video
.
i_sar_den
=
i_ratio_y
;
vout_ChangeAspectRatio
(
p_vout
,
i_ratio_x
,
i_ratio_y
);
vlc_object_release
(
p_vout
);
}
}
}
i_length
-=
i_payload_extensions_size
;
p_data
+=
i_payload_extensions_size
;
}
...
...
@@ -1404,6 +1425,14 @@ static int DemuxInit( demux_t *p_demux )
else
msg_Warn
(
p_demux
,
"Can't set fmt.i_id to match stream id %u"
,
i_stream
);
if
(
fmt
.
i_cat
==
VIDEO_ES
)
{
/* Backup our video format */
tk
->
p_fmt
=
malloc
(
sizeof
(
es_format_t
)
);
if
(
tk
->
p_fmt
)
es_format_Copy
(
tk
->
p_fmt
,
&
fmt
);
}
tk
->
p_es
=
es_out_Add
(
p_demux
->
out
,
&
fmt
);
}
else
...
...
@@ -1575,6 +1604,11 @@ static void DemuxEnd( demux_t *p_demux )
{
es_out_Del
(
p_demux
->
out
,
tk
->
p_es
);
}
if
(
tk
->
p_fmt
)
{
es_format_Clean
(
tk
->
p_fmt
);
free
(
tk
->
p_fmt
);
}
free
(
tk
);
}
p_sys
->
track
[
i
]
=
0
;
...
...
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