Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
use sane defaults for audio channels and samplerate
  • Loading branch information
Jalle19 committed Mar 5, 2014
1 parent 39c3d36 commit a762427
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addons/pvr.hts/src/HTSPDemux.cpp
Expand Up @@ -254,8 +254,8 @@ inline void HTSPResetDemuxStreamInfo(PVR_STREAM_PROPERTIES::PVR_STREAM &stream)

inline void HTSPSetDemuxStreamInfoAudio(PVR_STREAM_PROPERTIES::PVR_STREAM &stream, htsmsg_t *msg)
{
stream.iChannels = htsmsg_get_u32_or_default(msg, "channels" , 0);
stream.iSampleRate = htsmsg_get_u32_or_default(msg, "rate" , 0);
stream.iChannels = htsmsg_get_u32_or_default(msg, "channels" , 2);
stream.iSampleRate = htsmsg_get_u32_or_default(msg, "rate" , 48000);
}

inline void HTSPSetDemuxStreamInfoVideo(PVR_STREAM_PROPERTIES::PVR_STREAM &stream, htsmsg_t *msg)
Expand Down

3 comments on commit a762427

@FernetMenta
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I don't know much about tv headend and why this defaults are needed. Why does hts send invalid or no values?

@Jalle19
Copy link
Owner Author

@Jalle19 Jalle19 commented on a762427 Mar 5, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The values are optional and at least for me it falls back on the default value (0 before) all the time. Since there cannot be an audio stream with neither 0 channels nor 0 sample rate I believe these defaults are much better (plus it reduces the ParsePacket log spam).

@Jalle19
Copy link
Owner Author

@Jalle19 Jalle19 commented on a762427 Mar 6, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adamsutton do you know of any scenarios (or versions of tvheadend) where the channels/rate are actually sent?

Please sign in to comment.