On Mon, Aug 13, 2007 at 10:31:09AM +0100, Adam wrote:
> > If you want a quick fix for this and don't care about seeking precision, 
> > you can hack MP3Reader
> Thanks, I shall try and take a look today if I can get all these
> other things done first. The code looks comprehensible at first
> glance at least.

Yeah, that was simple enough. Here's a patch file which
just changes the generation of the audio-only FLV files
so that they're onl recording 10% of the ones they 
currently do. Obviously thus reducing the granularity
of the seek() that's possible.

That's good enough for my purposes, and has fixed the
problems I was having.

Thanks for your help folks.

        Adam............


Index: src/org/red5/io/flv/impl/FLVReader.java
===================================================================
--- src/org/red5/io/flv/impl/FLVReader.java     (revision 2228)
+++ src/org/red5/io/flv/impl/FLVReader.java     (working copy)
@@ -605,7 +605,13 @@
                                return keyframeMeta;
                        }
                }
-               
+       
+
+        // Gemin-i - Pre - GOT
+        // Define a variable to track fraction of audio timestamps to record
+        // We'll increment it each frame and only record the ones where it % 10
+        int pre_audioFrameRestriction = 0;
+       
         // Lists of video positions and timestamps
         List<Long> positionList = new ArrayList<Long>();
         List<Integer> timestampList = new ArrayList<Integer>();
@@ -649,8 +655,12 @@
                                        firstAudioTag = pos;
                                }
                                if (audioOnly) {
-                                       audioPositionList.add(pos);
-                                       
audioTimestampList.add(tmpTag.getTimestamp());
+                                        //Gemin-i - Pre - GOT
+                                        //Only do this *sometimes*
+                                        if(((pre_audioFrameRestriction++) % 
10)==0){
+                                         audioPositionList.add(pos);
+                                         
audioTimestampList.add(tmpTag.getTimestamp());
+                                        }
                                }
                        }
                        // XXX Paul: this 'properly' handles damaged FLV files 
- as far as
_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org

Reply via email to