libeplayer3: minor adjustments

Origin commit data
------------------
Branch: master
Commit: dff15731cb
Author: martii <m4rtii@gmx.de>
Date: 2014-05-02 (Fri, 02 May 2014)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
martii
2014-05-02 13:34:08 +02:00
parent 100818b5e0
commit 14fd1e3f14
3 changed files with 4 additions and 4 deletions

View File

@@ -313,8 +313,8 @@ bool Input::ReadSubtitle(const char *filename, const char *format, int pid)
dvbsub_ass_write(c, &sub, pid);
av_free_packet(&packet);
}
avformat_close_input(&subavfc);
avcodec_close(c);
avformat_close_input(&subavfc);
avformat_free_context(subavfc);
Track track;

View File

@@ -129,7 +129,6 @@ bool WriterPCM::prepareClipPlay()
SubFrameLen *= uBitsPerSample / 8;
//rewrite PES size to have as many complete subframes per PES as we can
// FIXME: PES header size was hardcoded to 18 in earlier code. Actual size returned by InsertPesHeader is 14.
SubFramesPerPES = ((sizeof(injectBuffer) - 18) - sizeof(lpcm_prv)) / SubFrameLen;
SubFrameLen *= SubFramesPerPES;
@@ -248,6 +247,7 @@ bool WriterPCM::Write(AVPacket *packet, int64_t pts)
fprintf(stderr, "%s %d: avcodec_find_decoder(%llx)\n", __func__, __LINE__, (unsigned long long) c->codec_id);
return false;
}
avcodec_close(c);
if (avcodec_open2(c, codec, NULL)) {
fprintf(stderr, "%s %d: avcodec_open2 failed\n", __func__, __LINE__);
return false;
@@ -292,7 +292,7 @@ bool WriterPCM::Write(AVPacket *packet, int64_t pts)
int e = swr_init(swr);
if (e < 0) {
fprintf(stderr, "swr_init: %d (icl=%d ocl=%d isr=%d osr=%d isf=%d osf=%d\n",
fprintf(stderr, "swr_init: %d (icl=%d ocl=%d isr=%d osr=%d isf=%d osf=%d)\n",
-e, (int) c->channel_layout,
(int) out_channel_layout, c->sample_rate, out_sample_rate, c->sample_fmt, AV_SAMPLE_FMT_S16);
restart_audio_resampling = true;

View File

@@ -107,7 +107,7 @@ int InsertPesHeader(uint8_t *data, int size, uint8_t stream_id, int64_t pts, int
PutBits(&ld2, 0x1, 8); // Start Code
PutBits(&ld2, pic_start_code & 0xff, 8); // 00, for picture start
PutBits(&ld2, (pic_start_code >> 8) & 0xff, 8); // For any extra information (like in mpeg4p2, the pic_start_code)
//14 + 4 = 18
//14 + 5 = 19
}
FlushBits(&ld2);