mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-27 15:33:00 +02:00
libeplayer3/ffmpeg: minor cleanup
This commit is contained in:
@@ -326,7 +326,6 @@ static void FFMPEGThread(Context_t *context) {
|
|||||||
strncpy(threadname, __func__, sizeof(threadname));
|
strncpy(threadname, __func__, sizeof(threadname));
|
||||||
threadname[16] = 0;
|
threadname[16] = 0;
|
||||||
prctl (PR_SET_NAME, (unsigned long)&threadname);
|
prctl (PR_SET_NAME, (unsigned long)&threadname);
|
||||||
AVPacket packet;
|
|
||||||
off_t lastSeek = -1;
|
off_t lastSeek = -1;
|
||||||
long long int lastPts = -1, currentVideoPts = -1, currentAudioPts = -1, showtime = 0, bofcount = 0;
|
long long int lastPts = -1, currentVideoPts = -1, currentAudioPts = -1, showtime = 0, bofcount = 0;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
@@ -426,6 +425,9 @@ static void FFMPEGThread(Context_t *context) {
|
|||||||
context->output->Command(context, OUTPUT_AUDIOMUTE, "0");
|
context->output->Command(context, OUTPUT_AUDIOMUTE, "0");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AVPacket packet;
|
||||||
|
av_init_packet(&packet);
|
||||||
|
|
||||||
if (av_read_frame(avContext, &packet) == 0 )
|
if (av_read_frame(avContext, &packet) == 0 )
|
||||||
{
|
{
|
||||||
long long int pts;
|
long long int pts;
|
||||||
@@ -907,8 +909,6 @@ int container_ffmpeg_init(Context_t *context, char * filename)
|
|||||||
* until other works are done and we can prove this.
|
* until other works are done and we can prove this.
|
||||||
*/
|
*/
|
||||||
avformat_close_input(&avContext);
|
avformat_close_input(&avContext);
|
||||||
//for buffered io
|
|
||||||
ffmpeg_buf_free();
|
|
||||||
//for buffered io (end)
|
//for buffered io (end)
|
||||||
return cERR_CONTAINER_FFMPEG_STREAM;
|
return cERR_CONTAINER_FFMPEG_STREAM;
|
||||||
#endif
|
#endif
|
||||||
@@ -1021,7 +1021,7 @@ int container_ffmpeg_update_tracks(Context_t *context, char *filename, int initi
|
|||||||
track.Name = "und";
|
track.Name = "und";
|
||||||
track.Encoding = encoding;
|
track.Encoding = encoding;
|
||||||
track.stream = stream;
|
track.stream = stream;
|
||||||
track.Id = ((AVStream *) (track.stream))->id;
|
track.Id = stream->id;
|
||||||
|
|
||||||
if(stream->duration == AV_NOPTS_VALUE) {
|
if(stream->duration == AV_NOPTS_VALUE) {
|
||||||
ffmpeg_printf(10, "Stream has no duration so we take the duration from context\n");
|
ffmpeg_printf(10, "Stream has no duration so we take the duration from context\n");
|
||||||
@@ -1057,7 +1057,7 @@ int container_ffmpeg_update_tracks(Context_t *context, char *filename, int initi
|
|||||||
|
|
||||||
track.Encoding = encoding;
|
track.Encoding = encoding;
|
||||||
track.stream = stream;
|
track.stream = stream;
|
||||||
track.Id = ((AVStream *) (track.stream))->id;
|
track.Id = stream->id;
|
||||||
track.duration = (double)stream->duration * av_q2d(stream->time_base) * 1000.0;
|
track.duration = (double)stream->duration * av_q2d(stream->time_base) * 1000.0;
|
||||||
track.aacbuf = 0;
|
track.aacbuf = 0;
|
||||||
track.have_aacheader = -1;
|
track.have_aacheader = -1;
|
||||||
@@ -1255,7 +1255,7 @@ int container_ffmpeg_update_tracks(Context_t *context, char *filename, int initi
|
|||||||
|
|
||||||
track.Encoding = encoding;
|
track.Encoding = encoding;
|
||||||
track.stream = stream;
|
track.stream = stream;
|
||||||
track.Id = ((AVStream *) (track.stream))->id;
|
track.Id = stream->id;
|
||||||
track.duration = (double)stream->duration * av_q2d(stream->time_base) * 1000.0;
|
track.duration = (double)stream->duration * av_q2d(stream->time_base) * 1000.0;
|
||||||
|
|
||||||
track.aacbuf = 0;
|
track.aacbuf = 0;
|
||||||
|
Reference in New Issue
Block a user