Changeset 1256
- Timestamp:
- 01/30/10 10:32:34 (1 month ago)
- Files:
-
- trunk/FFissionCodec/FFissionDecoder.cpp (modified) (6 diffs)
- trunk/FFissionCodec/FFissionDecoder.h (modified) (1 diff)
- trunk/ff_MovieImport.c (modified) (1 diff)
- trunk/ff_private.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/FFissionCodec/FFissionDecoder.cpp
r1246 r1256 130 130 131 131 avcodec_get_context_defaults2(avContext, CODEC_TYPE_AUDIO); 132 parser = NULL; 132 133 } 133 134 … … 388 389 } 389 390 } 391 parser = av_parser_init(codecID); 390 392 } 391 393 … … 395 397 avcodec_close(avContext); 396 398 avCodec = NULL; 399 } 400 if (parser) { 401 av_parser_close(parser); 402 parser = NULL; 397 403 } 398 404 } … … 612 618 // loop until we satisfy the request or run out of input data 613 619 while (written < ioOutputDataByteSize && inputBuffer.GetNumPackets() > 0) { 614 int packetSize = inputBuffer.GetCurrentPacketSize(); 620 int packetSize; 621 if(parser) 622 packetSize = inputBuffer.GetDataAvailable(); 623 else 624 packetSize = inputBuffer.GetCurrentPacketSize(); 615 625 uint8_t *packet = inputBuffer.GetData(); 616 626 617 627 // decode one packet to our buffer 618 628 outBufUsed = outBufSize; 629 if(parser) 630 { 631 int parserLen = av_parser_parse2(parser, avContext, &packet, &packetSize, packet, packetSize, 0, 0, 0); 632 inputBuffer.Zap(parserLen); 633 } 619 634 int len; 620 635 if(dtsPassthrough) … … 631 646 if (len < 0) { 632 647 Codecprintf(NULL, "Error decoding audio frame\n"); 633 inputBuffer.Zap(packetSize); 648 if(!parser) 649 inputBuffer.Zap(packetSize); 634 650 outBufUsed = 0; 635 651 ioOutputDataByteSize = written; … … 637 653 return kAudioCodecProduceOutputPacketFailure; 638 654 } 639 inputBuffer.Zap(len); 655 if(!parser) 656 inputBuffer.Zap(len); 640 657 641 658 // copy up to the amount requested trunk/FFissionCodec/FFissionDecoder.h
r1144 r1256 63 63 bool dtsPassthrough; 64 64 int fullChannelMap[6]; 65 AVCodecParserContext *parser; 65 66 }; 66 67 trunk/ff_MovieImport.c
r1242 r1256 119 119 REGISTER_DEMUXER(tta); 120 120 REGISTER_DEMUXER(nuv); 121 register_parsers(); 121 REGISTER_PARSER(ac3); 122 REGISTER_PARSER(mpegaudio); 122 123 123 124 REGISTER_DECODER(msmpeg4v1); trunk/ff_private.c
r1246 r1256 1014 1014 1015 1015 // record stream durations before we add any samples so that we know what to tell InsertMediaIntoTrack later 1016 // also, tell ffmpeg that we don't want them parsing because their parsers screw up the position/size data!!! 1016 1017 for(i = 0; i < storage->map_count; i++) { 1017 1018 ncstream = &storage->stream_map[i]; … … 1020 1021 if(media && ncstream->duration == -1) 1021 1022 ncstream->duration = GetMediaDuration(media); 1023 ncstream->str->need_parsing = AVSTREAM_PARSE_NONE; 1022 1024 } 1023 1025
