[FFmpeg-cvslog] asfdec: parse aspect ratio payload extension

Michael Niedermayer git at videolan.org
Tue Dec 11 00:00:01 CET 2012


ffmpeg | branch: release/1.0 | Michael Niedermayer <michaelni at gmx.at> | Sat Nov  3 05:38:12 2012 +0100| [08d75bf545f3fa9caad3f508b82d3da1ca709ed3] | committer: Carl Eugen Hoyos

asfdec: parse aspect ratio payload extension

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 343c73e252d3e3c1e5d2037c2e8eb14b504f1e6f)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=08d75bf545f3fa9caad3f508b82d3da1ca709ed3
---

 libavformat/asfdec.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index f963aa8..06f76ba 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -946,6 +946,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");
@@ -968,6 +969,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);



More information about the ffmpeg-cvslog mailing list