[FFmpeg-devel] [PATCH] Add generic index support to ea demuxer.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat May 7 21:21:47 CEST 2011


---
 libavformat/electronicarts.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c
index 740b5e7..280e2bf 100644
--- a/libavformat/electronicarts.c
+++ b/libavformat/electronicarts.c
@@ -466,6 +466,7 @@ static int ea_read_packet(AVFormatContext *s,
     int key = 0;
 
     while (!packet_read) {
+        uint64_t pos = avio_tell(pb);
         chunk_type = avio_rl32(pb);
         chunk_size = (ea->big_endian ? avio_rb32(pb) : avio_rl32(pb)) - 8;
 
@@ -491,7 +492,9 @@ static int ea_read_packet(AVFormatContext *s,
             ret = av_get_packet(pb, pkt, chunk_size);
             if (ret < 0)
                 return ret;
+            pkt->pos = pos;
             pkt->stream_index = ea->audio_stream_index;
+            pkt->flags |= AV_PKT_FLAG_KEY;
 
             packet_read = 1;
             break;
@@ -534,6 +537,7 @@ get_video_packet:
             ret = av_get_packet(pb, pkt, chunk_size);
             if (ret < 0)
                 return ret;
+            pkt->pos = pos;
             pkt->stream_index = ea->video_stream_index;
             pkt->flags |= key;
             packet_read = 1;
@@ -555,4 +559,5 @@ AVInputFormat ff_ea_demuxer = {
     ea_probe,
     ea_read_header,
     ea_read_packet,
+    .flags= AVFMT_GENERIC_INDEX,
 };
-- 
1.7.5.1



More information about the ffmpeg-devel mailing list