~ubuntu-branches/ubuntu/hardy/avidemux/hardy

« back to all changes in this revision

Viewing changes to avidemux/ADM_mpegdemuxer/dmx_demuxerPS.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T Chen
  • Date: 2006-12-15 17:13:20 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20061215171320-w79pvpehxx2fr217
Tags: 1:2.3.0-0.0ubuntu1
* Merge from debian-multimedia.org, remaining Ubuntu change:
  - desktop file,
  - no support for ccache and make -j.
* Closes Ubuntu: #69614.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
uint8_t         dmx_demuxerPS::changePid(uint32_t newpid,uint32_t newpes)
32
32
{
33
33
          myPid=newpes & 0xff;
34
 
          if(myPid<9 || (myPid>=0xA0&&myPid<=0xA9) || (myPid>=0x20 && myPid<0x27)) myPid|=0xff00;
 
34
          if(myPid<9 || (myPid>=0xA0&&myPid<=0xA9) || (myPid>=0x20 && myPid<0x27) ||(myPid>=0x40 && myPid<=0x49) ) myPid|=0xff00;
35
35
        _pesBufferStart=0;  // Big value so that we read
36
36
        _pesBufferLen=0;
37
37
        _pesBufferIndex=0;
260
260
                hnt=0;
261
261
 
262
262
                // preload
263
 
                hnt=(read8i()<<16) + (read8i()<<8) +read8i();
 
263
                hnt=read32i();
264
264
                if(_lastErr)
265
265
                {
266
266
                        _lastErr=0;
267
267
                        printf("\n io error , aborting sync 1\n");
268
268
                        return 0;       
269
269
                }
270
 
 
271
 
                while((hnt!=0x00001))
 
270
                val=hnt&0xff;
 
271
                while(((hnt&0xffffff00)!=0x100))
272
272
                {
273
273
 
274
274
                        hnt<<=8;
275
275
                        val=read8i();
276
276
                        hnt+=val;
277
 
                        hnt&=0xffffff;
278
 
 
279
277
                        if(_lastErr)
280
278
                        {
281
279
                             _lastErr=0;
285
283
 
286
284
                }
287
285
 
288
 
                *stream=read8i();
 
286
                *stream=val;
289
287
                // Case 1 : assume we are still in the same packet
290
288
                if(_pesBufferIndex>=4)
291
289
                {
633
631
  //                    printf("\n Subid : %x",*subid);
634
632
                                switch(*substream)
635
633
                                {
 
634
                                // DTS
 
635
                                        case 0x88:case 0x89:case 0x8A:case 0x8B:
 
636
                                        
 
637
                                                *substream=*substream-0x48;
 
638
                                                break;
 
639
 
636
640
                                //AC3
637
641
                                        case 0x80:case 0x81:case 0x82:case 0x83:
638
642
                                        case 0x84:case 0x85:case 0x86:case 0x87:
652
656
                                                break;
653
657
                             
654
658
                                default:
 
659
                                                printf("Unkown substream %x\n",*substream);
655
660
                                                *substream=0xff;
656
661
                                }
657
662
                                // skip audio header (if not sub)