mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-27 07:22:44 +02:00
libeplayer3/container_ffmpeg: initialize stream ids, if unset
Origin commit data
------------------
Branch: master
Commit: 034ab89f28
Author: martii <m4rtii@gmx.de>
Date: 2013-07-21 (Sun, 21 Jul 2013)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -454,8 +454,7 @@ static void FFMPEGThread(Context_t *context) {
|
|||||||
|
|
||||||
ffmpeg_printf(200, "packet.size %d - index %d\n", packet.size, pid);
|
ffmpeg_printf(200, "packet.size %d - index %d\n", packet.size, pid);
|
||||||
|
|
||||||
if (videoTrack != NULL) {
|
if (videoTrack && (videoTrack->Id == pid)) {
|
||||||
if (videoTrack->Id == pid) {
|
|
||||||
currentVideoPts = videoTrack->pts = pts = calcPts(videoTrack->stream, packet.pts);
|
currentVideoPts = videoTrack->pts = pts = calcPts(videoTrack->stream, packet.pts);
|
||||||
|
|
||||||
if ((currentVideoPts > latestPts) && (currentVideoPts != INVALID_PTS_VALUE))
|
if ((currentVideoPts > latestPts) && (currentVideoPts != INVALID_PTS_VALUE))
|
||||||
@@ -477,11 +476,7 @@ static void FFMPEGThread(Context_t *context) {
|
|||||||
if (context->output->video->Write(context, &avOut) < 0) {
|
if (context->output->video->Write(context, &avOut) < 0) {
|
||||||
ffmpeg_err("writing data to video device failed\n");
|
ffmpeg_err("writing data to video device failed\n");
|
||||||
}
|
}
|
||||||
}
|
} else if (audioTrack && (audioTrack->Id == pid)) {
|
||||||
}
|
|
||||||
|
|
||||||
if (audioTrack != NULL) {
|
|
||||||
if (audioTrack->Id == pid) {
|
|
||||||
currentAudioPts = audioTrack->pts = pts = calcPts(audioTrack->stream, packet.pts);
|
currentAudioPts = audioTrack->pts = pts = calcPts(audioTrack->stream, packet.pts);
|
||||||
|
|
||||||
if ((currentAudioPts > latestPts) && (!videoTrack))
|
if ((currentAudioPts > latestPts) && (!videoTrack))
|
||||||
@@ -534,7 +529,6 @@ static void FFMPEGThread(Context_t *context) {
|
|||||||
|
|
||||||
while(avpkt.size > 0)
|
while(avpkt.size > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
int got_frame = 0;
|
int got_frame = 0;
|
||||||
if (!decoded_frame) {
|
if (!decoded_frame) {
|
||||||
if (!(decoded_frame = avcodec_alloc_frame())) {
|
if (!(decoded_frame = avcodec_alloc_frame())) {
|
||||||
@@ -659,7 +653,6 @@ static void FFMPEGThread(Context_t *context) {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
avOut.data = packet.data;
|
avOut.data = packet.data;
|
||||||
avOut.len = packet.size;
|
avOut.len = packet.size;
|
||||||
avOut.pts = pts;
|
avOut.pts = pts;
|
||||||
@@ -676,11 +669,9 @@ static void FFMPEGThread(Context_t *context) {
|
|||||||
ffmpeg_err("writing data to audio device failed\n");
|
ffmpeg_err("writing data to audio device failed\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subtitleTrack != NULL) {
|
if (subtitleTrack && (subtitleTrack->Id == pid)) {
|
||||||
if (subtitleTrack->Id == pid) {
|
|
||||||
float duration=3.0;
|
float duration=3.0;
|
||||||
ffmpeg_printf(100, "subtitleTrack->stream %p \n", subtitleTrack->stream);
|
ffmpeg_printf(100, "subtitleTrack->stream %p \n", subtitleTrack->stream);
|
||||||
|
|
||||||
@@ -785,10 +776,8 @@ static void FFMPEGThread(Context_t *context) {
|
|||||||
free(line);
|
free(line);
|
||||||
}
|
}
|
||||||
} /* duration */
|
} /* duration */
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (dvbsubtitleTrack != NULL) {
|
else if (dvbsubtitleTrack && (dvbsubtitleTrack->Id == pid)) {
|
||||||
if (dvbsubtitleTrack->Id == pid) {
|
|
||||||
dvbsubtitleTrack->pts = pts = calcPts(dvbsubtitleTrack->stream, packet.pts);
|
dvbsubtitleTrack->pts = pts = calcPts(dvbsubtitleTrack->stream, packet.pts);
|
||||||
|
|
||||||
ffmpeg_printf(200, "DvbSubTitle index = %d\n",pid);
|
ffmpeg_printf(200, "DvbSubTitle index = %d\n",pid);
|
||||||
@@ -808,10 +797,7 @@ static void FFMPEGThread(Context_t *context) {
|
|||||||
{
|
{
|
||||||
//ffmpeg_err("writing data to dvbsubtitle fifo failed\n");
|
//ffmpeg_err("writing data to dvbsubtitle fifo failed\n");
|
||||||
}
|
}
|
||||||
}
|
} else if (teletextTrack && (teletextTrack->Id == pid)) {
|
||||||
}
|
|
||||||
if (teletextTrack != NULL) {
|
|
||||||
if (teletextTrack->Id == pid) {
|
|
||||||
teletextTrack->pts = pts = calcPts(teletextTrack->stream, packet.pts);
|
teletextTrack->pts = pts = calcPts(teletextTrack->stream, packet.pts);
|
||||||
|
|
||||||
ffmpeg_printf(200, "TeleText index = %d\n",pid);
|
ffmpeg_printf(200, "TeleText index = %d\n",pid);
|
||||||
@@ -831,7 +817,6 @@ static void FFMPEGThread(Context_t *context) {
|
|||||||
{
|
{
|
||||||
//ffmpeg_err("writing data to teletext fifo failed\n");
|
//ffmpeg_err("writing data to teletext fifo failed\n");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (packet.data)
|
if (packet.data)
|
||||||
@@ -1002,6 +987,9 @@ int container_ffmpeg_update_tracks(Context_t *context, char *filename)
|
|||||||
if (encoding != NULL)
|
if (encoding != NULL)
|
||||||
ffmpeg_printf(1, "%d. encoding = %s - version %d\n", n, encoding, version);
|
ffmpeg_printf(1, "%d. encoding = %s - version %d\n", n, encoding, version);
|
||||||
|
|
||||||
|
if (!stream->id)
|
||||||
|
stream->id = n;
|
||||||
|
|
||||||
/* some values in track are unset and therefor copyTrack segfaults.
|
/* some values in track are unset and therefor copyTrack segfaults.
|
||||||
* so set it by default to NULL!
|
* so set it by default to NULL!
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user