aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-03 05:38:12 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-11-03 05:49:07 +0100
commit343c73e252d3e3c1e5d2037c2e8eb14b504f1e6f (patch)
tree396adb2f6fc9a0d2b4f23ad7584f84527d91434e /libavformat
parent8c93269e420735f41363e75f8ee4c4e7b3ec49a7 (diff)
downloadffmpeg-343c73e252d3e3c1e5d2037c2e8eb14b504f1e6f.tar.gz
asfdec: parse aspect ratio payload extension
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/asfdec.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index 30e2a50b43..9339e1b351 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -949,6 +949,7 @@ static int asf_read_frame_header(AVFormatContext *s, AVIOContext *pb){
}
if (asf->packet_replic_size >= 8) {
int64_t end = avio_tell(pb) + asf->packet_replic_size;
+ AVRational aspect;
asf->packet_obj_size = avio_rl32(pb);
if(asf->packet_obj_size >= (1<<24) || asf->packet_obj_size <= 0){
av_log(s, AV_LOG_ERROR, "packet_obj_size invalid\n");
@@ -971,6 +972,13 @@ static int asf_read_frame_header(AVFormatContext *s, AVIOContext *pb){
case 0x50:
// duration = avio_rl16(pb);
break;
+ case 0x54:
+ aspect.num = avio_r8(pb);
+ aspect.den = avio_r8(pb);
+ if (aspect.num > 0 && aspect.den > 0) {
+ s->streams[asf->stream_index]->sample_aspect_ratio = aspect;
+ }
+ break;
case 0x2A:
avio_skip(pb, 8);
ts0= avio_rl64(pb);